ID:164076
 
Code:
mob
var
spam=0
secondspam=0
verb
say(Text as text) // a chatting verb
set category = "Commands" // a new tab called Social
set desc = "View Say" // aha! Moving the pointer over the verb will display this user guide.
if(src.muted==0)
if(src.talkdelay==0)
if(length(Text) < 500)
view() << "<b><font color=navy>[src] says: [scantext(Text)]"
spam+=1
secondspam+=1
src.talkdelay=1
sleep(10)
src.talkdelay=0
return
else
src << "Sorry, the message [Text] is too long."
else
src<<"You can't talk too fast!"
else
src<<"You can't do that!"


That is my current say code. I was starting to create a spam guard that would automute you for five minutes if you spoke more than 5 times in 10 sec. I was also going to create a secondary guard that would keep you from posting twice within a second, that would also mute you for 5 minutes. I started with creating the two variables, yet realized, I haven't the slightest clue how to do this. Could anyone please give me some pointers on how I could do this?

Thanks.
mob
var
spam=0
secondspam=0
verb
say(Text as text) // a chatting verb
set category = "Commands" // a new tab called Social
set desc = "View Say" // aha! Moving the pointer over the verb will display this user guide.
src.Spamcheck() // Sets up a proc to show if the persons spamming or not
if(!src.muted)
if(!src.talkdelay)
if(length(Text) < 500)
view() << "<b><font color=navy>[src] says: [scantext(Text)]"
src.spam+=1
src.secondspam+=1
src.talkdelay=1
sleep(10)
src.talkdelay=0
sleep(50) // To take down the spam length every 5 seconds
src.spam-=1
src.secondspam-=1
return
else
src << "Sorry, the message [Text] is too long."
else
src<<"You can't talk too fast!"
else
src<<"You can't do that!"

mob
proc
Spamcheck()
if(src.spam >=10) //Checks if someones sent 10 messages in the last whatever
src.mute = 1
src << "YOU R SPMING NAUGHTY NUHTY!!" //Over the top nooby spam message to tell them that they are
sleep(1000) //100 seconds before being unmuted
src.mute = 0
src << "You have been unmuted, I hope youve learnt your lesson"


Basicaly, Something like that? Dont know if it will work with what your using as there are some procs that I would obviously not have defined in my code, Hope it helps - If you have any problems, Just post and i'll try help.
Be careful about how strict you get. I can easily send two messages within a second, and I would likely do so several times during one session of a game. It would get extremely annoying to be continually muted for 5 minutes.

Think about a normal conversation you might be having. Someone asks a question while you're finishing typing up a statement, you hit enter, then you want to answer and quickly type up "no" and hit enter again in a quarter of a second. You're muted for 5 minutes. Let's say you decide to wait it out instead of logging off in disgust, so 5 minutes later you're better again. You start to type "That is so annoying; the automation is just a bit too tight." When you're almost done typing that, someone has sent a message just before you finish typing yours: "Isn't that annoying when it does that?" After you hit enter, you type "yes" and hit enter again... oops, you're muted for 5 more minutes.

And I would likely trigger it several more times on accident before I left if I bothered to stay after that. I don't think there should be a limit on the length between any two messages. If it is repeated with consistency, then that's a problem, but just two messages in 1 second happens all the time in normal conversation.

Heck, on some things with maximum message lengths I occasionally have to break a message down into 3 parts, so I might even send a few max-length messages in a second. Things like that should probably be left up to the discretion of moderators that are currently online. Automation should only serve to stop people that are obviously flooding text without any doubt.