| View previous topic :: View next topic |
| Author |
Message |
monie089 Halfop
Joined: 29 Jul 2006 Posts: 76
|
Posted: Fri Aug 11, 2006 1:02 pm Post subject: help with my custom 8ball |
|
|
| Code: |
######################################################
#coded by monie @ moniestcl.awardspace.com #
#server :Friendcodes irc.friendcodes.info #
#Channels #NintendoXG,#Ircsupport,#eggdrop|windrop #
#simple 8ball script 1.0 #
#for more of my scripts check out my site #
######################################################
bind pub -|- !8ball pub:8ball
proc pub:8ball {nick hand channel args } {
global reply
putquick "PRIVMSG $channel :[lindex $reply [rand [llength $reply]]]"
}
#sets the response for the 8ball answer
set reply {
"\"Try asking when you get smater.\""
"\"Absolutely yes!\""
"\"Answer hazy."
"\"Prospect looks bleak.\""
"\"No."
"\"That's a question you should ask yourself.\""
"\"Prospect looks hopeful.\""
"\"I like to think so.\""
"\"Not even on a GOOD day.\""
"\"It would take a disturbed person to even ask.\""
"\"Maybe -- give me more money and ask again.\""
"\"Yes, yes, yes, and yes again.\""
"\"You wish.\""
"\"Not bloody likely.\""
"\"I'm busy.\""
"\"Concentrate and ask again.\""
"\"Most likely.\""
"\"I wouldn't know anything about that.\""
"\"No way.\""
"\"All signs point to yes.\""
"\"Never.\""
"\":\""
}
putlog "simple 8ball script 1.0 by monie loaded..."
|
it doesnt respond to the channel |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Aug 11, 2006 1:38 pm Post subject: |
|
|
First off, I'd suggest you build your list using the "list" command
ie:
| Code: |
set reply [list "line 1" "line 2" ...]
|
Secondly, the proc head is incorrect...
Public bind calls the proc with the following arguments: nick host handle channel text. In your case you've forgotten host. However, you do use the special variable "args", which can hold 1 more more arguments, so you won't get a tcl-error.. instead, you send the reply to the hostmask of the caller, which in most cases, is'nt a valid nick or channel...
simple fix:
| Code: |
proc pub:8ball {nick host hand chan text} {
...
|
Also, avoid using "args" whenever possible, as it requires some special attention... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
monie089 Halfop
Joined: 29 Jul 2006 Posts: 76
|
Posted: Fri Aug 11, 2006 1:57 pm Post subject: |
|
|
| thanks it worked i just wanted to make a simpler 8ball script |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|