mIRC Home    About    Download    Register    News    Help

Print Thread
#120366 17/05/05 10:16 AM
Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
hi
i have a script from sladekraven that when my bot is oper
then some friends of mine who they are in command list with the text command ( !ban ) banned someone if they want it through the bot .
Now ..is it possible with the same way anyone who is in command list to give order (when the bot is not an oper but it is in the channel) to become the bot an oper? (like op through chanserv) example : !opbot
this is the script for the ban command for example:
Code:
 
menu nicklist { 
  Commands List  
  .Add: {  
    if ($read(commands.lst,w,$address($$1,8))) {    
      echo 2 -a *** $$1 ( $+ $address($$1,8) $+ ) is already in commands list.  
    }  
    else {    
      echo 2 -a *** Added $$1 ( $+ $address($$1,8) $+ ) to commands list.    
      .write commands.lst $address($$1,8) 
    } 
  } 
  .Del: {  
    if (!$read(commands.lst,w,$address($$1,8))) {     
      echo 2 -a *** $$1 ( $+ $address($$1,8) $+ )  isn't in commands list.  
    }  
    else {     
      echo 2 -a *** Removed $$1 ( $+ $address($$1,8) $+ ) commands list.  
      write -dw $+("*,$address($$1,8),*") commands.lst 
    } 
  }
}
on @*:Text:!ban *:#: {
  if ($read(commands.lst,w,$address($nick,8))) {   
    if ($2 ison $chan) && ($2 !isop $chan) && ($2 != $me) { ban -k $chan $2 3 $3- } 
  }
}
 


thanks

#120367 17/05/05 11:03 AM
Joined: Apr 2005
Posts: 9
B
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
B
Joined: Apr 2005
Posts: 9
Code:
on @*:Text:!*:#:{
  if ($read(commands.lst,w,$address($nick,8))) {
    if ($1 = !ban) { if ($2 ison $chan) && ($2 !isop $chan) && ($2 != $me) { ban -k $chan $2 3 $3- } }
    if ($1 = !kick) { if ($2 ison $chan) && ($2 !isop $chan) && ($2 != $me) { kick $chan $2 $iif($3,$3-,no reason) } }
    if ($1 = !operup) { chanserv op $chan $me }
  }
} 

#120368 17/05/05 11:06 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Code:
on @*:Text:!opbot *:#: {
  if ($read(commands.lst,w,$address($nick,8))) {   
    if ($2 ison $chan) && ($2 !isop $chan) && ($2 != $me) { msg chanserv OP $chan $2 } 
  }
}

your request was a tad hard to understand, i hope this is what you meant.


$maybe
#120369 17/05/05 11:10 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Without knowing which server your on, all I can do is give you a general code. Some chanserv's have different functions activated, so while this will work on the server I'm on, I can't guarantee it'll work on yours.
Code:
on *:text:!opbot:#:{ .cs op $chan $me }  

#120370 17/05/05 11:14 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hey juble, try this..

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

on @*:Text:*:#: {
  if ($read(commands.lst,w,$address($nick,8))) {
    if ($1 == !ban) { 
      if ($2 ison $chan) && ($2 !isop $chan) && ($2 != $me) { 
        ban -k $chan $2 3 $3- 
      } 
    }
    if ($1 == !opbot) { 
      ChanServ OP $chan $me 
    }
    ;More commands here
  }
}


-Andy

#120371 17/05/05 03:05 PM
Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
thanks all of you smile
only one thing again
if i want it to add only with the nicks not host or adress what can i do ?????

"""on @*:Text:*:#: { if ($read(commands.lst,w,$address($nick,8))) { """"

Last edited by juble; 17/05/05 04:05 PM.
#120372 17/05/05 06:44 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Just use $nick in place of $address($nick,8)

Used the $address($nick,8) from your posted example

#120373 17/05/05 08:51 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
The whole point of adding the host is because anyone can use that nick and then the bot will become vulnerable. But it's entirely up to you at the end of the day. smile

-Andy

#120374 18/05/05 03:23 PM
Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
i replace it with the $nick but its not work frown
* sladekraven i now what u mean but the nicks in command list are registered nicks to the server!

#120375 18/05/05 03:51 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Untested, but try this..

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

on @*:Text:*:#: {
  if ($read(commands.lst,w,$nick)) {
    if ($1 == !ban) { 
      if ($2 ison $chan) && ($2 !isop $chan) && ($2 != $me) { 
        ban -k $chan $2 3 $3- 
      } 
    }
    if ($1 == !opbot) { 
      ChanServ OP $chan $me 
    }
    ;More commands here
  }
}


-Andy

#120376 19/05/05 05:36 PM
Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
Thanks Slade
it's work now
Good luck in Canada smile

Last edited by juble; 19/05/05 05:36 PM.
#120377 19/05/05 09:50 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Thank you for that gesture, I'll need all the luck I can get hold of.
Although, I have been before and found the people ever so friendly, 2 years have passed, I'll be reunited with my father once again. I hope they'll still be friendly with me. smile

-Andy


Link Copied to Clipboard