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-12-05 03:39:43

AK712
Member
Joined: 2015-02-16
Posts: 94

m.Type == "k" Always True???

So I have a bot that does something when you collect a crown. Unfortunately, no matter what, when the bot enters, everything under m.Type == "k" triggers, even though no crown exists in the room or on anyone. I'm extremely confused; what do I do?


O4DmNuI.png

Offline

#2 2015-12-05 10:07:36

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

Re: m.Type == "k" Always True???

You need to read userid. Should be like -1 which mean none have the crown.

Offline

Wooted by:

#3 2015-12-05 17:34:13

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

Re: m.Type == "k" Always True???

^I think he's saying that "init" and "add" and "b" etc. are showing up as crowns
sounds like you oopsied in your code. too bad you didn't send code.

huh.

Offline

#4 2015-12-06 04:39:36, last edited by Tako (2015-12-06 04:40:22)

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

Re: m.Type == "k" Always True???

hummerz5 wrote:

^I think he's saying that "init" and "add" and "b" etc. are showing up as crowns

No, because he said this:

AK712 wrote:

everything under m.Type == "k" triggers

Capasha's probably right. Just preface it with:

if (m.GetInt(0) == -1)
    return;

That'll just stop the function if it's a "nobody has the crown" message.


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

Offline

#5 2015-12-06 16:04:06

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

Re: m.Type == "k" Always True???

Well, I figured he screwed up his code so bad that he had "everything" "under" that line.
But I could see how the -1 ID makes more sense.

Offline

#6 2015-12-06 16:45:15

Processor
Member
Joined: 2015-02-15
Posts: 2,246

Re: m.Type == "k" Always True???

WRONG! You should ignore the first "k" you get. "k" on join is not always going to be -1, it could even be an invalid ID of a user that has left the room before you!


I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.

Offline

#7 2015-12-06 18:45:20

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

Re: m.Type == "k" Always True???

^methinks "ignore" is a strong word

Offline

#8 2015-12-06 19:57:36

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

Re: m.Type == "k" Always True???

Processor wrote:

WRONG! You should ignore the first "k" you get. "k" on join is not always going to be -1, it could even be an invalid ID of a user that has left the room before you!

Shouldn't you still need to know who has the crown originally? (I'm sure there are some uses for it)
I mean, you can always ignore it if the given ID isn't one that's currently applyable.

Offline

#9 2015-12-06 20:33:14

Processor
Member
Joined: 2015-02-15
Posts: 2,246

Re: m.Type == "k" Always True???

No, OP says:

AK712 wrote:

So I have a bot that does something when you collect a crown.

The crown is not collected when your receive your first "k".


I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.

Offline

#10 2015-12-06 20:59:38

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

Re: m.Type == "k" Always True???

your argument makes sense, if he's got code for doing magical "wow you won" crap, but he joins late, so the "wow you won" is totally out of sequence.
yap

Offline

hummerz51449431978564375

Board footer

Powered by FluxBB

[ Started around 1734010269.7435 - Generated in 0.071 seconds, 10 queries executed - Memory usage: 1.46 MiB (Peak: 1.6 MiB) ]