mIRC Homepage

script help

Posted By: Garou

script help - 28/10/06 03:48 PM

on @*:op:#chat:{
if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) || ($read($scriptdir $+ exempts.op,nw,$opnick)) { return }
if (!$read($scriptdir $+ guardian.op,nw,$opnick)) { mode $chan -o $opnick }
}
on *:nick:{
if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) { return }
if ($read($scriptdir $+ exempts.op,nw,$newnick)) { return }
var %i = 1
while ($comchan($newnick,%i)) {
if ($me isop $v1) && ($newnick isop $v2) && (!$read($scriptdir $+ guardian.op,nw,$v1)) { mode $comchan($newnick,%i) -o $newnick }
inc %i
}
}

Can I also add full ban with a kick msg on deop?
Posted By: KingTomato

Re: script help - 28/10/06 04:03 PM

I'm not sure I understand what you want to happen, but here is one way to take your request:

Code:
on @*:op:#chat:{
  if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) || ($read($scriptdir $+ exempts.op,nw,$opnick)) { return }
  if (!$read($scriptdir $+ guardian.op,nw,$opnick)) {
    ;mode $chan -o $opnick
    [color:red]mode $chan -o+b $nick $wildsite
    kick $chan $nick You have been kicked for unauthorized op[/color]
  }
}

on *:nick:{
  if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) { return }
  if ($read($scriptdir $+ exempts.op,nw,$newnick)) { return }
  var %i = 1
  while ($comchan($newnick,%i)) {
    if ($me isop $v1) && ($newnick isop $v2) && (!$read($scriptdir $+ guardian.op,nw,$v1)) {
      ;mode $comchan($newnick,%i) -o $newnick
      [color:red]mode $comchan($newnick,%i) -o+b $newnick $wildsite
      kick $comchan($newnick,%i) $nick You have been kicked for unauthorized op[/color]
    }
    inc %i
  }
} 


I commented out your previous line just incase, and added two more. If you meant to ban when you deop them, this is your solution. If you want a ban on deop (as in the on DEOP event) then I'd have to rewrite this solution.
Posted By: Garou

Re: script help - 28/10/06 04:06 PM

This is perfect thx KingTomato.
Posted By: Garou

Re: script help - 28/10/06 04:24 PM

This kick msg didnt work?
Posted By: Garou

Re: script help - 29/10/06 12:00 AM

The first part of the code red does not ban and the kick msg does not work.
The second part does work but again no kick msg.

Can anyone check what the error is?
Posted By: KingTomato

Re: script help - 29/10/06 08:38 PM

I'm sorry, I goofed on the identifiers.

Code:
on @*:op:#chat:{
  if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) || ($read($scriptdir $+ exempts.op,nw,$opnick)) { return }
  if (!$read($scriptdir $+ guardian.op,nw,$opnick)) {
    ;mode $chan -o $opnick
    mode $chan -o+b $opnick $wildsite
    kick $chan $opnick You have been kicked for unauthorized op
  }
}

on *:nick:{
  if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) { return }
  if ($read($scriptdir $+ exempts.op,nw,$newnick)) { return }
  var %i = 1
  while ($comchan($newnick,%i)) {
    if ($me isop $v1) && ($newnick isop $v2) && (!$read($scriptdir $+ guardian.op,nw,$v1)) {
      ;mode $comchan($newnick,%i) -o $newnick
      mode $comchan($newnick,%i) -o+b $newnick $wildsite
      kick $comchan($newnick,%i) $newnick You have been kicked for unauthorized op
    }
    inc %i
  }
} 
Posted By: Garou

Re: script help - 30/10/06 01:54 AM

Thx it works fine now.
Posted By: Garou

Re: script help - 30/10/06 04:22 PM

on @*:op:#chat:{
if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) { return }
if (!$read($scriptdir $+ guardian.op,nw,$opnick)) {
;mode $chan -o $opnick
mode $chan -o+b $opnick $wildsite
kick $chan $opnick 14Your nick does not have op access on this channel
}
}

on *:nick:{
if ( %opnick == off ) || ( %opnick == $null ) || ($nick isop #chat) { return }
if ($read($scriptdir $+ guardian.op,nw,$opnick)) { return }
var %i = 1
while ($comchan($newnick,%i)) {
if ($me isop $v1) && ($newnick isop $v2) && (!$read($scriptdir $+ guardian.op,nw,$v1)) {
;mode $comchan($newnick,%i) -o $newnick
mode $comchan($newnick,%i) -o+b $newnick $wildsite
kick $comchan($newnick,%i) $newnick 14Your nick does not have op access on this channel
}
inc %i
}
}


[11:10] * Mode (ChanServ:#chat +o _a`hay)
[11:10] * Mode (Linuxx:#chat -o+b _a`hay *!*@dal.net)
[11:10] * _a`hay was kicked by Me (Your nick does not have op access on this channel

On op it will deop but bans dalnet instead of the user any ideal why?
Posted By: KingTomato

Re: script help - 01/11/06 05:07 AM

Yea, I used $wildsite to ban the user not knowing you're using DAL net. DAL net uses a bogus mask in an effort to keep everyone anonymous. Try replacing $wildsite with this: $address

To further specify a mask, fool around with $address(name,mask) where name is the name of the person, and mask is a numeric value such as 1, 2, 3, etc. Find ne that works using something like: //echo -a $address($me,mask)

Just keep changing mask until you find one you like. Then put this code in your script but use $opnick and $newnick instead of $me.
Posted By: deegee

Re: script help - 01/11/06 01:24 PM

Quote:

[11:10] * Mode (ChanServ:#chat +o _a`hay)
[11:10] * Mode (Linuxx:#chat -o+b _a`hay *!*@dal.net)
[11:10] * _a`hay was kicked by Me (Your nick does not have op access on this channel
...
On op it will deop but bans dalnet instead of the user any ideal why?


ChanServ opped _a`hay
The ban mask matches ChanServ!service@dal.net.

If you don't want the user opped, remove their access from ChanServ.
Posted By: Garou

Re: script help - 01/11/06 10:33 PM

Ya all I did was to add var %i = 1 and I removed $wildsite and its working now :P

if (!$read($scriptdir $+ guardian.op,nw,$opnick)) {
var %i = 1
;mode $chan -o $opnick
mode $chan -o+b $opnick
© 2022 mIRC Discussion Forums