mIRC Home    About    Download    Register    News    Help

Print Thread
Level #147462 18/04/06 11:52 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
on bot i usualy for retreiveing levels use this $level($fulladdress)

but what if i dont want some command to affect users in level list like ban command or kick

what kind of identifiers should i use ?


i have this script (bot) and it wont work as protection toward
any known members on level list

Code:
 
on 20:TEXT:-out*:%empire:{ 
  if ($me isop $chan) {
    if ($1 != -out) return
    if ($2 == $me) { .notice $nick You must be joking... | halt }
    if ($2 == $null) { .notice $nick usage: -out <nickname> | halt }
    if ($2 ison $chan) && ($address($2,2) == $level($fulladdress)) { .notice $nick no way... | halt }
    elseif ($2 ison $chan) && ($address($2,2) != $level($fulladdress)) { .writeini blacklist.ini blackmark $address($2,2) 1 | .ban -k %empire $2 1 Your presence on %empire is not wanted. | halt }
  }
  else { .notice $nick O-Flag required. | halt }
}

 

Last edited by raZOR; 18/04/06 11:53 PM.

IceCapped
Re: Level #147463 19/04/06 12:37 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on @20:TEXT:-out*:%empire:{ 
  if ($me !isop $chan) {
    if ($2 == $me) .notice $nick You must be joking...
    elseif ($2 == $null) .notice $nick usage: -out <nickname>
    elseif ($2 ison $chan) && ($level($fulladdress) == <level>) { .notice $nick no way... }
    elseif ($2 ison $chan)  {
      .writeini blacklist.ini blackmark $address($2,2) 1
      .ban -k %empire $2 1 Your presence on %empire is not wanted. 
    }
  }
  else .notice $nick O-Flag required.
}
 

Replace <level> with the actual user level that you want to be safe
eg: if you want those that can access this command to be safe, replace <level> with 20

Re: Level #147464 19/04/06 12:56 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
well theres still problem with levels
what if i have more users with levels and not just 1

i cant make then

elseif ($2 ison $chan) && ($level($fulladdress) == 10)
elseif ($2 ison $chan) && ($level($fulladdress) == 20)
elseif ($2 ison $chan) && ($level($fulladdress) == 30)

thats why i wanted to know is it possible for mirc just
to check if $2 has any levels, if not kick/ban him

or is it possible (if this above isnt) to make range between levels, like if $2 is in level between 10 and 30 then stop ?


IceCapped
Re: Level #147465 19/04/06 01:34 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
For kicking/banning on no levels
Code:
 on @20:TEXT:-out*:%empire:{ 
  if ($me !isop $chan) {
    if ($2 == $me) .notice $nick You must be joking...
    elseif ($2 == $null) .notice $nick usage: -out &lt;nickname&gt;
    elseif ($2 ison $chan) &amp;&amp; $level($fulladdress) { .notice $nick no way... }
    elseif ($2 ison $chan)  {
      .writeini blacklist.ini blackmark $address($2,2) 1
      .ban -k %empire $2 1 Your presence on %empire is not wanted. 
    }
  }
  else .notice $nick O-Flag required.
}
 


For kicking & banning on levels other than those between 10 & 30 (inclusive)
Code:
 on @20:TEXT:-out*:%empire:{ 
  if ($me !isop $chan) {
    if ($2 == $me) .notice $nick You must be joking...
    elseif ($2 == $null) .notice $nick usage: -out &lt;nickname&gt;
    elseif ($2 ison $chan) &amp;&amp; ($level($fulladdress) &gt;= 10 &amp;&amp; $level($fulladdress) &lt;= 30) { .notice $nick no way... }
    elseif ($2 ison $chan)  {
      .writeini blacklist.ini blackmark $address($2,2) 1
      .ban -k %empire $2 1 Your presence on %empire is not wanted. 
    }
  }
  else .notice $nick O-Flag required.
}
 


There's both of the possibilities you requested...take your pick, and/or modify as you see fit. You should be able to figure it out yourself from the examples/codes above.

Re: Level #147466 19/04/06 01:55 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
this is great !
thank you so much !


IceCapped