mIRC Home    About    Download    Register    News    Help

Print Thread
#171250 21/02/07 09:27 PM
Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
If i wana make a command like "-b NICK" and it will remove the ban.

Example when I ban someone it write this to the banlist...
NICK!*******@****.***.***.com

I wana make a script that will remove that ban by using the Nick.

commands like "/mode #chan -b $2" wont work. I dont know what Im missing frown

Justin_F #171252 21/02/07 11:03 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on @*:text:-b &:#:{
if $read(banlist.txt,w,$2) {
.mode $chan -b $v1
}
}

Note: If the name of the file that tracks your banlist isn't banlist.txt, then change the name to match.
Usage: -b <nick>

RusselB #171253 21/02/07 11:45 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I can't test right now, but I don't believe that will work. Unless I'm mistaken, using "w" without wildcards will search the line for an exact match (nothing before or after).

Based on how the OP said the banlist is formatted, I'd use:

Code:
  if $read(banlist.txt,w,$2 $+ !*) {


for the search instead. That will guarantee that it will only match exact nicks and not partial nicks.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #171257 22/02/07 01:27 AM
Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
In order for the whole read from banlist.txt to work dont I need to make it write to banlist.txt when I use my ban command?

I dunno how to access the banlist. There isnt any .txt file for it. The current way i only can veiw it is when i left click and then go to channel modes..

Last edited by Justin_F; 22/02/07 01:32 AM.
Justin_F #171262 22/02/07 02:49 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
OK...You're referring to the internal ban list (ibl), which stores the information regarding the banned person based on the mask used when the ban is performed. This is contrary to the format that you specified in your original post.

Code:
on @*:text:-b &:#:{
  var %a = 1, %b = $ibl($chan,0)
  while %a <= %b {
    if $+($2!,*) iswm $ibl($chan,%a) {
      .mode $chan -b $v2
    }
    inc %a
  }
}



Link Copied to Clipboard