mIRC Homepage
Posted By: ricky_knuckles more bot help - 23/12/04 03:40 AM
i have a command to deop the specified nick or op the specified nick
these are open to a few people
i would like a way to keep these from being executed on me

sample:
on *:text:!opnick*:#:{
if ($ulevel >= 2) { /mode # +o $$2 }
else { /msg $chan $nick doesn't have level 2 access }
Posted By: DrStein Re: more bot help - 23/12/04 04:00 AM
Code:
  

on *:text:!opnick*:#:{
  if (!$2) { msg $chan You have to specify the nick you want to op $nick }
  elseif (($ulevel >= 2) && ($2 != $me)) { mode # +o $2 }
  elseif ($2 == $me) { msg $chan You can't play with me $nick } 
  else { msg $chan You don't have level 2 access $nick to use this command } 
}
Posted By: ricky_knuckles Re: more bot help - 23/12/04 11:31 PM
i didnt make it clear but i run 2 connections one with all the evnts in it another that i just chat on
so that wouldnt work
im thinking i just use a $ial witha comparison to fix it
thanks
Posted By: DrStein Re: more bot help - 24/12/04 04:17 AM
<DrStein> !opnick DrStein
<@sfgsdfgdf> You don't have level 2 access DrStein to use this command
<DrStein> !opnick DrStein
* sfgsdfgdf sets mode: +o DrStein
<@DrStein> !opnick sfgsdfgdf
<@sfgsdfgdf> You can't play with me DrStein

I don't see something wrong confused

I changed the order of ifs so the messages will appear in the correct order

Code:
 

on *:text:!opnick*:#:{  
  if ($ulevel &lt; 2) { msg $chan You don't have level 2 access $nick to use this command } 
  elseif (!$2) { msg $chan You have to specify the nick you want to op $nick }  
  elseif ($2 !ison $chan) { msg $chan $2 is not on $chan $+ ! }
  elseif ($2 == $me) { msg $chan You can't play with me $nick }  
  else { mode # +o $2 }  
}
 


Not in userlist

* Now talking in #testchannel
<DrStein> !opnick
<@testnick> You don't have level 2 access DrStein to use this command
<DrStein> !opnick test
<@testnick> You don't have level 2 access DrStein to use this command
<DrStein> !opnick DrStein
<@testnick> You don't have level 2 access DrStein to use this command

In userlist

<DrStein> !opnick
<@testnick> You have to specify the nick you want to op DrStein
<DrStein> !opnick test
<@testnick> test is not on #testchannel!
<DrStein> !opnick testnick
<@testnick> You can't play with me DrStein
<DrStein> !opnick DrStein
* testnick sets mode: +o DrStein
Posted By: ricky_knuckles Re: more bot help - 25/12/04 07:22 AM
try them when someone with a different id than you
you missed the point
i want to keep the commands from being executed against the bot and myself being opped is a demotion from owner

also rather than giving a message for when they dont give parameter 2 i just use $$2 so it halts
© mIRC Discussion Forums