mIRC Home    About    Download    Register    News    Help

Print Thread
#222345 17/06/10 02:41 PM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
i want it that as user join my server and IP match from ip.txt database script auto kick and Ban the chatter in C class like if chatter Matt joined script will take who and on matching iP from Ip.txt will kick matt and will ban his ip like *!*@122.25.25.* Script is as under.



on *:join:*: {
.who $nick
}
raw 352:*: {
if ($read(ip.txt, w, $4)) {
.k $4 4Come with Original IP Dear
}
}

maSeeha #222346 17/06/10 03:06 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Something like this?
Code:
on @!*:JOIN:*: who $nick 
raw 352:*:{ 
  if ($read(ip.txt,$4)) {
    var %n = $comchan($3,0), %nick = $6, %ip = $v1
    while (%n) {
      var %chan = $comchan(%nick,%n)
      if ($comchan(%nick,%n).op) { mode %chan +b *!*@ $+ $gettok(%ip,1-3,46) $+ .* | kick %chan %nick 4Come with Original IP Dear }
      dec %n
    }
  }
}

5618 #222350 17/06/10 06:26 PM
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
@5618: $read(ip.txt,w,$4)


WorldDMT
chacha #222356 17/06/10 08:29 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Since $4 is the host returned by the server, which contains no wildcards, I see no use for the w-switch.

5618 #222375 18/06/10 01:54 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
its not working fully.

its taking who on join but not kicking even ip is same as in ip.txt

5618 #222384 18/06/10 05:48 AM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Try adding some dubugging code to verify all values are as expected:
Code:
on @!*:JOIN:*: who $nick 
raw 352:*:{ 
  echo -s 1: $1 2: $2 3: $3 4: $4 5: $5 6: $6
  echo -s READ: $read(ip.txt,$4)
  if ($read(ip.txt,$4)) {
    var %n = $comchan($3,0), %nick = $6, %ip = $v1
    while (%n) {
      var %chan = $comchan(%nick,%n)
      if ($comchan(%nick,%n).op) { echo -s .OP TRUE | mode %chan +b *!*@ $+ $gettok(%ip,1-3,46) $+ .* | kick %chan %nick 4Come with Original IP Dear }
      dec %n
    }
  }
}

5618 #222388 18/06/10 09:44 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
1: habibi 2: #SS 3: java 4: 122.164.92.79 5: DesiChat.chat.server 6: nasheela
READ: 122.164.92.79
-


But No Kick to User Even no Message like before

maSeeha #222390 18/06/10 12:30 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Are you a channel op (+o/@ or higher) on the channel in question?

5618 #222392 18/06/10 03:00 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Ah, 2 problems:
1. ip.txt is a reserved name in your $mircdir and cannot be used: rename your file to ips.txt
2. I should indeed have used the w-switch, so I stand corrected.
Code:
on @!*:JOIN:*: who $nick 
raw 352:*:{ 
  if ($read(ips.txt,w,$4)) {
    var %n = $comchan($6,0), %nick = $6, %ip = $4
    while (%n) {
      var %chan = $comchan(%nick,%n)
      if ($comchan(%nick,%n).op) { mode %chan +b *!*@ $+ $gettok(%ip,1-3,46) $+ .* | kick %chan %nick 4Come with Original IP Dear }
      dec %n
    }
  }
}

Edit: my $3 was an old remaining typo ;D

Last edited by 5618; 18/06/10 03:50 PM.
5618 #222393 18/06/10 03:04 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
raw 352:*:{ 
  if ($read(ips.txt,w,$4)) {
    var %n = $comchan($6,0)
    while (%n) {
      if ($comchan($6,%n).op) {
        mode $comchan($6,%n) +b *!*@ $+ $gettok($4,1-3,46) $+ .*
        kick $comchan($6,%n) $6 Come back with Original IP, dear
      }
      dec %n
    }
  }
}

Note the $6 used with the first $comchan (as it's the nickname)
Also note that "ip.txt" is a forbidden file name, the code above uses ips.txt.

Edit: you partially beat me to it smile
Edit2: Forgot to put the w-switch whistle

Horstl #222418 19/06/10 12:48 PM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
its taking who of nick but after then not working . no action

Horstl #222420 19/06/10 01:03 PM
Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
Wrong raw event, methinks...

In my QueryGuard, I use 354, 314, 315 and 369, where two of them get the address, and two of them get the end of whois/whowas, so if a whois fails to get the address for some reason, it uses a whowas instead.

I believe what you need is raw 354 :>

ziv.

maSeeha #222423 19/06/10 04:53 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Whose code are you currently using? And did you remove all previous copies of the script?

ziv #222446 19/06/10 08:54 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
raw 352 is standard who reply...

Horstl #222537 22/06/10 02:47 PM
Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
Perhaps, I used whois and whowas...

ziv.

ziv #222539 22/06/10 03:17 PM
Joined: Mar 2007
Posts: 41
E
Ameglian cow
Offline
Ameglian cow
E
Joined: Mar 2007
Posts: 41
who ever joins in my server not listed in nicks.txt will get zline, anyone can do that ?


Link Copied to Clipboard