mIRC Homepage
Posted By: DOOJ Simple text trigger - 05/09/05 02:01 PM
Hello everyone.

What I want to do is be able to type specialop! and I get devoiced and deop'd.
Can someone tell me how to do that please? Weird I know. smile
Thank you.
Posted By: Abuser__ Re: Simple text trigger - 05/09/05 02:35 PM
like this:
Code:
on *:text:specialop!:#:{
  if ($nick != YourNick) { halt }
  if ($nick isop $chan) mode $chan -o $nick
  if ($nick isvoice $chan) mode $chan -v $nick
}

just replace YourNick with your real nick on irc :P
Posted By: adazh Re: Simple text trigger - 05/09/05 03:53 PM
According to what he wrote, he wants it to occur when HE types it, which would require on INPUT. At least that is how I read it. In that case, you would do this:

on 1:INPUT:#:{
if ($1 == specialop! && $me isvoice $chan && $me isop $chan) { mode $chan -v $me }
if ($1 == specialop! && $me isop $chan) { mode $chan -o $me }
}

No need to change anything in the code, just type specialop! in any channel you are opped on.
Posted By: DOOJ Re: Simple text trigger - 05/09/05 05:10 PM
That's exactly what I'm after, thanks adazh.
If I wanted to do the reverse of that by saying another command, do I just edit add to this script with something similar but change the -v and -o to +v and +o so that my script looks like this?

Code:
on 1:INPUT:#:{
if ($1 == specialop! && $me isvoice $chan && $me isop $chan) { mode $chan -v $me }
if ($1 == specialop! && $me isop $chan) { mode $chan -o $me }
}

on 1:INPUT:#:{
if ($1 == op! && $me isvoice $chan && $me isop $chan) { mode $chan +v $me }
if ($1 == op! && $me isop $chan) { mode $chan +o $me }
}
Posted By: DOOJ Re: Simple text trigger - 05/09/05 05:20 PM
To answer my own question, no.
I don't even know where to start with editing because I don't know anything about it, but I'll give it a go till I get a response.
Thanks.
Posted By: adazh Re: Simple text trigger - 05/09/05 05:20 PM
Unless you are an IRC Operator and you have access to op yourself on a channel, then that would not work. You would need to send an op command to ChanServ or whatever the Channel Management service is (if any).

You could just add to the existing code also.

Example:

on 1:INPUT:#:{
if ($1 == specialop! && $me isvoice $chan && $me isop $chan) { mode $chan -v $me }
if ($1 == specialop! && $me isop $chan) { mode $chan -o $me }
if ($1 == op! && $me !isvoice ) { msg ChanServ voice $chan $me }
if ($1 == op! && $me !isop $chan) { msg ChanServ op $chan $me }
}

You don't seem to understand what it's checking for so I'll explain a bit.

$me isvoice $chan - Checks if you are VOICED on the channel
$me !isvoice $chan - Checks if you are DE-VOICED on the channel
$me isop $chan - Checks if you are OPPED on the channel
$me !isop $chan - Checks if you are DE-OPPED on the channel
Posted By: DOOJ Re: Simple text trigger - 05/09/05 05:37 PM
I had to delete the line:
if ($1 == op! && $me !isvoice ) { msg ChanServ voice $chan $me }
to make that work, but that is all perfect and it does exactly what I want.

Thank you adazh smile
Posted By: adazh Re: Simple text trigger - 05/09/05 05:43 PM
Sorry about that. Change this line

if ($1 == op! && $me !isvoice ) { msg ChanServ voice $chan $me }

to this:

if ($1 == op! && $me !isvoice $chan) { msg ChanServ voice $chan $me }
© mIRC Discussion Forums