Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 Before February 2015

italkalot
Guest

How to create Bot

[1] This is how to make a bot on Everybody edits.
[2] First you need a program named "Mircrosoft Visual C# 2010 Express".
[3] Go to "http://www.visualstudio.com/"
[4] Click "Downloads"
[5] Scroll down until you see the category named "Visual Studio 2010 Express"
[6] Click the blue boxed labeled "Visual C# 2010 Express"
[7] Select the language you speak.
[8] Click Install now.
[9] After the program gets done installing, Open it.
[10] The start page will show up. On the left side of the start page click "New Project...".
[11] At the top there a labeled "sort by:" beside it there a combo box and you select sort by "default".
[12] After doing, Select the prgrom named "Windows Form Application". At the very bottem there a box you can replace the name of the project.
[13] After naming your project click the button on the far bottem right labeled "ok".
[14] Now a new page shows up.
[15] Right click on the window named "Form1". Now click "View Code".
[16] This is where you will be coding your bot.
[17] Now you will need a PlayerIoClient.dll file.
[18] After allocating one on your computer or downloading one.
[19] Go to the top of the page where the label "Project" click it.
[20] Go down to "Add reference..." click it.
[21] A small window will pop up. Click the tab named "browse" then allocate the PlayerIoClient.dll file and select it. Then click "Ok" button in bottem right of the box.
[22] After adding the reference PlayerIoClient.dll. Find "using System.Windows.Forms;" and press enter
[23] After pressing enter type the following: using PlayerIOClient;
[24] Now underneath using PlayerIOClient; add using System.Threading;
[25] now go to the last line of code and erase the last two barracks so it looks like the following:
[26]
[27] namespace WindowsFormsApplication1
[28] {
[29]      {
[30]      public partial class Form1 : Form
[31]      {
[32]      public Form1()
[33]         {
[34]         InitializeComponent();
[35]         }
[36]
[37] Now add the following variables: public Client client; Connection con;
[38] After adding the following variables type the following underneath them.
[39]
[40] public void Connect(string email, string password, string worldid)
[41]         {
[42]            this.client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", email, password);
[43]            this.con = this.client.Multiplayer.CreateJoinRoom(worldid, "public", true, new Dictionary<string, string>(), new Dictionary<string, string>());
[44]            this.con.OnMessage += new MessageReceivedEventHandler(onMessage);
[45]      }
[46]
[47] Now add the following underneath
[48]
[49] public void onMessage(object sender, PlayerIOClient.Message m)
[50]      {
[51]            switch (m.Type)
[52]            {
[53]              case "init":
[54]              return;
[55]            }
[56]      }
[57] }     
[58]
[59] Now after adding the following go back to your Form by pressing "Shift + f7".
[60] On the right there a tool box add One button and two textboxes.
[61] After adding the following double click the button
[62] Then add the following code:
[63]
[64] this.Connect(textBox1.Text, textBox2.Text, textBox3.Text);
[65] con.Send("init", new object[0]);
[66] con.Send("init2", new object[0]);
[67]
[68] Now hit "Shift + f7" again.
[69] Now the first box is your email box.
[70] The second box is your password box.
[71] The third is your world id box.
[72] If you press "F5" it will debug the program and it should work fine.
[73] Now you have your own personal bot.
[74] Don't forget to save. //forums.everybodyedits.com/img/smilies/big_smile
[75] Shortcut to save is "Ctrl + Shift + s".
[76] Have fun.
[77]
[78] This Guide was created by: Italkalot
[79] Credits: Microsoft 2014, Visual Studio, Everybody edits and Italkalot
[80]
[81] This document was for educational purposes only. Thank you and have a great day.

#2 Before February 2015

Anch
Member
Joined: 2015-02-16
Posts: 5,447

Re: How to create Bot

Cool! This would have helped me if I didn't have my friends to help me.

Offline

#3 Before February 2015

Fdoou
Banned

Re: How to create Bot

wtf do i do at step 26

#4 Before February 2015

Flish
Guest

Re: How to create Bot

Fdoou wrote:

wtf do i do at step 26

Obviously nothing. They are not steps necessarily. It's an empty space...

#5 Before February 2015

Fdoou
Banned

Re: How to create Bot

how the hell do i empty space

#6 Before February 2015

Flish
Guest

Re: How to create Bot

Fdoou wrote:

how the hell do i empty space

Stop trying to troll.
Just make your bot.

#7 Before February 2015

lrussell
Member
From: Saturn's Titan
Joined: 2015-02-15
Posts: 843
Website

Re: How to create Bot

What about lines 36, 39, 46, 48, 58, 63, 67, 77, and 80?

Offline

#8 Before February 2015

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,645

Re: How to create Bot

This tutorial is 30% wrong.
1. You can use other programming language than C#.
2. You can use other IDE's than VS 2010.
3. You can place the PlayerIO namespace wherever you want.(outside the class)
4. The "this." dosen't have any importance in this context.
5. Instead of "new Dictionary" "new object" you should use null.
6. At switch you put "return" instead of "break".
7. The method Connect dosen't have any point. You can leave it in button action.
8. Not everybody want a bot with GUI...
I doubt that credits go only to you is clearly that you decompile a bot. And you make your one PlayerIO client because you didnt want to give credits to Yahoo Game Network.

Last edited by The Doctor (Aug 13 2014 3:04:17 am)


Everybody edits, but some edit more than others

Offline

#9 Before February 2015

abrar11
Member
Joined: 2015-03-13
Posts: 359

Re: How to create Bot

I'M USING ALL CAPS BECAUSE IT'S KINDA HARD TO NOTE BUT
[49] public void onMessage(object sender, PlayerIOClient.Message m)
[50] {
                YOU SHOULD USE
                 if(m.Type == "init")
                 {
                 // just a little tip it gets m.Type faster then switches
                 }
           }     
con.Send("init", new object[0]); // YOU CAN JUST DO con.Send("init");
con.Send("init2", new object[0]);   // YOU CAN JUST DO con.Send("init2");// the new object[0] ISN'T NEEDED

Offline

#10 Before February 2015

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,832

Re: How to create Bot

Fdoou wrote:

how the hell do i empty space

LOL xD. Maybe tab over a few times for no reason.

abrar11 wrote:

                YOU SHOULD USE
                 if(m.Type == "init")

With the tiny number of message types EE supports, there's no measurable performance difference between using a switch and using lots of IFs. With that in mind you might as well use   case 'blah:'   as it's easier and quicker.

I'll add a few notes regarding that tutorial as well:
- The Connect method should have try/catch PlayerIOError exception handling.
- this.con.OnMessage += new MessageReceivedEventHandler(onMessage); can just be "con.OnMessage += onMessage"
- The switch statement should always use "break;", and not "return;"

The Doctor wrote:

And you make your one PlayerIO client because you didnt want to give credits to Yahoo Game Network.

The client library bot makers use, is and will always be PlayerIOClient.dll. Giving credits is irrelevant as PlayerIO made the .dll by itself, and the whole company was bought by YahooGamesNetwork. No credit deserved.

Last edited by Tomahawk (Aug 13 2014 11:40:58 am)


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#11 Before February 2015

abrar11
Member
Joined: 2015-03-13
Posts: 359

Re: How to create Bot

abrar11 wrote:
Tomahawk wrote:
abrar11 wrote:

                YOU SHOULD USE
                 if(m.Type == "init")

With the tiny number of message types EE supports, there's no measurable performance difference between using a switch and using lots of IFs. With that in mind you might as well use   case 'blah:'   as it's easier and quicker.

But it's 2 lines shorter :/

Offline

#12 Before February 2015

Fdoou
Banned

Re: How to create Bot

lrussell wrote:

What about lines 36, 39, 46, 48, 58, 63, 67, 77, and 80?

i couldn't even get to those... //forums.everybodyedits.com/img/smilies/smile

#13 Before February 2015

TiKen
Member
Joined: 2015-02-24
Posts: 298

Re: How to create Bot

I have a question related to the "How to create a bot" for OP and I think it might be interesting since it will help me or other to understand a bit what you are talking about sometime:

@Italkalot: what do you mean, when you say the "setup" of a bot ? (This term came out during a chat on my pre-early pre-alpha debug test for the 2D RPG bot)

Offline

#14 Before February 2015

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: How to create Bot

Since we're all discussing the "shoulds" of ee/playerio funstuffs, why not follow this #1 rule:

#1. Don't post your code for others to see.

If it works, who cares what the best practice is? In this case, most of what you folks point out is moot.
Sure, there are some (probably) unintentional actions... but yay programming.

Tbh, I hate using switches. Sure, people claim they are better... but when I want to make variables, they tend to run together. :'c

Offline

#15 Before February 2015

TiKen
Member
Joined: 2015-02-24
Posts: 298

Re: How to create Bot

hummerz5 wrote:

Tbh, I hate using switches. Sure, people claim they are better... but when I want to make variables, they tend to run together. :'c

The power of {brackets}: Just open a bracket after your "case 'blarh':" , and close it just before the "break;" (or after, as you like) and *Tadam* you can use whatever name of variable you want, without VS shouting at your face that even it's grandma can program better than you!

Take that stupid VS2010!

Offline

#16 Before February 2015

Buzzerbee
Forum Admin
From: Texas, U.S.A.
Joined: 2015-02-15
Posts: 4,570

Re: How to create Bot

WHOA. HOLD UP.
ABRAR
IF STATEMENTS ARE DEFINITELY NOT FASTER THAN SWITCHES

Trust me, RDash and I looked well into the uses of switches and if statements. Switches are faster, I can't remember why but when I get on the computer I'll research it and let you know.

Don't tell people stuff you know nothing about.


TdQRyz3.png
https://wiki.everybodyedits.com/images/5/5d/135_bee

Offline

#17 Before February 2015

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: How to create Bot

[25] now go to the last line of code and erase the last two barracks so it looks like the following:

Why do you erase these?


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#18 Before February 2015

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: How to create Bot

Xfrogman43 wrote:

[25] now go to the last line of code and erase the last two barracks so it looks like the following:

Why do you erase these?

We built 2 perfectly good barracks and he wants us to just get rid of them wth?

I think it's so it's formats the code with tabs at the end..?


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#19 Before February 2015

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,832

Re: How to create Bot

BuzzerBee wrote:

WHOA. HOLD UP.

Trust me, RDash and I looked well into the uses of switches and if statements. Switches are faster, I can't remember why but when I get on the computer I'll research it and let you know.

Don't tell people stuff you know nothing about.

I'll just jump in here and say that when a switch statement has a large number (not sure exactly) of things to handle, it uses a hash table as a lookup to find the right case, a bit like having a dictionary with the message type as the key, and a delegate to the code block as the value.
But that's a little irrelevant, given that most botters use less than 15 things in the usual OnMessage switch.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

italkalot 1423758463202969

Board footer

Powered by FluxBB

[ Started around 1713875620.1741 - Generated in 0.180 seconds, 12 queries executed - Memory usage: 1.72 MiB (Peak: 1.96 MiB) ]