mIRC Home    About    Download    Register    News    Help

Print Thread
#120220 15/05/05 12:22 PM
Joined: Nov 2004
Posts: 15
V
Pikka bird
OP Offline
Pikka bird
V
Joined: Nov 2004
Posts: 15
I am writing a code that read the file allowip.txt, if the hostname of chatters does not match with the ip addresses in allowip.txt, they will be klined , if their ip is matching with the ips in allowip.txt, they will be voiced in the room. and suppose that i am an ircop and have a op status in rooms.

But it did not work. Please help me

on +1:JOIN:#:{
set %nkk.lines $lines(allowip.txt)
set %nkk.line 1
:next
if %nkk.line > %nkk.lines { goto end }
if $read -l $+ %nkk.line allowip.txt !isin $address($nick,2) { goto nkline }
if $read -l $+ %nkk.line allowip.txt isin $address($nick,2) { goto nkkvoice }
inc %nkk.line
goto next
:nkkvoice
if $me isop $chan {
mode $chan +v $nick
}
:nkline
if $me isop $chan {
kline $nick IP-is-not-allow
}
:end
unset %nkk*
}

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hey dude, this is untested. I used a While() loop instead of a Goto.

Code:
On !*:Join:#: {
  var %nkk.lines = $lines(allowip.txt)
  while (%nkk.lines) {
    if ($read(allowip.txt,w,$+(*,$address($nick,2),*))) { 
      if ($me isop $chan) mode $v2 +v $nick 
      halt 
    }
    else { 
      kline $nick IP-is-not-allow
      halt 
    }   
    dec %nkk.lines
  }
}


-Andy

Last edited by SladeKraven; 15/05/05 12:54 PM.
Joined: Nov 2004
Posts: 15
V
Pikka bird
OP Offline
Pikka bird
V
Joined: Nov 2004
Posts: 15
it does not work SladeKraven ,

it stil kline the hostname in allowip.txt list Andy.

Last edited by vuongthacsi; 17/05/05 10:27 AM.
Joined: Nov 2004
Posts: 15
V
Pikka bird
OP Offline
Pikka bird
V
Joined: Nov 2004
Posts: 15
format in allowip.txt as follow:

13.4.
223.3.34.2
123.46.65.


Link Copied to Clipboard