This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Tue Sep 13, 2005 6:09 pm
i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks =
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Sep 13, 2005 6:12 pm
/me waits for translation from Alchera or Sir_Fz
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Sep 13, 2005 6:49 pm
stalix wrote: i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks =
Processing...
This may take a few seconds, please stand by...
Error : Question could not be analyzed, please post again with clearer and proper use of language.
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Tue Sep 13, 2005 6:50 pm
example put in channel
<stalix> hello
and the eggdrop with "hello"respond with aleatory phrase in database.ç
sorry my english
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Sep 13, 2005 7:05 pm
Here's an example
Code: Select all
set dbfile "scripts/database.txt"
bind pub - hello aleatory
proc aleatory {nick uhost hand chan arg} {
global dbfile
set r [lindex [set d [split [read [set f [open $dbfile]]] \n]] [rand [llength $d]]]
puthelp "PRIVMSG $chan :hello, $r"
close $f
}
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Tue Sep 13, 2005 7:28 pm
[01:23:22] <@`> hello
[01:23:24] <@NeWs> hello , aaaa
is posible remove this ?
and other thing, is possible add more words, i want someone more dont also hello, understand?
thanks
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Sep 13, 2005 7:43 pm
If you want to remove "hello," then delete it from the script.
I gave you an example, so you should know how to make it reply on other words.
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Tue Sep 13, 2005 7:49 pm
but i can for example one word more
here for example
bind pub - hello bye aleatory
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Sep 13, 2005 8:19 pm
you can't specify more than 1 word using the pub bind. Instead you can use the pubm bind, read Tcl-commands.doc for more info about it.
Example:
Code: Select all
set dbfile "scripts/database.txt"
bind pubm - * aleatory
proc aleatory {nick uhost hand chan arg} {
global dbfile
set r [lindex [set d [split [read [set f [open $dbfile]]] \n]] [rand [llength $d]]]
puthelp "PRIVMSG $chan :$r"
close $f
}
This will reply with a random line from the db file whenever someone talks on a channel.
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Tue Sep 13, 2005 9:24 pm
Sir_Fz wrote: stalix wrote: i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks =
Processing...
This may take a few seconds, please stand by...
Error : Question could not be analyzed, please post again with clearer and proper use of language.
Yoda speak good for us is it.
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM