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 

hi guys why wont this work

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


Joined: 02 Jan 2010
Posts: 27
Location: south africa

PostPosted: Sat Feb 06, 2010 7:47 am    Post subject: hi guys why wont this work Reply with quote

hi.. ok anyways i just dont understand why this code wont work, please will someone help me

Code:
 bind pub - !fact pub:RandomFact


proc RandomFact {nick uhost hand chan args} {
 global factstouse
 set randomfacttouse [lindex $factstouse [rand [llength $factstouse]]]
 puthelp "PRIVMSG $chan :$randomfacttouse"
 return
}

set factstouse {
 "'Dog kennel' is redundant The Latin 'canis' (dog) served as the base for the word 'canile' (dog house) This word entered French as 'kenel', which the English changed to kennel Thus, a kennel couldn't technically be for anything else but dogs"
 "'E' is the most frequently used letter in the English alphabet, 'Q' the least"
 "'Fine turkey' and 'honeycomb' are terms used for different qualities and textures of sponges"
 "'Flushable' toilets were in use in ancient Rome."
}
Back to top
View user's profile Send private message Visit poster's website
Papillon
Owner


Joined: 15 Feb 2002
Posts: 724
Location: *.no

PostPosted: Sat Feb 06, 2010 8:10 am    Post subject: Reply with quote

Code:
 bind pub - !fact pub:RandomFact


proc RandomFact {nick uhost hand chan args} {

you might even spot it yourself Wink
_________________
Elen sila lúmenn' omentielvo
Back to top
View user's profile Send private message MSN Messenger
BhasIRC
Voice


Joined: 02 Jan 2010
Posts: 27
Location: south africa

PostPosted: Sat Feb 06, 2010 8:16 am    Post subject: Reply with quote

i also tried it as
Code:
bind pub - !fact RandomFact


proc RandomFact {nick uhost hand chan args} {
 global factstouse
 set randomfacttouse [lindex $factstouse [rand [llength $factstouse]]]
 puthelp "PRIVMSG $chan :$randomfacttouse"
 return
}

set factstouse {
 "'Dog kennel' is redundant The Latin 'canis' (dog) served as the base for the word 'canile' (dog house) This word entered French as 'kenel', which the English changed to kennel Thus, a kennel couldn't technically be for anything else but dogs"
 "'E' is the most frequently used letter in the English alphabet, 'Q' the least"
 "'Fine turkey' and 'honeycomb' are terms used for different qualities and textures of sponges"
 "'Flushable' toilets were in use in ancient Rome."
Back to top
View user's profile Send private message Visit poster's website
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Fri Feb 12, 2010 10:35 am    Post subject: Reply with quote

I tested the script above and it works fine as is, providing the missing end brace is added to the end of the script (probably just a cut and paste mistake).

Code:

[14:29] <@arfer> !fact
[14:29] <@osmosis> 'E' is the most frequently used letter in the English alphabet, 'Q' the least


As a general rule, you should avoid use of the variable name 'args' in proc definitions unless intended, because it has special meaning.
_________________
I must have had nothing to do
Back to top
View user's profile Send private message
BhasIRC
Voice


Joined: 02 Jan 2010
Posts: 27
Location: south africa

PostPosted: Sun Feb 14, 2010 3:21 am    Post subject: Reply with quote

thanks alot works 100%
Back to top
View user's profile Send private message Visit poster's website
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