I have the 8ball script installed on a bot. Sometimes, the 8ball script gets overused. I would like a script that can disable and enable the 8ball script.
For example, "!disable 8ball" would disable the script, and "!enable 8ball" will turn it back on. I also would only like operators to use those two commands. So how would I do this?
you could use a seperate script to /load and /unload commands...
or you can put the entire script in a #group , and turn that on of off with a script
Well first off you would need to add a command to the !8ball trigger
Secondly you can use a /load /unload feature in a seperate script
thirdly you can use a group enabler and disabler
where if !8ball == true then play, elseif false then stop
there should be a on text command in the script that executes everything its hard to know without seeing it but add this where you see the !8ball trigger
if ($2 == on && $nick isop $chan) { %8ball.status = true }
elseif ($2 == off && $nick isop $chan) { %8ball.status = false }
then the whole script should be in the middle of something like this
if (%8ball.status == true) {
whole 8 ball script here excluding the Variables...
}
elseif (%8ball.status == false) {
msg $nick Unfortunently 8Ball script is off.
}
I can't say much more then that since I dont see the script sorry
Here is the script.
on *:TEXT:!8ball*:#:{
/set %8ball $rand(1,6)
if (%8ball == 1) .msg $chan 10No
if (%8ball == 2) .msg $chan 10Yes
if (%8ball == 3) .msg $chan 10Maybe
if (%8ball == 4) .msg $chan 10Of course
if (%8ball == 5) .msg $chan 10Not sure
if (%8ball == 6) /msg $chan 10How should I know?
on *:TEXT:!8ball*:#:{
if ($2 == on && $nick isop $chan) { %8ball.status = true }
elseif ($2 == off && $nick isop $chan) { %8ball.status = false }
if (%8ball.status == true) {
/set %8ball $rand(1,6)
if (%8ball == 1) .msg $chan 10No
if (%8ball == 2) .msg $chan 10Yes
if (%8ball == 3) .msg $chan 10Maybe
if (%8ball == 4) .msg $chan 10Of course
if (%8ball == 5) .msg $chan 10Not sure
if (%8ball == 6) /msg $chan 10How should I know?
}
else { msg $nick Unfortunently 8Ball is off }
}
Okay, I tested out the code. It seems that "!8ball on" and "!8ball off" are the commands. How can I install a message that says "8ball has been turned on" when I type in !8ball on?
Great, that there works. Just one more thing:
[07:45:56] <@Sableye> !8ball enable
[07:45:57] <@[PN]Bot> The 8ball has been enabled again
[07:45:57] <@[PN]Bot> How should I know?
That's what it is above. Is there a way to make it so that when I type in "!8ball enable," it does not use this:
[07:45:57] <@[PN]Bot> How should I know?
I just want it to say "The 8ball has been enabled again," but when someone uses the 8ball, then it gives a response such as "How should I know." I hope this makes sense...
I haven't read everyone's post in here, but, can't you use "/remote off"? I think so there's a way to make only one remote turn off, but, I'm not sure, haven't looked too deep into that.
just needed a "return" which actls like a "soft halt"
also you had some / in the code which I removed/replaced
on *:TEXT:!8ball*:#:{
if ($2 == on && $nick isop $chan) { set %8ball.status true | msg $chan 8Ball now active | return }
elseif ($2 == off && $nick isop $chan) { unset %8ball.status | msg $chan 8Ball now off | return }
if (%8ball.status) {
set %8ball $r(1,6)
if (%8ball == 1) .msg $chan 10No
if (%8ball == 2) .msg $chan 10Yes
if (%8ball == 3) .msg $chan 10Maybe
if (%8ball == 4) .msg $chan 10Of course
if (%8ball == 5) .msg $chan 10Not sure
if (%8ball == 6) .msg $chan 10How should I know?
}
else { notice $nick Unfortunently 8Ball is off }
}
instead of the returns he could simply change the 3rd conditional to
elseif (%8ball.status) {
good, and I changed the $2 to $2- in the conditional so you could use on or off as the first word in the question without it stopping the bot.
on ^*:TEXT:!8ball*:#:{
haltdef
if ($2- == on && $nick isop $chan) { set %8ball.status true | msg $chan 8Ball now active }
elseif ($2- == off && $nick isop $chan) { unset %8ball.status | msg $chan 8Ball now off }
elseif (%8ball.status) {
set %8ball $r(1,9)
if (%8ball == 1) .msg $chan 10No
if (%8ball == 2) .msg $chan 10Yes
if (%8ball == 3) .msg $chan 10Maybe
if (%8ball == 4) .msg $chan 10Of course
if (%8ball == 5) .msg $chan 10Not sure
if (%8ball == 6) .msg $chan 10How should I know?
if (%8ball == 7) .msg $chan 10Ask again later.
if (%8ball == 8) .msg $chan 10Message garbled, no answer available.
if (%8ball == 9) .msg $chan 10Never on $day $+ s.
}
else { notice $nick Unfortunently 8Ball is off }
}
Thank you. That worked out perfectly. Now how would I do it with this one? I tried doing the same thing with the 8ball script, but this script seems to be a bit more complicated.
on 1:TEXT:!catch:#: msg $chan $nick caught a $read(pokemon.txt)
You basically use !catch, and it reads off a text file.
Thanks. The only problem is that whenever I type in !catch, it says that the pokemon catch is off. It seems that it only works if you type in !catch on.
use the same format that the 8ball used
on ^*:text:!catch*:#:{
haltdef
if ($2- == on && $nick isop $chan) { set %pokemon true | msg $chan pokemon now active }
elseif ($2- == off && $nick isop $chan) { unset %pokemon | msg $chan Pokemon now off }
elseif (%pokemon) {
.msg $chan $nick caught a $read(pokemon.txt)
}
else .msg $chan Sorry Pokemon catch is off
}