mIRC Homepage
Posted By: cvic $protect - 20/02/05 05:31 PM
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.
Posted By: ztnaraM Re: $protect - 20/02/05 06:05 PM
//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
Posted By: cvic Re: $protect - 20/02/05 08:23 PM
So how to check if a user is in my protected list?
Posted By: SladeKraven Re: $protect - 21/02/05 04:45 AM
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
  }
}
Posted By: Iori Re: $protect - 21/02/05 07:54 AM
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 }
Posted By: cvic Re: $protect - 05/03/05 06:56 PM
Thanks, this seems to be the only solution. smile
Posted By: Iori Re: $protect - 05/03/05 08:00 PM
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)
© mIRC Discussion Forums