Chat message counter

Unofficial support for the creating and editing of metas.
Xtalibur
Posts: 16

Chat message counter

Post #1 »

Is there a way to count the number of times a chat message comes in, and then pass to another state when that chat message is received a certain number of times? I wanted to do it without resetting or switching states though, which is the problem I'm running into. I was thinking something along the lines of setting a Check variable and adding +1 to it whenever someone in the fellowship says "Check", and then when [Check]>=5(assuming there are 5 guys in the fellow), it could pass to the next state, and set the Check variable back to 0.

Dmdtt
Moderator
Posts: 271

Post #2 »

without some type of organization, no this is not possible. if the characters who were sending the message had certain values assigned to them so that you could differentiate which is which or delay each sending of !check so that vtank can listen and act on each message then this would be possible. or if the characters in the fellowship were always the same people so you could react based on who is sending the message then this would be possible.

with a random fellow however and no organization across each character you cannot react off a number of messages which are being sent at the exact same time.

are the characters the same characters each time or does the fellow change? also do you control all of the characters?

Xtalibur
Posts: 16

Post #3 »

Yeah the characters are all the same and I control them, so I guess I could just do something else. So is the next best option to add a chat rule for each character saying !check, as well as a you say !check rule, and then adding +1 to the Check variable each time one of those is received?

Dmdtt
Moderator
Posts: 271

Post #4 »

what I normally do is something like this,

Leader says, !checkOne

CharacterOne says, !check

Leader reacts off

Chat Message: ^.*(CharacterOne).* (say|says|tells you), \"!check\"$

and sends message !checkTwo, CharacterTwo is only one who reacts to !checkTwo and when leader sees the response from characterTwo with

Chat Message: ^.*(CharacterTwo).* (say|says|tells you), \"!check\"$

he then sends a message to characterThree etc

in order to cover instances where one char may not be ready to send a response this cycles every 30s and as the follwers are sending the !check response they are resetting the state.

Dmdtt
Moderator
Posts: 271

Post #5 »

also if you want to make it more efficient and use variables you can react off the variable being a certain number to send the check message and at each message received by a person setvar[]

Xtalibur
Posts: 16

Post #6 »

Oh ok cool that works. Thanks. :D