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 2016-08-31 11:40:28

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

[Help] Bot detecting players who joins.

My bot is detecting players who joins the world after it joins... not the players who already joined...
I already used con.Send("init2");
Help D: It was working before, I dont know what went wrong!


cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

Wooted by:

#2 2016-08-31 11:58:56

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: [Help] Bot detecting players who joins.

BananaMilkShake wrote:

My bot is detecting players who joins the world after it joins... not the players who already joined...
I already used con.Send("init2");
Help D: It was working before, I dont know what went wrong!

Only use con.Send("init2") before the end of init.
If you use a switch it must be before break; or return; and if not it must be before the }.


http://i.imgur.com/bjvgH5L.png?1

Offline

#3 2016-08-31 12:04:37

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

Re: [Help] Bot detecting players who joins.

marcoantonimsantos wrote:

Only use con.Send("init2") before the end of init.

case "init":
					{
						blah blah blah some random codes
						con.Send("init2");
					}
					break;

//forums.everybodyedits.com/img/smilies/sad


cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

#4 2016-08-31 12:07:20

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: [Help] Bot detecting players who joins.

Can you show us a little bit more code?
For example post it on pastebin or github.
We can't really help you without making random guesses right now.

Offline

#5 2016-08-31 12:09:42

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

Re: [Help] Bot detecting players who joins.

Full noob code

cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

#6 2016-08-31 14:14:42

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: [Help] Bot detecting players who joins.

Why do you start it with { and finish with }??? I don't see any IF statement so I am in doubt if your code even runs


http://i.imgur.com/bjvgH5L.png?1

Offline

#7 2016-08-31 15:06:01

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

Re: [Help] Bot detecting players who joins.

marcoantonimsantos wrote:

Why do you start it with { and finish with }??? I don't see any IF statement so I am in doubt if your code even runs

I used to think that, but apparently the lack of braces is just an earmark of an old Visual Studio; apparently the braces are nice to help with variable naming and stuff... organization idk

Offline

#8 2016-08-31 15:21:43

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

Re: [Help] Bot detecting players who joins.

@Milkshake:
You should really send "init2" at the start of "init", so that your bot initialises everything more quickly after it connects. It also might be the problem here.

Putting { } to surround code is perfectly fine, and brings no compiler errors as long as the braces match up.


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

Offline

#9 2016-08-31 22:11:35

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

Re: [Help] Bot detecting players who joins.

Tomahawk wrote:

@Milkshake:
You should really send "init2" at the start of "init", so that your bot initialises everything more quickly after it connects. It also might be the problem here.

Still didn't work :/
I think the problem is in the init code.
Still have to re-join for the bot to check and add.


cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

#10 2016-08-31 22:21:52

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: [Help] Bot detecting players who joins.

What if you just start commenting out stuff?
Start with the bot-specific stuff (like the non-owner stuff), and gradually work your way down until you even comment the deserialization stuff.
If it still doesn't work when you have just "con.send("init2")", then we have one of those "special cookie" bots/pcs that'll be a hell to uncover why stuff isn't working.

Reason why it's usually best to start commenting part by part instead of going straight to just the init2 send stuff, is because with this method you will very easily know where the problem is.

Tomahawk wrote:

You should really send "init2" at the start of "init", so that your bot initializes everything more quickly after it connects.

Don't see how that would make your initialization faster... You might cut down a bit of idle time, but the initialization will always go just as long.

Offline

#11 2016-08-31 23:51:00

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

Re: [Help] Bot detecting players who joins.

well it lets the server know you're on the right page, which is faster than waiting to tell the server until you're actually done

Offline

#12 2016-08-31 23:51:28

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

Re: [Help] Bot detecting players who joins.

den3107 wrote:

Don't see how that would make your initialization faster

The server sends the "add" messages and some other stuff as soon as "init2" is sent, so the sooner it's sent, the faster they're processed.

It's only a little bit faster.


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

Offline

#13 2016-09-01 07:22:21

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

Re: [Help] Bot detecting players who joins.

Turns out the block loading is slow and the world that im currently using as bot testing has many backgrounds and some random code. But it works now, thanks!
Thread Close? please.


cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

#14 2016-09-01 12:30:19

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: [Help] Bot detecting players who joins.

You can close it yourself by clicking Lock at the bottom of the page //forums.everybodyedits.com/img/smilies/wink


http://i.imgur.com/bjvgH5L.png?1

Offline

#15 2016-09-01 14:36:29

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

Re: [Help] Bot detecting players who joins.

BananaMilkShake wrote:

Turns out the block loading is slow and the world that im currently using as bot testing has many backgrounds and some random code. But it works now, thanks!
Thread Close? please.

Use InitParse https://gist.github.com/Yonom/3c9ebfe69b1432452f9b

Literally takes 3 seconds to load 300x300 world (and draw minimap)


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

#16 2016-09-01 22:14:40, last edited by Vinyl Melody (2016-09-02 06:06:12)

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

Re: [Help] Bot detecting players who joins.

How to use InitParse? It always gives me an error when using it.
Edit: Nevermind, I fixed it. Thanks for the help!


cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

Vinyl Melody1472764480621749

Board footer

Powered by FluxBB

[ Started around 1732485619.7129 - Generated in 0.145 seconds, 12 queries executed - Memory usage: 1.64 MiB (Peak: 1.87 MiB) ]