egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help with my custom 8ball

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
monie089
Halfop


Joined: 29 Jul 2006
Posts: 76

PostPosted: Fri Aug 11, 2006 1:02 pm    Post subject: help with my custom 8ball Reply with quote

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
View user's profile Send private message Send e-mail
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Aug 11, 2006 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
monie089
Halfop


Joined: 29 Jul 2006
Posts: 76

PostPosted: Fri Aug 11, 2006 1:57 pm    Post subject: Reply with quote

thanks it worked i just wanted to make a simpler 8ball script
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber