ID:273272
 
How do i set the Variables in a list? Like this

mob/verb/OOC(OOC as text)
if(usr.FloodDelay==5)
usr<<"You have Spammed so Muted"
return
world<<"[usr]: [OOC]"
usr.FloodDelay+=1
sleep(100)
usr.FloodDelay=0


Set That Variable "FloodDelay" in a list
2 things, first, why do you want to set that var on a list? And second, you know your code will be buged right? Once you speak, after 10 secs, it will auto reset the flood control to 0, meaning that with the correct timing you can spam up to 9(if Im not mistaken) in a second without getting muted
In response to Abrax
Yea i know it is bugged Sorry. I want Add that Variable to the List Because I have Alot of Variables on Vars.dm and i get losed xD.

Oh, here is the Code.

mob/verb/OOC(OOC as text)
set name = "OOC"
if(length(OOC)>100)
usr<<"<font face = tahoma>Message is too Long"
return

if(findtext("",OOC))
usr<<"<font face = tahoma>Do you want Bug OOC? Try it on your own Game"
return

if(usr.FloodDelay==5)
usr<<"<font face = tahoma>Please Wait While Sending another Message"
return
world<<"[usr]: [OOC]"
usr.FloodDelay+=1
sleep(300)
usr.FloodDelay=0

In response to Gohan Games
Gohan Games wrote:
Yea i know it is bugged Sorry. I want Add that Variable to the List Because I have Alot of Variables on Vars.dm and i get losed xD.

Oh, here is the Code.

> mob/verb/OOC(OOC as text)
> set name = "OOC"
> if(length(OOC)>100)
> usr<<"<font face = tahoma>Message is too Long"
> return
>
> if(findtext("",OOC))
> usr<<"<font face = tahoma>Do you want Bug OOC? Try it on your own Game"
> return
>
> if(usr.FloodDelay==5)
> usr<<"<font face = tahoma>Please Wait While Sending another Message"
> return
> world<<"[usr]: [OOC]"
> usr.FloodDelay+=1
> sleep(300)
> usr.FloodDelay=0
>


Write all the vars on the same place(near each other, etc)
And a small fix on your verb

> mob/verb/OOC(OOC as text)
> if(length(OOC)>100)
> src<<"<font face = tahoma>Message is too Long"
> return
>
> if(!OOC) return //the purpose of this is to avoid unecessary message, so why would you send a message back to him?
>
> if(src.FloodDelay==5)
> usr<<"<font face = tahoma>Please Wait While Sending another Message"
> return
> world<<"[src]: [OOC]"
> src.FloodDelay+=1
> sleep(300)
> src.FloodDelay-=0 // -=, not just =
>
In response to Abrax
What about something like this?

mob
var
spamCounter = 0
verb/OOC(OOC as text)
// text validation checks go here...
// If we make it here, message is valid.
if (spamCounter < 3)
spamCounter++
world << "[usr]: [OOC]"
spawn(300)
spamCounter--
else
usr << "Please wait before sending another message."


Gohan Games wrote:
How do i set the Variables in a list? Like this

> mob/verb/OOC(OOC as text)
> if(usr.FloodDelay==5)
> usr<<"You have Spammed so Muted"
> return
> world<<"[usr]: [OOC]"
> usr.FloodDelay+=1
> sleep(100)
> usr.FloodDelay=0
>

Set That Variable "FloodDelay" in a list

if your are just wanting a spam avoider prefer using world.time and do simple math !