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.
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
Could do something like TextParser in SkyLight.
Then can people do what they want. With the 80 length limit.
Offline
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
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); }
thx for sig bobithan
Offline
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
I have another question, how do I check for player collisions with a block?
thx for sig bobithan
Offline
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
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.
thx for sig bobithan
Offline
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
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
I just had to.
Offline
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
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
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
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
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
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
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
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.
Thank you eleizibeth ^
I stack my signatures rather than delete them so I don't lose them
Offline
Am I missing something really basic?
I may or may not have slept for a couple of daysThe 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
Squad wrote:Am I missing something really basic?
I may or may not have slept for a couple of daysThe 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:
Thank you eleizibeth ^
I stack my signatures rather than delete them so I don't lose them
Offline
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
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)
Thank you eleizibeth ^
I stack my signatures rather than delete them so I don't lose them
Offline
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
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
[ Started around 1731274461.1324 - Generated in 1.556 seconds, 15 queries executed - Memory usage: 1.81 MiB (Peak: 2.1 MiB) ]