|
Joined: May 2006
Posts: 87
Babel fish
|
OP
Babel fish
Joined: May 2006
Posts: 87 |
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?
|
|
|
|
Joined: Jan 2003
Posts: 1,063
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 1,063 |
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
If it ain't broken, don't fix it!
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
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
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: May 2006
Posts: 87
Babel fish
|
OP
Babel fish
Joined: May 2006
Posts: 87 |
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?
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
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 } }
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: May 2006
Posts: 87
Babel fish
|
OP
Babel fish
Joined: May 2006
Posts: 87 |
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?
|
|
|
|
Joined: Oct 2005
Posts: 91
Babel fish
|
Babel fish
Joined: Oct 2005
Posts: 91 |
change this line if ($2 == on && $nick isop $chan) { %8ball.status = true [color:red]| msg $chan 8Ball now active [/color] }
|
|
|
|
Joined: May 2006
Posts: 87
Babel fish
|
OP
Babel fish
Joined: May 2006
Posts: 87 |
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...
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 400 |
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.
-Kurdish_Assass1n
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
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 }
}
|
|
|
|
Joined: Jul 2004
Posts: 31
Ameglian cow
|
Ameglian cow
Joined: Jul 2004
Posts: 31 |
instead of the returns he could simply change the 3rd conditional to elseif (%8ball.status) {
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
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 }
}
|
|
|
|
Joined: May 2006
Posts: 87
Babel fish
|
OP
Babel fish
Joined: May 2006
Posts: 87 |
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.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on *:text:!catch*:#:{
if ($nick isop $chan) {
set %pokemon $iif($2 == on,$true,$iif($2 == off,$false))
}
if %pokemon {
.msg $chan $nick caught a $read(pokemon.txt)
}
else .msg $chan Sorry Pokemon catch is off
}
|
|
|
|
Joined: May 2006
Posts: 87
Babel fish
|
OP
Babel fish
Joined: May 2006
Posts: 87 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
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
}
|
|
|
|
|