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.

#26 Before February 2015

Cyral
Member
From: United States
Joined: 2015-02-15
Posts: 2,269

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

BuzzerBee wrote:

Hey, Tako. If you would like me to I could make an in-depth description as well as instructions for each of the methods in In.cs and Out.cs

Wait... We are supposed to comment and maintain code?

Also Tako,   If you want too you can leave a link to my old bot ideas thread in the "What should I made" section.

Last edited by Cyral (Jun 13 2013 12:56:00 pm)


Player Since 2011. I used to make bots and stuff.

Offline

#27 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Yes to both of you.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#28 Before February 2015

NR2001
Guest

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Tako, if you want some source codes for AG login system to implement into Skylight, Capasha made this sample / tutorial:
http://pastebin.com/QDzmb3qM
I'll be willing to test it out if implemented.

#29 Before February 2015

skullz17
Member
Joined: 2015-02-15
Posts: 6,699

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

This actually looks really good, even though as simple as it seems, being the programming nub that I am, I probably won't be able to understand it //forums.everybodyedits.com/img/smilies/tongue


m3gPDRb.png

thx for sig bobithan

Offline

#30 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

skullz16 wrote:

This actually looks really good, even though as simple as it seems, being the programming nub that I am, I probably won't be able to understand it //forums.everybodyedits.com/img/smilies/tongue

See my previous post if you're interested in learning C#.

If you want to have any type of involvement with programming and developing bots or applications, then a language is necessary. Most of it seems completely alien at first, but naturally once you start using it and looking at examples and learning the lingo, you become as versed in it as you are English.

However, if you want to attempt to make a very simple bot just to see how you like it, check out the second-to-last code block on the guide after reading up on some basic C# principals such as "if statements", "object declaration", and "method calls".


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#31 Before February 2015

Jojatekok
Guest

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Oh, I just forgot to link the ArmorGames login guide: http://dl.dropbox.com/u/25388939/EEA%20 … ation.html

(As it's supported now //forums.everybodyedits.com/img/smilies/wink )

#32 Before February 2015

Kentiya
Member
From: United States
Joined: 2015-02-16
Posts: 1,112
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

The tutorial will need updated because this line:

        static Bot MyBot = new Bot("hiddenEmail", "hiddenPassword", MyRoom);

is supposed to be this:

        static Bot MyBot = new Bot(MyRoom, "hiddenEmail", "hiddenPassword");


atikyne-cartoony-120.png
Kentiya / Atikyne — EE & EEU lead artist 2018-2020

Offline

#33 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Kentiya wrote:

The tutorial will need updated because this line:

        static Bot MyBot = new Bot("hiddenEmail", "hiddenPassword", MyRoom);

is supposed to be this:

        static Bot MyBot = new Bot(MyRoom, "hiddenEmail", "hiddenPassword");

Ah, yes, thank you for reminding me.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#34 Before February 2015

skullz17
Member
Joined: 2015-02-15
Posts: 6,699

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

I do know the simple stuff about C# like if statements and switch statements but not much more than that.

I'll read up on the other stuff you mentioned, thanks.


m3gPDRb.png

thx for sig bobithan

Offline

#35 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

skullz16 wrote:

I do know the simple stuff about C# like if statements and switch statements but not much more than that.

I'll read up on the other stuff you mentioned, thanks.

Honestly, you can make a ton of things using very few C# elements.

That's what's great about programming... once you learn something, you don't stop using it. Everything that you learn is added to your inventory of knowledge, and eventually you end up with this nice array of things to choose from, just like buying clothes or whatever.

After like a day or two of learning C# you can accomplish myriad of tasks.   I know this from experience and also from watching other people learn C#.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#36 Before February 2015

NR2001
Guest

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

How do I do an ArmorGames login, since it was added but not explained...?

#37 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

NR2001 wrote:

How do I do an ArmorGames login, since it was added but not explained...?

You will have to ask Jojatekok (or ArmorGames support) how to get tokens. I am unfamiliar with it.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#38 Before February 2015

NR2001
Guest

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Already PM'ed him. Thanks.

#39 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Here are some mini-guides on how to do specific things:

Create a chat command
General idea: You're the only one who can command your bot. If you want to extend the control to other people, that is best accomplished through the in-game chat system. Here is how you create a chat-command with or without parameters:

public static void ChatHandler(ChatEventArgs e) {     string line = e.Message.ToLower();     string[] args = line.Split(' ');      // Example 1: a command that has no arguments.     if (args[0] == "!ping")     {         MyBot.Push.Say("Pong!");     }      // Example 2: a command with one argument,     // Verify that there is indeed an extra argument.     if (args[0] == "!kick" && args.Length == 2)     {         Player p = Tools.GetPlayerByName(args[1]);          if (p != null)         {         MyBot.Push.Kick(p);         Console.WriteLine("Kicked {0}.", p.Name);         }         else         {             MyBot.Push.Say("Cannot find " + args[1] + ".");         }     }      // Example 3: a command with a special argument.     // Since the args are in string form, you need to use Convert.ToInt32.      // If Convert.ToInt32 cannot convert it (i.e., if someone puts in a non-number where there should be one),      // the program will stop. Here is how you can prevent that:     // Verify that there are enough arguments.     if (args[0] == "!ban" && args.Length == 3)     {         Player p = Tools.GetPlayerByName(args[1]);                  if (p != null)         {             try             {                 int duration = Convert.ToInt32(args[2]);                                  // This method needs to be added yourself.                 Ban(p, duration);                  MyBot.Push.Say("Successfully banned " + p.Name + ".");             }             catch (FormatException)             {                 MyBot.Push.Say("Did not recognize duration - try using a number.");             }         }         else         {             MyBot.Push.Say("Cannot find " + args[1] + ".");         }     } }

Usage:

!ping

!kick takoman02

!ban takoman02 10

Move a block
General idea: delete the block, and place a new block one block in the direction you pick.

public enum Direction {     UP,     DOWN,     LEFT,     RIGHT }  public static void MoveBlock(Block b, Direction d) {     // Leave an empty space where the old block was.     Block oldBlock = new Block(0, b.X, b.Y);      int newX = b.X, newY = b.Y;      switch (d)     {         case Direction.UP:             newY--;             break;         case Direction.DOWN:             newY++;             break;         case Direction.LEFT:             newX--;             break;         case Direction.RIGHT:             newX++;             break;     }      Block newBlock = new Block(b.Id, newX, newY);      <BOT>.Push.Build(oldBlock);     <BOT>.Push.Build(newBlock); }

Usage:

Block testBlock = new Block(BlockIds.Blocks.Basic.DARKGRAY, 10, 10); MoveBlock(testBlock, Direction.DOWN);

Create an invisible portal that only works for certain people*
General idea: If the player jumps into the "portal" (which is just an non-solid block in-game), and they fit a certain criteria, then they are teleported. No need for actual portals, much more flexible.

public static void JumpEventHandler(PlayerEventArgs e) {     // If they jump from below the portal...     if (e.Subject.X == <PORTAL_X> && e.Subject.Y > <PORTAL_Y>)     {         // ...and they fit whatever criteria... (this is just an example)         if (e.Subject.CollectedMagic > 0)         {             // ...teleport them to the exit...             <BOT>.Push.Teleport(<DESTINATION_X>, <DESTINATION_Y>, e.Subject);         }     } }

Usage:
7816f7fe97.png
Where the jail-window-background-thing is the "portal". It doesn't need to have a background, but it's probably best that it does so players know what it is.

*Disclaimer: The player shouldn't be able to hold a key from far away and access it that way. In other words, it should be in closed-off areas.

Automatically save the level
General idea: Sometimes you just forget to save and end up losing lots of work. Add this simple bit of code to automatically save after certain intervals.

// using statements... using System.Threading;  class MyClass {     // Use a thread so it runs in the background.     public static Thread AutoSaveThread = new Thread(AutoSave);       // Should it be auto-saving?     public static bool ShouldBeAutoSaving = true;       // Should it say "Saved." every time it saves?     public static bool AnnounceAutosaves = false;      // How long should it wait before it saves again? One minute? Ten minutes? One hour?     public static int MinutesAutoSaveDelays = 5;         public static void AutoSave()     {         while (ShouldBeAutoSaving)         {             Thread.Sleep(MinutesAutoSaveDelays * 60000);             MyBot.Push.Save();             if (AnnounceAutosaves)             {                 MyBot.Push.Say("Saved.");             }         }     } }

Usage:

public static void Main(string[] args) {     // do things      // Begin auto-saving immediately.     AutoSaveThread.Start(); }

-----
More to come (when I think of some things that people would like to do).


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#40 Before February 2015

Cyral
Member
From: United States
Joined: 2015-02-15
Posts: 2,269

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

TakoMan02 wrote:

<L33T codez and stoof>

Nice ideas


Player Since 2011. I used to make bots and stuff.

Offline

#41 Before February 2015

skullz17
Member
Joined: 2015-02-15
Posts: 6,699

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

I randomly decided to make my first bot today, which was pretty successful. Got the connection working, and some console commands.

I'm trying to do chat commands now, but no idea how to. I used your ping-pong example but it didn't work. I don't really understand what arguments are or any of that stuff. If I understood what I was writing, maybe I would be able to figure it out.

Help?

EDIT: Confused about a few stuff with blocks as well, I really suck at this.

Last edited by skullz16 (Jul 13 2013 11:56:10 am)


m3gPDRb.png

thx for sig bobithan

Offline

#42 Before February 2015

Zoidy☺
Guest

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

yaH rly cool takO i lik it thanx //forums.everybodyedits.com/img/smilies/wink);;0))

#43 Before February 2015

skullz17
Member
Joined: 2015-02-15
Posts: 6,699

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

TakoMan02 wrote:

You can create a block just by typing:

Block b = new Block(id, x, y);

But if that's a declaration I'm confused as to how you would use it for something like a chat command making a block appear somewhere.


m3gPDRb.png

thx for sig bobithan

Offline

#44 Before February 2015

Cyral
Member
From: United States
Joined: 2015-02-15
Posts: 2,269

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

skullz16 wrote:

I randomly decided to make my first bot today, which was pretty successful. Got the connection working, and some console commands.

I'm trying to do chat commands now, but no idea how to. I used your ping-pong example but it didn't work. I don't really understand what arguments are or any of that stuff. If I understood what I was writing, maybe I would be able to figure it out.

Help?

EDIT: Confused about a few stuff with blocks as well, I really suck at this.

Well I really haven't used this API much, so I'm not sure the exact functions but here is something to help you out.

Arguments are usually the chat message split by spaces and put into an array, for example:

/somecommand derp lol

Will return for the args[]

args[0] = /somecommand args[1] = derp args[2] = lol

For placing blocks on a command (like /placeblock type x y), you could do something like

if (Message.Args[0] == "/placeblock")
{
        Block b = new Block(args[1], args[2], args[3]);
}

Thats just my 2 cents, I'm sure Tako could help you if you post your code to pastbin (or what I suggest, stypi for collaborating)

Last edited by Cyral (Jul 14 2013 12:46:43 pm)


Player Since 2011. I used to make bots and stuff.

Offline

#45 Before February 2015

skullz17
Member
Joined: 2015-02-15
Posts: 6,699

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

I understand how the chat commands work now, but looking at my code, it seems it should work for me but it isn't.

And for the block placing, args has to be declared as string for the "!placeblock" part but for the x and the y values it has to be declared as int. This doesn't really make sense to me.

EDIT: Oops, never mind about the block placing thing, I forgot about the simple int.Parse

EDIT 2: I just made a !placeblock command, and have realised that none of the chat commands that I am creating are working, however they both look perfectly fine.

Last edited by skullz16 (Jul 16 2013 11:55:49 am)


m3gPDRb.png

thx for sig bobithan

Offline

#46 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

skullz16 wrote:

I understand how the chat commands work now, but looking at my code, it seems it should work for me but it isn't.

And for the block placing, args has to be declared as string for the "!placeblock" part but for the x and the y values it has to be declared as int. This doesn't really make sense to me.

EDIT: Oops, never mind about the block placing thing, I forgot about the simple int.Parse

EDIT 2: I just made a !placeblock command, and have realised that none of the chat commands that I am creating are working, however they both look perfectly fine.

Go ahead and PM me your code and I'll see if there are any problems (don't forget to snip the password and email).


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#47 Before February 2015

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

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

I'm currently running .NET Framework 4.0, and I have tried multiple times to download .NET Framework 4.5 so I can use this SDK. Any ideas? I've tried completely redoing the Framework too.


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

#48 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Squad wrote:

I'm currently running .NET Framework 4.0, and I have tried multiple times to download .NET Framework 4.5 so I can use this SDK. Any ideas? I've tried completely redoing the Framework too.

Hm... it should be using 4.0 already.

https://github.com/Seist/Skylight/blob/ … csproj#L12

I would recommend reinstalling the SDK.

I don't know when the last time the puush download link was updated. You could have downloaded it before I downgraded from 4.5 to 4.0, which would create a problem.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#49 Before February 2015

Happychubbybubby
Guest

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

So I'm beginning to understand.

I'm making a forms application
If I'm getting my bot to connect, I do:

        private void ConnectButton_Click(object sender, EventArgs e)         {             Room MyRoom = new Room(WorldIdBox.Text);             Bot MyBot = new Bot(MyRoom, EmailBox.Text, PasswordBox.Text);             MyBot.LogIn();             MyBot.Join();

When I look on EE, the bot has joined just fine. Next I have:

MyBot.Push.Say("Joined successfully!");

But it sends me an error message saying:
"Object reference not set to an instance of the object."

Help?

#50 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: [API] [Beta] Skylight: Make bots with ease (Redux Nov 2015)

Happychubbybubby wrote:

So I'm beginning to understand.

I'm making a forms application
If I'm getting my bot to connect, I do:

        private void ConnectButton_Click(object sender, EventArgs e)         {             Room MyRoom = new Room(WorldIdBox.Text);             Bot MyBot = new Bot(MyRoom, EmailBox.Text, PasswordBox.Text);             MyBot.LogIn();             MyBot.Join();

When I look on EE, the bot has joined just fine. Next I have:

MyBot.Push.Say("Joined successfully!");

But it sends me an error message saying:
"Object reference not set to an instance of the object."

Help?

How up-to-date is the SDK? I fixed the problem you seem to be getting on June 24th.

If updating does not fix the problem, I will need to see the entire code because I can't recreate the error.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

Tako1448089601560510

Board footer

Powered by FluxBB

[ Started around 1732232694.9545 - Generated in 1.825 seconds, 12 queries executed - Memory usage: 1.83 MiB (Peak: 2.11 MiB) ]