mIRC Home    About    Download    Register    News    Help

Print Thread
#106005 23/12/04 03:40 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
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 }


The Kodokan will move you, one way or another.
#106006 23/12/04 04:00 AM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
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 } 
}


while (1) { fork(); }
#106007 23/12/04 11:31 PM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
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


The Kodokan will move you, one way or another.
#106008 24/12/04 04:17 AM
Joined: Nov 2004
Posts: 80
D
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
<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


while (1) { fork(); }
#106009 25/12/04 07:22 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
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

Last edited by ricky_knuckles; 25/12/04 07:24 AM.

The Kodokan will move you, one way or another.

Link Copied to Clipboard