mIRC Homepage
Posted By: juble Op through chanserv - 17/05/05 10:16 AM
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
Posted By: bloodfog Re: Op through chanserv - 17/05/05 11:03 AM
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 }
  }
} 
Posted By: Mpdreamz Re: Op through chanserv - 17/05/05 11:06 AM
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.
Posted By: RusselB Re: Op through chanserv - 17/05/05 11:10 AM
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 }  
Posted By: SladeKraven Re: Op through chanserv - 17/05/05 11:14 AM
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
Posted By: juble Re: Op through chanserv - 17/05/05 03:05 PM
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))) { """"
Posted By: RusselB Re: Op through chanserv - 17/05/05 06:44 PM
Just use $nick in place of $address($nick,8)

Used the $address($nick,8) from your posted example
Posted By: SladeKraven Re: Op through chanserv - 17/05/05 08:51 PM
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
Posted By: juble Re: Op through chanserv - 18/05/05 03:23 PM
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!
Posted By: SladeKraven Re: Op through chanserv - 18/05/05 03:51 PM
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
Posted By: juble Re: Op through chanserv - 19/05/05 05:36 PM
Thanks Slade
it's work now
Good luck in Canada smile
Posted By: SladeKraven Re: Op through chanserv - 19/05/05 09:50 PM
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
© mIRC Discussion Forums