| View previous topic :: View next topic |
| Author |
Message |
BhasIRC Voice
Joined: 02 Jan 2010 Posts: 27 Location: south africa
|
Posted: Sat Feb 06, 2010 7:47 am Post subject: hi guys why wont this work |
|
|
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 |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Sat Feb 06, 2010 8:10 am Post subject: |
|
|
| Code: | bind pub - !fact pub:RandomFact
proc RandomFact {nick uhost hand chan args} { |
you might even spot it yourself  _________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
BhasIRC Voice
Joined: 02 Jan 2010 Posts: 27 Location: south africa
|
Posted: Sat Feb 06, 2010 8:16 am Post subject: |
|
|
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 |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Fri Feb 12, 2010 10:35 am Post subject: |
|
|
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 |
|
 |
BhasIRC Voice
Joined: 02 Jan 2010 Posts: 27 Location: south africa
|
Posted: Sun Feb 14, 2010 3:21 am Post subject: |
|
|
| thanks alot works 100% |
|
| Back to top |
|
 |
|