This is just something I thought I'd put on here for those who don't know how to do this. It's a simple script that allows you to turn any command on and off. Like, a game, or a greet script that responds to a word or something. Or anything else you may want to use it for.
You can change the variable and commands to anything you want. It's pretty easy to use.
Just edit your script and put the if and elseif commands in, which will tell the script if it's off, to not do anything, and when it's on, to do what you want it to.
I set it for a simple variable "on.off" but it could be changed to anything. To use just type !onoff on or !onoff off. And you can change the !onoff command to anything you want too.
on *:TEXT:!commandhere:#: {
if (%on.off == $null) {
halt
}
elseif (%on.off == on) {
commands here
}
}
on *:TEXT:!onoff *:#: {
if ($nick isop $chan) {
if ($2 == on) {
set %on.off on | .msg $chan Script is now on.
}
elseif ($2 == off) {
unset %on.off | .msg $chan Script is now off.
}
}
}
Fooking kiddies gettin butt hurt, he prolly deleted his mirc help(twats do that from time to time;D) file Steve rofl or just misspelled it...For all of those not douche bags, from the mirc help file.
$iif(C,T,F)
Returns T or F depending on whether the evaluation of the Conditional C is true or false.
$iif(1 == 2, yes, no) returns "no"
$iif() returns F if the conditional returns zero, $false, or $null. For any other value $iif() returns T.
If you don't specify the F parameter, $iif returns a T value if the condition is true, and returns nothing if it's false.
$iif(1 == 2, yes) returns nothing
You can find out more about conditionals in the if-then-else section.
Or just scroll up and read wat Jonesy44 said. t(-.-t)
@ The_Almighty_Duelist if you cant find $iif in the help by typing /help $iif then maybe you should update ur mIRC =/
here is just another way to do it. well just 1 of many ways...
on *:TEXT:!commandhere:#: {
if (%on.off) { code here }
else { msg # Pissoff }
}
on $@*:TEXT:/^(!on|!off)$/S:#: {
if ($nick isop $chan) {
$iif($regml(1) == !on,set %on.off on,unset %on.off)
msg # Script is now $iif(%on.off,on.,off.)
}
}
or like this with flood control
on $@*:TEXT:/^(!on|!off)$/S:#: {
if ($nick isop $chan && !$($+(%,onoff,.,flood),2)) {
set -u3 $+(%,onoff,.,flood) on
$iif($regml(1) == !on,set,unset) %on.off on
msg # Script is now $iif(%on.off,on.,off.)
}
}
Syntax: $iif(C,T,F)
Returns T or F depending on whether the evaluation of the Conditional C is true or false.
$iif(1 == 2, yes, no) returns "no"
If you don't specify the F parameter, $iif returns a T value if the condition is true, and returns nothing if it's false.
$iif(1 == 2, yes) returns nothing
change all the instances of %on.off to %on.off. [ $+ [ $chan ] ]