Jump to content

anti swear script


stylo

Recommended Posts

Does anyone have a script that is against swear?

Example:

John:

admin: John Please dont swear

John: admin

Admin: Do NOT swear.

Admin: John muted

?!?!

Yes

If ($3 == swear) {

if $readini(swears.ini,swears,$mta.name($1,$2) == 3) {

!writeini -n swears.ini Swears $mta.name($1,$2) $calc

(Swears.ini,swears,$mta.name($1,$2) + 1)

mta.say $1 $mta.name($1,$2) Dont Swear Please

}

else mta.say $1 You have been warned 3 times Your Out! | .timer 1 2 mta.kick $1 $2

}

Link to comment

Wrong Marty, you have a way too much mistakes for such a little script :P

on *:SIGNAL:mta.text:{
 if (swear isin $3) {
   var %a = $readini($mta.dir $+ $1.ini,n,$2,swears)
   !writeini " $+ $mta.dir $+ $1.ini" $1 $2 swears $iif(%a > 2,3,$calc(%a + 1))
   !inc %a
   mta.text $1 $mta.nick($1,$2) $+ , don't swear! ( $+ $replacex(%a,1,first,2,second,3,last) warning)
   if (%a > 2) mta.kick $1 $2
 }
}

Link to comment
im sure that hash tables would be better at this then files.

No they won't. It would make sense if it was storing stuff for a long time about all the players in the server. Why would you want to create a new hash and controll it here and there, you'll need to write a few more funcs and process a few more events and they will just bring you more bugs, that's just useless here, in the script i posted i write the warnings to the mtama server ini, so after kick i wont even need to remove the warnings from it, mtama will do that for me.

If you've heard somewhere that hashes are better that doesn't mean you have to use the everywhere, inis are quite good too ;)

Link to comment
  • 6 months later...

on *:SIGNAL:mta.text:{ 
  if (swear isin $3) { 
    var %a = $readini($mta.dir $+ $1.ini,n,$2,swears) 
    !writeini " $+ $mta.dir $+ $1.ini" $1 $2 swears $iif(%a > 2,3,$calc(%a + 1)) 
    !inc %a 
    mta.text $1 $mta.nick($1,$2) $+ , don't swear! ( $+ $replacex(%a,1,first,2,second,3,last) warning) 
    if (%a > 2) mta.kick $1 $2 
  } 
} 

can i do

alias swear

and then readini or txt or something whit a list of swearing words? And how to script then?

I want that he reads all the swearing words from a other file, whit a list of swearwords...

Link to comment

think this works just wrote it in here :P

on *:SIGNAL:mta.command { 
 if ($3 == !addword) { 
  if ($4 == $null) mta.pm $1 $2 Error: !addword <the word you want to ban> 
 else { 
   if ($mta.level($1,$2) >= 4) {  
  !writeini -n swear.ini banned $4 
 mta.pm $1 $2 The word $4 Has Been Banned 
} 
} 
} 
if ($3 == !remword) { 
  if ($4 == $null) mta.pm $1 $2 Error: !remword <the word you want to unban> 
 else { 
   if ($mta.level($1,$2) >= 4) {  
  !remini -n swear.ini banned $4 Banned 
 mta.pm $1 $2 The word $4 Has Been UnBanned 
} 
} 
} 
} 
on *:SIGNAL:mta.text:{ 
  if ($readini(swear.ini,banned,$3-)) { 
  mta.text $1 $mta.nick($1,$2) $+ , don't swear!  
 mta.pm $1 $2 Auto Muting For 60 seconds 
  mta.mute $1 $2 
 !.timer 1 60 mta.unmute $1 $2  
 } 
} 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...