ID:163821
 
Well I just made a basic Spam guard but, I don't know how to add on to it were the server auto mutes the spamer and also I can disable HTML and javascrpit

here is my code...

var
spam_limit = 15
spam_time = 20 // This makes sure you can't spam

mob/verb/OOC(text as text)
set category = "Communications"
// text = Cheatcode(src, text)
if(!text) return
if(spoken >= spam_limit)
usr << "<b><Font Color = Red>No Spamming</font>"
return 0
world << "<B>[usr] OOC</B>: [text]"
usr.spoken += 1

mob
var/spoken = 0
proc/Spoken(mob/M,N as num)
if(M.spoken >= spam_limit)
usr << "<b><Font Color = Red>SHUT UP</font>"

proc/Spam_Less()
spoken = max(0,spoken-1)
spawn(spam_time) Spam_Less()
mob
New()
..()
spawn(spam_time) Spam_Less()


mob/Stat()
statpanel("Spam")
stat("Current_Spam",usr.spoken)


Thank you for the help if you help me
1) You are not calling spawm time (how else can you count down the spam count)?
2) For future use, using __++ and ++__ is a faster way of doign +=1:
var/X=4  // __++ returns __ value first then adds 1, eg:
world<<X++ // world<<4
world<<X // world<<5

var/X=4  // ++__ returns the value (__ + 1) together, eg:
world<<X++ // world<<5
world<<X // world<<5


3) For stripping out HTML/JavaScript/Angle brackets(< >), use the handy proc: html_encode()