mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 18
G
Gwion Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 18
Hi,

I tried to learn more about scripts and found a site which is really good .. but I still need help.
For example with this script .. I want a script that counts how often someone got banned in lets say 1 hour and if it's the 3rd time ban-kick that IP.

So, I found this script:
alias rl {
set -u3600 %rl. [ $+ [ $address($2,2) ] ] $calc( %rl. [ $+ [ $address($2,2) ] ] + 1)
;the -u3600 makes the variable unset after 1hr without being used
if (%rl. [ $+ [ $address($2,2) ] ] == 1) .notice $2 Please don't! - this is your first warning!
if (%rl. [ $+ [ $address($2,2) ] ] == 2) ban -u60 $1 $2 11
if (%rl. [ $+ [ $address($2,2) ] ] >= 3) {
ban $1 $2 11
kick $1 $2 You were warned. You have broken the rules one too many times!
}
}
on @*:TEXT:*:#test:{
if ($nick !isop #) {
if ([censored] isin $1-) {
;The above if statement is what actually checks for the swear words
rl # $nick
}
}
}

I tried this but only the notice part worked. I would also like to ban the first time for 30 seconds, second time for 60 seconds + message chan/nick and before ban-kick (for 60 minutes) message chan/nick as well.
I played around with that script but couldn't manage to get it work.

Any help is appreciated.
Thanks,
Gwion

Joined: Feb 2003
Posts: 32
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 32
Your script worked great all the times and I can't understand why you have problems...

Also you said that you liked a ban to the IP. You should know that a ban to an IP is different from a ban to userhost.
I made a script which the 3rd time bans the users IP wink (the unban with chanserv doesn't work for that laugh)

If you want his host replace:
banip $1 $2 $remove(%tmp,@)
with:
ban $1-2 11 | kick $1-2 your reason
and remove alias banip and "on DNS" (with group too).


Take a look:

Code:
on @*:TEXT:*:#test:{ if (($nick !isop #) && ([censored] isin $1-)) { rl # $nick } }
 
alias -l rl {
  var %tmp = $remove($address($2,2),!,*)
  set -u3600 %rl. [ $+ [ %tmp ] ] $calc( %rl. [ $+ [ %tmp ] ] + 1)
  if ( [ %rl. [ $+ [ %tmp ] ] ] == 1) { .notice $2 Please don't! - this is your first warning! }
  elseif ( [ %rl. [ $+ [ %tmp ] ] ] == 2) { ban -u60 $1-2 11 }
  else { banip $1-2 $remove(%tmp,@) }
}
 
alias -l banip { 
  set %banip.chan $1 | set %banip.nick $2 | set %banip.host $3 | .enable #banip | .dns $2
  ; *** Here you can add a timer (.timer 1 [sec] .disable #banip), so if you have lag to
  ;     disable the #banip group.
}
 
#banip off
on *:DNS: {
  if ($dns(0) == 0) { var %ip = *!*@ $+ $iaddress | goto kickban }
  if (($dns(0) == 1) && (%banip.host == $dns(1).addr)) { var %ip = *!*@ $+ $raddress | goto kickban }
  ; *** I don't do know if there is any possibility $dns(0) returns a number > 1 :(
  goto end
  :kickban  
  mode %banip.chan +b %ip
  if (%banip.nick ison %banip.chan) { kick %banip.chan %banip.nick You were warned. You have broken the rules one too many times! }
  :end
  unset %banip.* | .disable #banip
}
#banip end
 
 


It worked great...


Link Copied to Clipboard