mIRC Home    About    Download    Register    News    Help

Print Thread
#165323 25/11/06 01:59 PM
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
This makes the bot just say the command, anyway to mkae it just half op the person? also ive a feeling im doing this the long way, as im going to have to add every single member :S

Code:
 on *^1:TEXT:!dehalfop doom126:#: {
  if (($nick isreg $chan || $nick isvoice $chan )) { halt }
else msg $chan /mode #the_british_legion -h doom126 }

on *^1:TEXT:!halfop doom126:#: {
  if (($nick isreg $chan || $nick isvoice $chan )) { halt }
else msg $chan /mode #the_british_legion +h doom126 }

#165324 25/11/06 02:28 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
remove the /msg $chan from the else statements

#165325 25/11/06 02:35 PM
Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
Code:
on @hoppers:TEXT:!dehalfop *:#the_british_legion: {
  if (($nick isreg $chan || $nick isvoice $chan )) { halt }
  msg $chan mode $chan -h $$2 
}

on @hoppers:TEXT:!halfop  *:#the_british_legion: {
  if (($nick isreg $chan || $nick isvoice $chan )) { halt }
  msg $chan mode $chan +h $$2 
}


* The @ prefix means you must be opped.
* The 'hoppers' user level is the level to which to add people you wish to be able to use these commands (Safer than allowing anyone to use it) (see "/help /auser" for adding users to levels, and "/help user levels" for general info)
** This means that the 'halt' line may not be necessary...
* The '*' in the matchtext matches anything (including nothing) after the command.
* The target is now channel-specific. You could add others, separating them with commas. (Safer than enabling it for all channels)
* You don't need '/'s in scripts.
* $chan will only ever be whatever channel the target triggered for (#the_british_legion, here)
* $$2 - the two $s mean that the script will halt if there was no parameter to the command. (i.e. someone typed in just "!halfop")

[edit]
P.S. I left the msg $chan in for testing; I assume you realised that you needed to remove it to get the mode command to work... Personally I would prefer a echo $chan, but I guess this is on a bot...)
[/edit]

Last edited by Sais; 25/11/06 02:38 PM.

Sais
#165326 25/11/06 02:42 PM
Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
You could also make this code smaller:

Code:
on @hoppers:TEXT:!*halfop *:#the_british_legion: {
  if (($nick isreg $chan || $nick isvoice $chan )) { halt }
  var %mode = $iif($1 == !halfop,+,-) $+ h

  msg $chan mode $chan %mode $$2 
}


* Not as non-error-prone as I would like, but if anyone tried !wibblehalfop (which would of course trigger the script), at least they only dehalfop someone.


Sais
#165327 25/11/06 05:29 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Neither of your replies addresses the original question, which was to have the bot actually do the half-op/de-half-op as opposed to stating the command in the channel.


Link Copied to Clipboard