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.

#76 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:

TakoMan02: Did you read my earlier post?

Why do some commands work, while others don't? Is it something to do with the SDK, my coding, or a plain C# glitch?

Please help.

The max character limit for messages is 80. Try shortening the messages and try again.
[Edit] The most recent update allows for messages over 80 characters.

And yes, it is case-sensitive.


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

Offline

#77 Before February 2015

capasha
Member
Joined: 2015-02-21
Posts: 4,066

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

Could do something like TextParser in SkyLight.
Then can people do what they want. With the 80 length limit.

Offline

#78 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)

doh wrote:

Could do something like TextParser in SkyLight.
Then can people do what they want. With the 80 length limit.

I added something a bit simpler (but it has the same effect):

                 if (s.Length <= 80 && s.Length > 0) {     this.C.Send("say", s);     Thread.Sleep(this.Bot.SpeechDelay); } else {     // Say what you can.      this.Say(s.Substring(0, 80));      // Delete what you just said.     s = s.Substring(80);      // Repeat the process.     this.Say(s); }


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

Offline

#79 Before February 2015

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

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

Is there a better, more compact way to write something like this:

public static void Explode(int x, int y)         {             Block fire = new Block(BlockIds.Blocks.Metal.GOLD, x, y);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x + 1, y);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x - 1, y);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x, y + 1);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x, y - 1);             MyBot.Push.Build(fire);         }


m3gPDRb.png

thx for sig bobithan

Offline

#80 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:

Is there a better, more compact way to write something like this:

public static void Explode(int x, int y)         {             Block fire = new Block(BlockIds.Blocks.Metal.GOLD, x, y);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x + 1, y);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x - 1, y);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x, y + 1);             MyBot.Push.Build(fire);             fire = new Block(BlockIds.Blocks.Metal.GOLD, x, y - 1);             MyBot.Push.Build(fire);         }

It's been a while since I've worked with C# (shame on me) so the syntax may be skewed, but here you go:

This takes advantage of two things: the Out.Build(List<Block>) function, and the ability to declare a list with elements.

public static void Explode(int x, int y) {     int goldId = BlockIds.Blocks.Metal.GOLD;     List<Block> fireBlocks = new List<Block>() {         new Block(goldId, x, y),         new Block(goldId, x + 1, y),         new Block(goldId, x - 1, y),         new Block(goldId, x , y + 1),         new Block(goldId, x, y - 1)};     MyBot.Push.Build(fireBlocks);  }

That saved you two lines and a bunch of characters.


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

Offline

#81 Before February 2015

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

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

I have another question, how do I check for player collisions with a block?


m3gPDRb.png

thx for sig bobithan

Offline

#82 Before February 2015

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

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

That's pretty hard to do...

I guess you could check whether the player taps a key next to the block. But, other than coding a movement engine that predicts a player's position from the last "m" packet received, it's not that possible.


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

Offline

#83 Before February 2015

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

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

Also, whenever I try to make a command only work for the owner, it never works. I've tried different ways of doing it - checking the name, checking if the player is the owner, but it never works for me.


m3gPDRb.png

thx for sig bobithan

Offline

#84 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:

Also, whenever I try to make a command only work for the owner, it never works. I've tried different ways of doing it - checking the name, checking if the player is the owner, but it never works for me.

I'll look into that.
And Tomahawk is correct about the collision detection - the only way that would be possible is if someone emulated the entire physics engine.   I don't have the time or patience to do that.
[Edit] Works just as I expected.   Message me/post your code and I'll see what's wrong.
[Edit] Okay, if you match the player objects, it won't work. Use the Player.Name property. For example,

if (chatArgs.Speaker.Name == myRoom.Owner.Name) { }

instead of

 if (chatArgs.Speaker == myRoom.Owner) { } 


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

Offline

#85 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)

Thanks to gustav, Skylight now has accurate player coordinates!

This is a big deal.   This opens the door to so many great things that were previously impossible.   For example, you can make two players explode upon touching each other.   If that doesn't sound like the coolest thing then get out of my face.


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

Offline

#86 Before February 2015

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

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

4d5eb6b3cb.jpg

9x2HE.png
I just had to.


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

Offline

#87 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)

thank u for ur contribution

Skylight is constantly being improved, by the way.   If you haven't downloaded in a while, I would recommend you update.


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

Offline

#88 Before February 2015

Hexagon
Member
Joined: 2015-04-22
Posts: 1,213

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

Hey Tako, I think this library is definitely useful. I made a few changes to how authentication works so it might break the example in the forum post. Hope that my change didn't mess up anything though (Decagon).

Offline

#89 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)

Hexagon wrote:

Hey Tako, I think this library is definitely useful. I made a few changes to how authentication works so it might break the example in the forum post. Hope that my change didn't mess up anything though (Decagon).

I like most of the changes you made, but one thing I don't understand is the removal of the ability to have multiple bots.

I will have to manually add a lot of these changes because Git is not cooperating with me today.


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

Offline

#90 Before February 2015

Hexagon
Member
Joined: 2015-04-22
Posts: 1,213

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

Oops, completely missed that! (I didn't want to remove that functionality; hope it doesn't interfere with anything). What I might have been thinking was to make the user instantiate a new Bot() for every room that they would like to join (I hope that was implemented correctly).

Offline

#91 Before February 2015

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

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

Have you implemented precise x and y into skylight? If so how to use? c:


If you would like me to make a bot for you, go here.

Offline

#92 Before February 2015

Hexagon
Member
Joined: 2015-04-22
Posts: 1,213

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

Jabatheblob1 wrote:

Have you implemented precise x and y into skylight? If so how to use? c:

I realize that this question isn't directed at me but there is precise x and y (up to the maximum precision by the server, which is to the 8th decimal place). Depending on your uses, you may want to look into the tick event in the PlayerEventArgs class. However, I've made a few changes (which are pending on the GitHub repo) which shouldn't change this functionality but I'll have to confirm that.

Offline

#93 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)

Jabatheblob1 wrote:

Have you implemented precise x and y into skylight? If so how to use? c:

I've already explained the answer to Jaba but I want to answer it in public in case anyone else had a similar question.

Any time you access the variables Player.X, Player.Y, Player.BlockX, Player.BlockY, they will be precise.

If you want to respond once they enter a certain area, you must subscribe to the In.TickEvent as I did in the example in the OP.

Por ejemplo:

// ... MyRoom.Pull.TickEvent += RegionChecker; MyBot.LogIn(); MyBot.Join(); // ...   // ... public static void RegionChecker(PlayerEventArgs e) {     int x = e.Subject.BlockX,          y = e.Subject.BlockY,         lowerBoundary = 100,         upperBoundary = 110,         leftBoundary = 20,         rightBoundary = 30;      bool isInside = x > leftBoundary && x < rightBoundary && y > upperBoundary && y < lowerBoundary;      if (isInside)     {         // ...     } } // ...


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

Offline

#94 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)

Am I missing something really basic?
I may or may not have slept for a couple of days

The code:
jG8dksq.png

The error:
j50ZoiW.png

From what I've heard it's something to do with calling a static or something.


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

#95 Before February 2015

ugotpwned
Member
Joined: 2015-02-16
Posts: 376

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

Squad wrote:

Am I missing something really basic?
I may or may not have slept for a couple of days

The code:

The error:

From what I've heard it's something to do with calling a static or something.

Yes, there's no good reason your variables should be static anyways. Remove the static modifier from your room and bot and initialize them on Load or someplace.

Offline

#96 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)

UgotPwned wrote:
Squad wrote:

Am I missing something really basic?
I may or may not have slept for a couple of days

The code:

The error:

From what I've heard it's something to do with calling a static or something.

Yes, there's no good reason your variables should be static anyways. Remove the static modifier from your room and bot and initialize them on Load or someplace.

static Room MyRoom = new Room("PWdHXz1GtRb0I");         static Bot MyBot = new Bot(MyRoom, "<a class="__cf_email__" href="/cdn-cgi/l/email-protection" data-cfemail="f08381859194de9193939f859e84b09c998695de939f9d">[email  protected]</a><script cf-hash='f9e31' type="text/javascript"> /* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>", "Cats4Lyfe");         public Form1()         {             InitializeComponent();         }          private void Form1_Load(object sender, EventArgs e)         {             MyBot.Join();         }

to

public Form1()         {             InitializeComponent();         }          private void Form1_Load(object sender, EventArgs e)         {             Room MyRoom = new Room("PWdHXz1GtRb0I");             Bot MyBot = new Bot(MyRoom, "<a class="__cf_email__" href="/cdn-cgi/l/email-protection" data-cfemail="d3a0a2a6b2b7fdb2b0b0bca6bda793bfbaa5b6fdb0bcbe">[email  protected]</a><script cf-hash='f9e31' type="text/javascript"> /* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>", "Cats4Lyfe");             MyBot.Join();         }

• Makes no sense as how do I use MyRoom or MyBot elsewhere
• Error:
xYDqLL4.png


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

#97 Before February 2015

ugotpwned
Member
Joined: 2015-02-16
Posts: 376

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

Close but not quite, what I meant was...

        private Room MyRoom;         private Bot MyBot;         public Form1()         {             InitializeComponent();         }          private void Form1_Load(object sender, EventArgs e)         {             MyRoom = new Room("PWdHXz1GtRb0I");             MyBot = new Bot(MyRoom, "<a class="__cf_email__" href="/cdn-cgi/l/email-protection" data-cfemail="2f5c5e5a4e4b014e4c4c405a415b6f4346594a014c4042">[email  protected]</a><script cf-hash='f9e31' type="text/javascript"> /* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>", "Cats4Lyfe");             MyBot.Join();         }

Last edited by UgotPwned (Jul 29 2014 8:46:45 pm)

Offline

#98 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)

UgotPwned wrote:

Close but not quite, what I meant was...

        private Room MyRoom;         private Bot MyBot;         public Form1()         {             InitializeComponent();         }          private void Form1_Load(object sender, EventArgs e)         {             MyRoom = new Room("PWdHXz1GtRb0I");             MyBot = new Bot(MyRoom, "<a class="__cf_email__" href="/cdn-cgi/l/email-protection" data-cfemail="0f7c7e7a6e6b216e6c6c607a617b4f6366796a216c6062">[email  protected]</a><script cf-hash='f9e31' type="text/javascript"> /* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */</script>", "Cats4Lyfe");             MyBot.Join();         }

That makes way more sense, sorry for the mushy brain.

Edit: the error persists.

FileLoadException was unhandled  An unhandled exception of type 'System.IO.FileLoadException' occurred in MultiworldTest.exe  Additional information: Could not load file or assembly 'PlayerIOClient, Version=2.3.6.0, Culture=neutral, PublicKeyToken=e73906cd2bb451f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Last edited by Metatron (Jul 29 2014 8:48:52 pm)


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

#99 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)

This was an accidental bug that was fixed within a few hours of its creation. I guess you cloned it during the short period of time it was there.

There error was caused by some typo in the .csproj file. It couldn't locate PlayerIOClient, and stopped the program before it even started.

Static has nothing to do with it. Although, it shouldn't matter. As long as you stay within Form1.cs, that is.

Update your version of Skylight and it should be fixed.


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

Offline

#100 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)

Also I don't know who stickied this topic. I just wanted to say it wasn't me, because that would be kind of arrogant.


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

Offline

Tako1448089601560510

Board footer

Powered by FluxBB

[ Started around 1732482943.2635 - Generated in 0.795 seconds, 13 queries executed - Memory usage: 1.81 MiB (Peak: 2.1 MiB) ]