mIRC Homepage
Posted By: Xtibian [Request]Again yet another nooby one. :( - 30/08/06 07:20 PM
Yet another most likely very simple script request.

I need a script for ignoring a person. So when they flood the channel by using !/@ commands on a bot the bot will auto ignore them for 5 mins then take them off the ignore. Also, have it so it sends them a notice that they are ignored for 5 mins for command abuse.

Thank you again.
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 07:58 PM
try this

Code:
alias floodcheck {
  var %fl.time = 10, %fl.lines = 3, %fl.ignore = 5
  inc $iif(!$($+(%,flood,.,$1,.,$2),2),$+(-eu,%fl.time)) $+(%,flood,.,$1,.,$2)
  if ( $($+(%,flood,.,$1,.,$2),2) >= %fl.lines ) .ignore $+(-u,$calc(%fl.ignore * 60)) $2
}  


Syntax: floodcheck $cid $nick

Sample use for the alias:

Code:
 On *:TEXT:@test:#: {
 floodcheck $cid $nick
 msg $chan this is a test
} 


When the snippet detects the flood, it ignores the nick for 5 mins. Default flood value is 3 lines within 10 secs. Change the value in the variables to fit your needs.
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 08:37 PM
For some reason it doesnt seem to work...atleast for me.
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 09:03 PM
The code works as I'm currently using it on my other scripts. How did you use it? Can you give a sample of your code?
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 09:07 PM
I didnt mod the one he posted I just tried that one. :|
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 09:17 PM
Tell me how tested the code.
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 09:20 PM
I just copied a few !commands and pasted in channel(on a test guy not a op/halfop) and the other bot in channel blocks it from using for 5 mins but my bot still doesnt. :|

(off subject: Can someone add a op check to this on
Code:
*:TEXT:*swearword*:#:{ /ban -ku10 # $nick $nick $+ , Kicked for Inappropriate content. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate content. [Inappropriate Content.You have a 10 second ban you may rejoin after.]: $1- }
) ty
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 09:26 PM
Try this then

Code:
 alias floodcheck {
  var %fl.time = 10, %fl.lines = 3, %fl.ignore = 5
  inc $iif(!$($+(%,flood,.,$1,.,$2),2),$+(-eu,%fl.time)) $+(%,flood,.,$1,.,$2)
  if ( $($+(%,flood,.,$1,.,$2),2) >= %fl.lines ) set $+(-eu,$calc(%fl.ignore * 60)) %flood.var 1
}   


Then in the event, use this



Code:
 On *:TEXT:@test:#: {
 floodcheck $cid $chan
 if ( %flood.var ) halt
 } 
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 09:29 PM
Do you mean Op check for the bot?

Code:
 On @*:TEXT:*swearword*:#:{ 
 ban -ku10 # $nick $nick $+ , Kicked for Inappropriate content. 
   write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate content. [Inappropriate Content. You have a 10 second ban you may rejoin after.]: $1- 
} 


Or you want to exclude ops for this script?

Code:
 On @*:TEXT:*swearword*:#:{ 
 if ( $nick isop $chan ) {
 ban -ku10 # $nick $nick $+ , Kicked for Inappropriate content. 
   write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate content. [Inappropriate Content. You have a 10 second ban you may rejoin after.]: $1- 
 }
} 
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 09:35 PM
exclude so dont get the annoying things saying op banned etc.


:| and I have no clue the flood thing still doenst work for me. lol
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 09:49 PM
Sorry, the event should look like this

Code:
 On *:TEXT:@test:#: {
  if ( %flood.var ) halt 
  msg $chan test
  floodcheck $cid $chan

} 
 
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 09:54 PM
ok to make sure add the one into aliases and the other into remote?

EDIT: Grr... Cant get this thing to work...:| I must be stupid or something. lol
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 10:06 PM
No, both should go to the remotes section.

If you see 'alias alias_name_here {...', this means that it should be placed in the remotes section & mirc will identify it as an alias. If there is no 'alias' in front of it, then it should be placed in the aliases section.
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 10:20 PM
ok ty. Appears to work but doesnt send a notice to the user...

EDIT: Umm looks like it stops anyone in channel from using the command not the one person.
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 10:29 PM
Then my first post should do that. wink
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 30/08/06 10:49 PM
that works lol

Anyways do you know how to set it so it sends a notice to the user?
Posted By: xDaeMoN Re: [Request]Again yet another nooby one. :( - 30/08/06 11:08 PM
Code:
 alias floodcheck {

  var %fl.time = 10, %fl.lines = 3, %fl.ignore = 5

  inc $iif(!$($+(%,flood,.,$1,.,$2),2),$+(-eu,%fl.time)) $+(%,flood,.,$1,.,$2)

  if ( $($+(%,flood,.,$1,.,$2),2) >= %fl.lines ) {

   [color:red] .notice $2 You have been ignored for %fl.ignore mins. [/color]

   .ignore $+(-u,$calc(%fl.ignore * 60)) $2
  
  }

}   
Posted By: Xtibian Re: [Request]Again yet another nooby one. :( - 31/08/06 01:39 AM
Thk again. smile works perfect. grin
© mIRC Discussion Forums