mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#157697 27/08/06 10:36 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
This is not supose to kick the user if they have op or voice on a channel. Any ideal ??

if (%drone == off) || !%drone || (%options.exempt == on) { return }
if $numtok($3-,32) > 9 && !$istok(@ +,$3-,32) {
ban -k #chat-room $2 2 14Drone Bot Detected } }

#157698 27/08/06 11:20 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
There's too much information missing from that for a determination.
Please post all of the relevant code, including the activation event, and the group(s) that are called (if any).
While it's good to not post too much code for a problem, not having enough code is (in my opinion) worse.

#157699 27/08/06 11:32 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
This is all the code. My script does a silence whois on join and I also can turn on a random whois.

raw 319:*:{
if (%drone == off) || !%drone || (%options.exempt == on) { return }
if $numtok($3-,32) > 9 && !$istok(@ +,$3-,32) {
ban -k #chat-room $2 2 14Drone Bot Detected } }

#157700 28/08/06 12:35 AM
Joined: Mar 2004
Posts: 210
F
Fjord artisan
Offline
Fjord artisan
F
Joined: Mar 2004
Posts: 210
How do %drone and %options.exempt get set? Whether the kick activates or not depends on these values. If they're set wrong for an op, the op still gets kicked.

#157701 28/08/06 12:40 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
!$istok(@ +,$3-,32)
This is looking for the 319 raw having @ or + all by itself as the entire $3- string, but i always see 319 returning strings like @#test or +#test

Depending on how your network replies, you might want
$wildtok($3-,@#*,1,32)
$wildtok($3-,+#*,1,32)

This also nails someone only if they're in more than 9 channels.

Depending on what you're trying to stop, you might want to have a slight timer-delay in doing the whois-on-join, if services isn't giving them their op or voice before the whois gives their 319 channel list.

#157702 28/08/06 12:42 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try this instead
Code:
 raw 319:*:{
  if (%drone != off) && (%options.exempt == on) {
    if $numtok($3-,32) > 9 {
      var %a = 1, %b = $numtok($3-,32)
      unset %ban 
      while %a <= %b {
        if $left($gettok($3-,%a,32),1) != @ && $v1 != + {
          set %ban $2
        }
        inc %a
      }
      if %ban == $2 && $me isop #chat-room {
        ban -k $v2 $2 2 Drone Bot Detected
      }
    }
  }
}
 

#157703 28/08/06 01:01 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Your code does not work frown

#157704 28/08/06 01:29 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Ok I change this line and now its working but it still kban users even if they have @ or +

if (%drone != off) && (%options.exempt == on) {

to:

if ( %drone == off ) || ( %drone == $null ) || ($nick isop #) || (%options.exempt == on) { return }

Last edited by Garou; 28/08/06 01:34 AM.
#157705 28/08/06 01:36 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In future, if a code doesn't work, please give some indication as to how you know it's not working.

This has been tested.
Code:
 raw 319:*:{
  if (%drone != off) && (%options.exempt != on) {
    if $numtok($3-,32) > 9 {
      var %a = 1, %b = $numtok($3-,32)
      unset %ban 
      while %a <= %b {
        if $left($gettok($3-,%a,32),1) == $chr(35) {
          set %ban $2
        }
        inc %a
      }
      if (%ban == $2) && ($me isop #chat-room) {
        ban -k $v2 $2 2 Drone Bot Detected
      }
    }
  }
}
 

Last edited by RusselB; 28/08/06 02:18 AM.
#157706 28/08/06 02:01 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Your code still doesn't make sense. Inside the raw 319, the '#' symbol isn't defined, and $nick is the name of the server.

#157707 28/08/06 02:07 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Well I test the codes thats why I know. Dont ask me why but This is the only way its working for me.

raw 319:*:{
if ( %drone == off ) || ( %drone == $null ) || ($nick isop #) || (%options.exempt == on) { return }
if $numtok($3-,32) > 9 {
var %a = 1, %b = $numtok($3-,32)
unset %ban
while %a <= %b {
if $left($gettok($3-,%a,32),1) == $chr(35) {
set %ban $2
}
inc %a
}
if %ban == $2 && $me isop #chat-room {
ban -k $v2 $2 2 14Drone Bot Detected
}
}
}
}

#157708 28/08/06 02:22 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
As maroon said, and as I pointed out to you in an earlier topic, # has no value inside the raw, so the comparison ($nick isop #) will always return false.
I realized that I had a small typo in the code that I posted here, and that has been corrected.

#157709 28/08/06 02:39 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
This is what I am using and I get this error.
* /if: invalid format (line 16, dialog22.op)

raw 319:*:{
if (%drone != off) && (%options.exempt != on) {
if $numtok($3-,32) > 9 {
var %a = 1, %b = $numtok($3-,32)
unset %ban
while %a <= %b {
if $left($gettok($3-,%a,32),1) == $chr(35) {
set %ban $2
}
inc %a
}
if (%ban == $2) && ($me isop #chat-room {
ban -k $v2 $2 2 14Drone Bot Detected
}
}
}
}

#157710 28/08/06 02:42 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
since you didn't tell us which was line 16 of your script, i assume it's this line, since it has mis-matched parenthesis:

if (%ban == $2) && ($me isop #chat-room {

#157711 28/08/06 02:49 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes sorry its this line here.

if (%ban == $2) && ($me isop #chat-room {

#157712 28/08/06 03:17 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
As was stated, you're missing a parantheses...specifically the closing parantheses between the specified channel name and the open brace.

if (%ban == $2) && ($me isop #chat-room) {

#157713 28/08/06 03:24 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes thx I fixed that but its still kban even if the user has @ or +

#157714 28/08/06 03:26 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Post the EXACT code that you're using so that it can be compared with the last code I posted, which was tested on 3 networks.

#157715 28/08/06 03:29 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
raw 319:*:{
if (%drone != off) && (%options.exempt != on) {
if $numtok($3-,32) > 11 {
var %a = 1, %b = $numtok($3-,32)
unset %ban
while %a <= %b {
if $left($gettok($3-,%a,32),1) == $chr(35) {
set %ban $2
}
inc %a
}
if (%ban == $2) && ($me isop #chat-room) {
ban -k $v2 $2 2 14Drone Bot Detected
}
}
}
}

#157716 28/08/06 03:52 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
raw 319:*:{
if (%drone != off) && (%options.exempt != on) && ($nick(#chat-room,$me,~&@%)) {
if $numtok($3-,32) > 11 {
if ($wildtok($3-,#*,$numtok($3-,32),32)) ban -k #chat-room $2 2 14Drone Bot Detected
}
}
}
The wildtok is counting how many channels "words" begin with the # symbol, and if there are X channels/words, and there are X channels/words that begin with the # symbol, then all the channels began with the # symbol, and you can skip the while-loop smile

Also, it's pointless to even do all the checking without first making sure you're an op.

The $nick(#chat-room,$me,~&@%) is checking whether you're Founder/Sop/Op/HalfOp, as they all have the power to ban - it's up to you whether you want any halfops doing so or not.

Page 1 of 2 1 2

Link Copied to Clipboard