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 2015-04-26 18:26:03

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

[Question] "k" event returning odd user ID

When the bot joins the room as first and it requests the crown in the "init" event, the "k" returns a userID of -1 (instead f 1, since it joins first) (bot does receive the crown).

When the bot has the crown, leaves the room and joins the room again (somebody has to stay in the room to keep it loaded) and nobody grabbed the crown in the meantime and the bot gives himself the crown again through the "init" event, the userID of the 'previous' bot is given.

When the crown was given over to a player, by moving over the crown block, and the bot joins, the "k" event returns the correct userID (of the bot).

Offline

Wooted by: (2)

#2 2015-04-26 18:28:28

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

Re: [Question] "k" event returning odd user ID

Read over it again (to check readability) and I came with a reason why it works this way.

The "init" event triggers the "k" event of the previous crown wielder or -1 if there has been no crown wielder yet.

Since the bot joins first, "k" return -1 because there has been no wielder.
After rejoining without the crown haven given away in the meantime the "k" event returns the userID of the previous bot...

Offline

Wooted by: (2)

#3 2015-04-27 12:19:22, last edited by DarkDragon4900 (2015-04-27 12:19:40)

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: [Question] "k" event returning odd user ID

-1 == Noone has the crown/Crown removed.

Offline

Wooted by: (3)
DarkDragon49001430133562499274

Board footer

Powered by FluxBB

[ Started around 1714341305.4884 - Generated in 0.036 seconds, 12 queries executed - Memory usage: 1.36 MiB (Peak: 1.45 MiB) ]