mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2012
Posts: 28
H
HeRiNo Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Oct 2012
Posts: 28
Hello,

I am Dutch but I will try my best English smile
I have this litle script I want to use against publishing URL's/Emails in public rooms. The script is working fine but there is one problem. It does not work on chatters that have + voice. I would like it not to work on @ but I would likre it to work on + voice. I hope some one can help me and knows what to add (or delete) in the script so it also warns/kick chatters with + voice and not people with @ .

Regards, Herman.

Code:
; Copy the following code into your remotes (Alt+R)
; Tye @ Undernet #Test-IRC
on @*:TEXT:*:#: {
  ; The list of Urls/emails. Items should be separated by commas
  var %swears = www,www.,http,http:,http://,.com,.nl,.com,.net,.tk,eu,@hotmail,@live
  ; Number of times to warn before banning
  var %warns = 2
  var %x = $numtok(%swears,44)
  tokenize 32 $strip($1-)
  while (%x) && ($nick isreg $chan) {
    if ($istok($1-,$gettok(%swears,%x,44),32)) {
      inc $+(%,swear.,$wildsite)
      var %n = $($+(%,swear.,$wildsite),2)
      if (%n <= %warns) {
        .msg $chan 4 $nick $+ , 14dit is waarschuwing nr:4 $(%n) 14om geen website URL's/Emailadressen in de room te typen, na.4 3 x14 volgt er een ban.) 3@ 12Room-Bot 3@
      }
      elseif (%n > %warns) {
        ban -ku300 $chan $nick 2 14Je was gewaarschuwd4 $nick . 14Geen Website's/Emailadressen plaatsen in de room. 3@ 12Room-Bot 3@
        unset $+(%,swear.,$wildsite)
      }
    }
    dec %x
  }
}
; Reset all of the swear data on mIRC start
on *:START: { unset %swear.* }

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
This is the part that makes it work only for regular users (not voice, op, etc):

Code:
($nick isreg $chan)


If your network only has the three statuses (regular, voice, and op), then you can just change isreg to !isop , which would make it work as long as the user is not an op. If you have more statuses than that, then !isop may not work exactly the way you want and you could use an OR statement to check isreg and isvo (is voice):

Code:
($nick isreg $chan || $nick isvo $chan)


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2012
Posts: 28
H
HeRiNo Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Oct 2012
Posts: 28
Hi Riamus2

Thanx for the quick reply. My network has more then 3 statuses like ~owner. so the first option !isop I tryed and like you said it doesnt work. The second option for more then 3 statuses I tryed and now it works thank you verry much. Now there is one more problem. There is also the status ~ Owner (channel owner) on my network and also my self as network Admin still get kicked. Is there a way to make that Owners/Admins not get kicked??

Regards, Herman.

Last edited by HeRiNo; 20/10/12 05:31 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It looks at channel status, so if your status isn't at least op in the channel, it will affect you. I'm guessing your network admin status is not a channel status. Owner shouldn't be affected since that should not be considered a regular or voiced user. However, if it does, you can check .pnick instead...

$nick($chan, $nick).pnick

Using that, you can check the channel modes for the nick see if the modes you don't want it to affect are there.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2012
Posts: 28
H
HeRiNo Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Oct 2012
Posts: 28
Hi Riamus2,

thanx again for your reply but I am affraid I dont understand you explanation.
What I did no is: I replaced:

Code:
($nick isreg $chan || $nick isvo $chan)


with

Code:
$nick($chan, $nick).pnick


but is still doesnt work correctly. the first option was that +voice also was kicked/banned <> Thats good but in the second option again voice was protected. So I put back the first option, the only problem is then <> @ is not protected and get kick/banned by the script. Is there a way to solve this? I hope you can help me. Please remember that I am Dutch so please use simple text so I can understand.

Regards, Herman.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That was just a note on where to look so you could attempt to do it yourself. It wasn't a direct replacement. If you want a direct replacement, here:

Code:
($regex($nick($chan,$nick).pnick, /[~|@].*/) != 1)


That will not trigger the script for ~ or @. If there are other modes you don't want it to trigger for, just add them in -- [~|@] is where you'd add them, so for example, if you also want a mode ! protected, you can make that [~|@|!] .


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2012
Posts: 28
H
HeRiNo Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Oct 2012
Posts: 28
Hi Riamus2,

Thank you verry verry much. Its working perfect now. I put this forum with my favorites and I will tell my friends about it. Thanks for de really fast and clear help.

Regards, Herman.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You could just use:
Code:
$nick(#,$nick,rv)

Joined: Nov 2012
Posts: 18
J
Pikka bird
Offline
Pikka bird
J
Joined: Nov 2012
Posts: 18
Code:
if ( $nick isop $chan )

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
AFAIK, isop doesn't work for things like owner status unless the person is also an op. And if it did, you'd want !isop for what was requested. Tomao's response is the way to do it - I forgot about being able to do that with $nick(). Also, there's no reason to bring up a thread that has been answered and hasn't had activity in a few weeks.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard