Jump to content

Command Flood script


Keslertje2005

Recommended Posts

}
on *:SIGNAL:mta.command: {
 ;Parameters:
 ;$1 = Server
 ;$2 = ID
 ;$3 = Command
 ;$4- = Parameters
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2)
 /*
 /////////////////////////////////////////////////////
 //////////////      MTA:mA:GUS RPG      /////////////
 /////////////////////////////////////////////////////
 //               ..Work in Progress..              //
 //           ..Please remember to update..         //
 /////////////////////////////////////////////////////
 */
 if (!%command [ $+ [ $1 ] $+ [ $3 ] ]) { 
   set -u3 %command [ $+ [ $1 ] $+ [ $3 ] ] 1 
 if (!vote* iswm $3) {
   if ($gus.didvote($1,$2) == 0) {
     if ($4 == $null) mta.pm $1 $2 Error - $3 <1>
     elseif ($4) {
       if (10 >= $4 && $4 >= 1) {
         mta.pm $1 $2 You have given race " $+ $mta.race($1) $+ " a $4 $+ /10 Rating. ( $+ $calc($4 * 10) $+ $chr(37) $+ )
         !writeini -n " $+ $scriptdir $+ vote.ini" MAP $replace($mta.race($1),$chr(32),-) $gus.add($gus.votes($1),1)
         !writeini -n " $+ $scriptdir $+ vote.ini" VOTE $replace($mta.race($1),$chr(32),-) $+ $mta.nick($1,$2) 1
         !writeini -n " $+ $scriptdir $+ vote.ini" PERCENT $replace($mta.race($1),$chr(32),-) $gus.add($gus.votepercent($1),$calc($4 * 10))
       }
       else mta.pm $1 $2 Error - $3 <1>
     }
     else mta.pm $1 $2 Error - $3 <1>
   }
   else mta.pm $1 $2 Error - You have already voted on this map.
 }
 elseif ($3 == !rating) {

Thats what I did... but I dont think thats the way. I put that other message at the end of all the commands with mta.text.. What did u do wrong?

Link to comment

just a side note, i did some command flood testing on my server, and i discovered that it doesnt just affect the mirc server....

i tested it with !info programmed into my G15 keyboard, so i could mash the button....

it doesnt take much to completely crash mirc, but whats worse is, when its done in rapid succession, it can completely lock up the game on other peoples computers, such as my mates who was helping me test.

so i believe that all tho there is a problem with mIRC trying to reply to command spamming, there is also a problem with MTA itself that doesnt like it.

---------------------

also, does that script mute or kick said player for spamming? cos im looking for something like that to help protect against that kind of thing.

Link to comment
}

 if (!%command [ $+ [ $1 ] $+ [ $3 ] ]) { 
   set -u3 %command [ $+ [ $1 ] $+ [ $3 ] ] 1 
 if (!vote* iswm $3) {

Thats what I did... but I dont think thats the way. I put that other message at the end of all the commands with mta.text.. What did u do wrong?

it should be (edit .. i meant in general)

if { }

elseif {}

elseif {}

etcetcetc

Edited by Guest
Link to comment

Dit this:

on *:SIGNAL:mta.command: {
 ;Parameters:
 ;$1 = Server
 ;$2 = ID
 ;$3 = Command
 ;$4- = Parameters
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2)
 if (!%command [ $+ [ $1 ] $+ [ $3 ] ]) { 
   set -u3 %command [ $+ [ $1 ] $+ [ $3 ] ] 1 
 }
 /*
 /////////////////////////////////////////////////////
 //////////////      MTA:mA:GUS RPG      /////////////
 /////////////////////////////////////////////////////
 //               ..Work in Progress..              //
 //           ..Please remember to update..         //
 /////////////////////////////////////////////////////
 */ 
 elseif (!vote* iswm $3) {
   if ($gus.didvote($1,$2) == 0) {
     if ($4 == $null) mta.pm $1 $2 Error - $3 <1>
     elseif ($4) {
       if (10 >= $4 && $4 >= 1) {
         mta.pm $1 $2 You have given race " $+ $mta.race($1) $+ " a $4 $+ /10 Rating. ( $+ $calc($4 * 10) $+ $chr(37) $+ )
         !writeini -n " $+ $scriptdir $+ vote.ini" MAP $replace($mta.race($1),$chr(32),-) $gus.add($gus.votes($1),1)
         !writeini -n " $+ $scriptdir $+ vote.ini" VOTE $replace($mta.race($1),$chr(32),-) $+ $mta.nick($1,$2) 1
         !writeini -n " $+ $scriptdir $+ vote.ini" PERCENT $replace($mta.race($1),$chr(32),-) $gus.add($gus.votepercent($1),$calc($4 * 10))
       }

Still isnt workin :S

Link to comment

of course, you're doing it wrong...

i said:

on *:SIGNAL:mta.command:{
 if (!%command [ $+ [ $1 ] $+ [ $3 ] ]) {
   set -u3 %command [ $+ [ $1 ] $+ [ $3 ] ] 1

 }
 else mta.msg $1 $2 Please don't use the command $+(',$3,') so much.
}

and you do:

on *:SIGNAL:mta.command:{
 if (!%command [ $+ [ $1 ] $+ [ $3 ] ]) {
   set -u3 %command [ $+ [ $1 ] $+ [ $3 ] ] 1
 }

 else mta.msg $1 $2 Please don't use the command $+(',$3,') so much.
}

see the difference? do like i said

Link to comment

I have a Spam checker in The PRS script, in hash, however it should work okish in an ini, i havent tested this, but it should be ok.

alias spamcheck {
 if ($readini(spamtemp,id,$1 $+ $2) == spam) {
   mta.pm $1 $2 WARNING - DO NO SPAM!!! (30 sec mute)
   mta.mute $1 $2
   .timerunmute $+ $2 1 30 mta.unmute $1 $2
 }
 !writeini spamtemp id $1 $+ $2 spam
 .timerspam $+ $1 $+ $2 -m 1 900 !remini spamtemp id $1 $+ $2
}

also, add to ur first line of mta.text and mta.command,

spamcheck $1-

the 900 is the delay in miliseconds, if ur not happy with the time, u can change this number, but i tested it in my script and it seemed ok.

Link to comment
I have a Spam checker in The PRS script, in hash, however it should work okish in an ini, i havent tested this, but it should be ok.

alias spamcheck {
 if ($readini(spamtemp,id,$1 $+ $2) == spam) {
   mta.pm $1 $2 WARNING - DO NO SPAM!!! (30 sec mute)
   mta.mute $1 $2
   .timerunmute $+ $2 1 30 mta.unmute $1 $2
 }
 !writeini spamtemp id $1 $+ $2 spam
 .timerspam $+ $1 $+ $2 -m 1 900 !remini spamtemp id $1 $+ $2
}

also, add to ur first line of mta.text and mta.command,

spamcheck $1-

the 900 is the delay in miliseconds, if ur not happy with the time, u can change this number, but i tested it in my script and it seemed ok.

Ah, thats nice so i dont have to type in all commands again.

Does this work in mtavc version to?

Link to comment
I have a Spam checker in The PRS script, in hash, however it should work okish in an ini, i havent tested this, but it should be ok.

alias spamcheck {
 if ($readini(spamtemp,id,$1 $+ $2) == spam) {
   mta.pm $1 $2 WARNING - DO NO SPAM!!! (30 sec mute)
   mta.mute $1 $2
   .timerunmute $+ $2 1 30 mta.unmute $1 $2
 }
 !writeini spamtemp id $1 $+ $2 spam
 .timerspam $+ $1 $+ $2 -m 1 900 !remini spamtemp id $1 $+ $2
}

also, add to ur first line of mta.text and mta.command,

spamcheck $1-

the 900 is the delay in miliseconds, if ur not happy with the time, u can change this number, but i tested it in my script and it seemed ok.

Ah, thats nice so i dont have to type in all commands again.

Does this work in mtavc version to?

There is no mta.mute in VC so it wont work, however, u could change it slightly to make it kick the player.

by changing:

   mta.pm $1 $2 WARNING - DO NO SPAM!!! (30 sec mute)
   mta.mute $1 $2
   .timerunmute $+ $2 1 30 mta.unmute $1 $2

to:

  mta.msg $1 $2 Warning - Do Not Spam In This Server!
  mta.kick $1 $2

this should work.

Link to comment
I have a Spam checker in The PRS script, in hash, however it should work okish in an ini, i havent tested this, but it should be ok.

alias spamcheck {
 if ($readini(spamtemp,id,$1 $+ $2) == spam) {
   mta.pm $1 $2 WARNING - DO NO SPAM!!! (30 sec mute)
   mta.mute $1 $2
   .timerunmute $+ $2 1 30 mta.unmute $1 $2
 }
 !writeini spamtemp id $1 $+ $2 spam
 .timerspam $+ $1 $+ $2 -m 1 900 !remini spamtemp id $1 $+ $2
}

also, add to ur first line of mta.text and mta.command,

spamcheck $1-

the 900 is the delay in miliseconds, if ur not happy with the time, u can change this number, but i tested it in my script and it seemed ok.

Ah, thats nice so i dont have to type in all commands again.

Does this work in mtavc version to?

There is no mta.mute in VC so it wont work, however, u could change it slightly to make it kick the player.

by changing:

   mta.pm $1 $2 WARNING - DO NO SPAM!!! (30 sec mute)
   mta.mute $1 $2
   .timerunmute $+ $2 1 30 mta.unmute $1 $2

to:

  mta.msg $1 $2 Warning - Do Not Spam In This Server!
  mta.kick $1 $2

this should work.

Really? I think mute is in every MTA version... Well, im not playing VC, so thats clearly i dont know anything about it. lol.

Link to comment
  • 1 month later...

Yesterady to idiot had been spaming on my serwer and I wrote this:

on *:SIGNAL:mta.command: {
 spam.check $1 $2
}
on *:SIGNAL:mta.text: { 
 spam.check $1 $2
}
alias spam.check {
 var %spam = $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$v1,0)
 if (%spam > 10) {
   mta.mute $1 $2
   $+(!.timer.spam.pm,$2) 1 5 mta.pm $1 $2 WARNING - DO NO SPAM (MUTE 180s)
   $+(!.timer.spam.attack,$2) 1 180 spam.errase $1 $2
 }
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$calc($v1 + 1),1)
 $+(!.timer.spam.check,$2) 1 2 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$calc($v1 - 1),0)
}
alias spam.errase {
 mta.unmute $1 $2
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),0,0)
}

It work similary as Sc00bY script but a litle difrent :P

Edit: This works better but sometime in mIRC say:

* /writeini: insufficient parameters (line 25, spamattack.mrc)

This is the line (midle):

alias spam.dec {
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$calc($v1 - 1),0)
}

This is all code:

on *:SIGNAL:mta.command: {
 spam.check $1 $2
}
on *:SIGNAL:mta.text: { 
 spam.check $1 $2
}
on *:SIGNAL:mta.part: { 
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) 0
}
alias spam.check {
 var %spam = $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$v1,0)
 if (%spam > 10) {
   mta.mute $1 $2
   $+(!.timer.spam.pm,$2) 1 5 mta.pm $1 $2 WARNING - DO NO SPAM (MUTE 180s)
   $+(!.timer.spam.attack,$2) 1 180 spam.errase $1 $2
 }
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$calc($v1 + 1),1)
 $+(!.timer.spam.check,$2,$rand(1,99)) 1 2 spam.dec $1 $2
}
alias spam.errase {
 mta.unmute $1 $2
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),0,0)
}
alias spam.dec {
 !writeini -n " $+ $scriptdir $+ spamtemp.ini" SPAM $mta.nick($1,$2) $iif($readini($scriptdir $+ spamtemp.ini,SPAM,$mta.nick($1,$2)),$calc($v1 - 1),0)
}

Link to comment
  • Recently Browsing   0 members

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