ID:157779
 
Hey guys how are you im wondering how do i add a scrip into my game someone eles made like i found a spam scrip that i can find helpfull but i dont no how to get it to work in my game heres the spam scrip


proc/SGS_Filter_txt(txt)
var/stars
var/s_amount
var/mem
var/find_t
var/txtLen
var/Words[]
Words = new /list/
Words = st......................................................")// Add more if you want i left soem extra spaces and u can add your own
if(Words.len)
memo:
for(mem = 1,mem < Words.len + 1,mem++)
find_t = findtext(txt,Words[mem])
if(find_t)
txtLen = length(Words[mem])
stars = null
s_amount = null
for(s_amount = 0,s_amount < txtLen,s_amount++)
stars += "+"
txt = copytext(txt,1,find_t) + stars + copytext(txt,find_t+txtLen,0)
if(findtext(txt,Words[mem])) goto memo
return txt
mob/var/tmp/SGS_kick_for_repeat
mob/var/tmp/SGS_remember_txt
mob/var/tmp/SGS_locked = 0
var/list/SGS_Spam_log_file
proc/SGS_AntiSpam(txt)
var/spam = list("")
for(var/m in spam)
if(SGS_allow_beep == 0)
if(findtext(txt,m))
return ""
else if(SGS_allowhtml == 0) return SGS_AntiSpam2(copytext(html_encode(txt),1,SGS_Brake_txt))
else if(SGS_allowhtml == 1) return SGS_AntiSpam2(copytext(html_encode(txt),1,SGS_Brake_txt))
proc/SGS_AntiSpam2(txt)
if(usr.SGS_locked == 0)
if(usr.SGS_remember_txt == txt)
usr.SGS_kick_for_repeat ++
else
usr.SGS_remember_txt = txt
usr.SGS_kick_for_repeat = null
usr.SGS_kick_for_repeat ++
if(usr.SGS_kick_for_repeat == SGS_spam_num)
usr.SGS_locked = 1
usr.SGS_kick_for_repeat = null
usr.SGS_remember_txt = null
spawn(SGS_Bantime) usr.SGS_locked = 0
return txt
SGS_reset()
proc/SGS_reset()
spawn(SGS_Waittime) usr.SGS_kick_for_repeat = null
proc/Safe_Guard(txt)
return SGS_Filter_txt(SGS_AntiSpam(txt))
var/SGS_Brake_txt = 200
var/SGS_spam_num = 0
var/SGS_allow_beep = 0
var/SGS_Safe_Log_txt = 0
var/SGS_allowhtml = 0
var/SGS_CrashGuard = 0
var/SGS_Waittime = 0
var/SGS_Bantime = 0
mob/var/SGS_Stop_all_txt = 0
var/tmp/def = 30
var/tmp/lagset = 0
var/tmp/clag = 0
var/tmp/tick_mem = world.tick_lag
world
proc
Lag_Guard()
set background = 1
spawn while(1)
if(lagset == 0)
if(world.cpu >= def)
world.tick_lag++
world.tick_lag = round(world.tick_lag)
if(world.cpu < def)
if(world.tick_lag == tick_mem)
..()
else
world.tick_lag--
world.tick_lag = round(world.tick_lag)
else
if(world.cpu >= clag)
world.tick_lag++
world.tick_lag = round(world.tick_lag)
if(world.cpu < clag)
if(world.tick_lag == tick_mem)
..()
else
world.tick_lag--
world.tick_lag = round(world.tick_lag)
sleep(75) //Checks every 7.5 seconds

world
New()
..()
Lag_Guard()
------------------------------------------------------------

heres the ooc scrip where do i add the command for it to read the spam scrip

mob/var/say_delay = 0
mob/var/muted = 0
mob/var/mute_time = 0
mob/var/spammed = 0
var/World_Mute=0
var/Channel_Mute = 0



mob/verb/OOC(T as text)
set category = "Channels"

if(src.muted)
src << "You have been muted!"
return

if(World_Mute && !src.GMLevel)
src << "The world is Muted!"
return



if(!T)
spawn() alert("Your message may not be blank.")
return


if(lentext(T) > 150)
spawn() alert("Your message can not exceed 100 characters.")
T = copytext(T,1,150)

else
ChatLog(src,"OOC: [T]")
for(var/client/C)
if(!C)continue
if(!C.mob) continue
if(C.mob.Ignored.Find(usr)) continue
if(!src.in_guild)
if(C.mob.ooc_on)
C << {"{[src.title]}{[src.rank]} [src.name] OOC: [s_smileys(T)]"}//[s_smileys(T)]
src.afk_time = 0
else
if(C.mob.ooc_on)
C << {"{[src.guild_name_html]}{[src.title]}{[src.rank]} [src.name] OOC: [s_smileys(T)]"}
src.afk_time = 0

src.say_delay ++
src.afk_time = 0
spawn(100) src.say_delay = 0
spawn(100) src.muted = 0




mob/PC/verb/Emote(T as text)
set category = "Channels"
var/list/L
L = list("font size")

if(!src.GMLevel)
if(World_Mute == 1)
src << "The world is muted!"
return


if(Channel_Mute && !src.GMLevel)
src << "All Chat Channels are Muted!"
return

if(src.muted)
src << "You have been muted!"
return

if(src.say_delay >= 3)
alert("Flood Supression: You must wait 8 seconds before using Emote again.")
src.spammed ++
src.AUTO_BAN()
src.muted = 1
sleep(300)
src.muted = 0
sleep(1200)
src.spammed = 0
return

for(var/X in L)
if(findtext(T,X))
alert("You may not change your font size.")
return

if(isnull(T) | T == "" | !T)
alert("Your message may not be blank.")
return

if(lentext(T) > 50)
alert("Your message can not exceed 50 characters.")
return

T = html_encode(T)

ChatLog(src,"Emote: [T]")
for(var/client/C)
if(C.mob.ooc_on)
C << src.name] [T]"}
src.say_delay += 1
sleep(80)
src.say_delay = 0
src.muted = 0
A few things:
- 'dike' is an actual legitimate not-a-dirty-word-at-all. Censoring it would prevent, among other things, dutch people talking in your chat. Oh, those crazy Dutch.

- You probably want to censor the actual wordlist for posting on these forums - we've got a reasonably strict no-swearwords policy.

- Close your HTML tags (in the code)

- Enclose your code in <dm> tags - it provides syntax highlighting and pretty formatting, making the code easier on the eyes for everyone to read.

- Don't use goto. There are very few circumstances where it's appropriate.

- You can't just copy and paste bits of code from elsewhere into your game and expect them to work at all.
In response to Jp
o.o sorry but some one made it for all of us to use
In response to Exeagle
http://www.byond.com/members/ DreamMakers?command=view_post&post=34638(read it)