mIRC Home    About    Download    Register    News    Help

Print Thread
$protect #112007 20/02/05 05:31 PM
Joined: Feb 2003
Posts: 38
C
cvic Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 38
I have this *foo*!*@* in my Protected list.
When I do //echo -a $protect(*foobar*!*@*) I get * /echo: insufficient parameters.

In the help file it says: The $protect(address/N) identifier returns any matching address in the list

Doesn't *foobar*!*@* match *foo*!*@* or what?

It works with $ignore, ie. if I add *foo*!*@* to my ignore list, and then type //echo -a $ignore(*foobar*!*@*) it do returns the value.

Re: $protect #112008 20/02/05 06:05 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline
Babel fish
Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
//echo -a $ignore(*foobar*!*@*) with *foo*!*@* added doesn't work

same with $protect

but if i do //echo -a $ignore(*foo*!*@*) works fine
and //echo -a $protect(*foo*!*@*) works fine smirk

Re: $protect #112009 20/02/05 08:23 PM
Joined: Feb 2003
Posts: 38
C
cvic Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 38
So how to check if a user is in my protected list?

Re: $protect #112010 21/02/05 04:45 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I could be wrong on this but I think the $ignore() and $protect identifiers wont match all addresses like you've stated because if two people with the ident foo and foobar and it matches on *foo*. And you happen to have a script that will give them operator status they could take it over. As I said I could be wrong, but it could happen.

You could use something like this without having to use the $protect() identifier. It's just a thought.


[04:41] * TecnoVM64 has joined #Andy
[04:41] <Andy> TecnoVM64 is in my protect list. Now Opping.
[04:41] * Andy sets mode: +o TecnoVM64


Code:
menu nicklist {
  Protect
  .Add: {
    if ($read(protect.txt,w,$address($$1,8))) { 
      echo 2 -a *** $$1 ( $+ $address($$1,8) $+ ) is already in protect list.
    }
    else {
      echo 2 -a *** Added $$1 ( $+ $address($$1,8) $+ ) to protect list.
      .write protect.txt $address($$1,8)
    }
  }
  .Del: {
    if (!$read(protect.txt,w,$address($$1,8))) { 
      echo 2 -a *** $$1 ( $+ $address($$1,8) $+ )  isn't in protect list. 
    }
    else { 
      echo 2 -a *** Removed $$1 ( $+ $address($$1,8) $+ ) from protect list. 
      write -dw $+ "* $+ $address($$1,8) $+ *" protect.txt
    }
  }
}

on @*:Join:[color:red]#channel[/color]: {
  if ($read(protect.txt,w,$address($nick,8))) { 
    msg $chan $nick is in my protect list.  Now Opping. 
    mode $chan +o $nick
  }
}

Re: $protect #112011 21/02/05 07:54 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Loop and check each protect entry iswm <address>
  • //var %i = 1 | while $protect(%i) { if $v1 iswm foobar*!*@* { echo -a $v2 is protected. } | inc %i }

Re: $protect #112012 05/03/05 06:56 PM
Joined: Feb 2003
Posts: 38
C
cvic Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 38
Thanks, this seems to be the only solution. smile

Re: $protect #112013 05/03/05 08:00 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well, it depends where you're using it. If you're checking the nick is protected from inside a channel event, such as on text/action/join/etc you can use
  • if $nick isprotect # { do channelspecific stff }
    if $nick isprotect { dostuff }
    if $protect($nick) { stuff }
(These match against address masks as well as nicks, as long as the nick is is the IAL)