CoZ Posted July 28, 2006 Share Posted July 28, 2006 (edited) sometimes people wanna use a command to much now it might be easier to watch for flooding in general. but how would i go about creating a sort of interval required before the same command can be used by the same person again ? im also intrigued in a global antiflood script thanks in advance edit topic was : interval between times a command can be used thought it over and the timecheck on each command could cause a serious load .. instead a simple flood protection would be better does anyone by chance have a antiflood snippet of code ? Edited July 28, 2006 by Guest Link to comment
Oli Posted July 28, 2006 Share Posted July 28, 2006 just stick a time check in alias mta.command or w/e its called these days Link to comment
lil Toady Posted July 28, 2006 Share Posted July 28, 2006 try something like on *:SIGNAL:mta.command:{ if (!%command [ $+ [ $3 ] ]) { set %command [ $+ [ $3 ] ] 1 !timer $+ $3 1 3 unset %command [ $+ [ $3 ] ] } } you can use a command once in 3 seconds dont know if it'll work, but try Link to comment
CoZ Posted July 29, 2006 Author Share Posted July 29, 2006 seems to work so far it doesnt execute the command.. thats a good thing but it doesnt warn people they're spamming .. ah well - it will stop it anyway thanks Link to comment
lil Toady Posted July 29, 2006 Share Posted July 29, 2006 on *:SIGNAL:mta.command:{ if (!%command [ $+ [ $3 ] ]) { set %command [ $+ [ $3 ] ] 1 !timer $+ $3 1 3 unset %command [ $+ [ $3 ] ] } else mta.msg $1 $2 Please don't use the command $+(',$3,') so much. } So it'll warn them not to use a command so much Link to comment
CoZ Posted July 29, 2006 Author Share Posted July 29, 2006 tried some like that ..couldnt get it to work before tried it again now .. and it did work maybe because i did some wrong with brackets or did this } else blabla } weird ps .. mta.text or mta.pm , not msg but np thanks i found it messed with one particular command - making the script crash .. but ive changed it to if ($3 == !specificcommand) { } elseif (!%command [ $+ [ $3 ] ]) { blabla etcetcetc } else mta.pm $1 $2 dont spam } Link to comment
lil Toady Posted July 29, 2006 Share Posted July 29, 2006 ye, u can do it like that, but that command will have no anti-spam check dunno what caused an error though, maybe commands like 'if (!bla* iswm $3) {' can cause that.. not sure P.S: sorry for mta.msg, used to scripting for VC Link to comment
Recommended Posts