mIRC Home    About    Download    Register    News    Help

Print Thread
#151653 20/06/06 05:19 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
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?

#151654 20/06/06 05:32 AM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
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!
#151655 20/06/06 05:36 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#151656 20/06/06 05:50 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
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?

#151657 20/06/06 06:00 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
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 }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#151658 20/06/06 06:11 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
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?

#151659 20/06/06 06:52 AM
Joined: Oct 2005
Posts: 91
T
Babel fish
Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
change this line
Code:
if ($2 == on && $nick isop $chan) { %8ball.status = true [color:red]| msg $chan 8Ball now active [/color] }

#151660 20/06/06 12:50 PM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
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...

#151661 20/06/06 05:20 PM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
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
#151662 20/06/06 05:28 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
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

Code:
on *:TEXT:!8ball*:#:{
  if ($2 == on &amp;&amp; $nick isop $chan) { set %8ball.status true | msg $chan 8Ball now active | return }
  elseif ($2 == off &amp;&amp; $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 }
}

#151663 20/06/06 05:34 PM
Joined: Jul 2004
Posts: 31
H
Ameglian cow
Offline
Ameglian cow
H
Joined: Jul 2004
Posts: 31
instead of the returns he could simply change the 3rd conditional to
elseif (%8ball.status) {

#151664 20/06/06 05:51 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
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.

Code:
on ^*:TEXT:!8ball*:#:{
  haltdef
  if ($2- == on &amp;&amp; $nick isop $chan) { set %8ball.status true | msg $chan 8Ball now active }
  elseif ($2- == off &amp;&amp; $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 }
}

#151665 22/06/06 01:51 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
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.

#151666 22/06/06 02:42 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
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
}
  

#151667 22/06/06 03:41 AM
Joined: May 2006
Posts: 87
S
Babel fish
OP Offline
Babel fish
S
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.

#151668 22/06/06 04:46 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
use the same format that the 8ball used
Code:
on ^*:text:!catch*:#:{
  haltdef
  if ($2- == on &amp;&amp; $nick isop $chan) { set %pokemon true | msg $chan pokemon now active }
  elseif ($2- == off &amp;&amp; $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
}


Link Copied to Clipboard