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.

script request

Old posts that have not been replied to for several years.
Locked
s
stalix
Voice
Posts: 23
Joined: Tue Sep 13, 2005 6:06 pm

script request

Post by stalix »

i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks = :lol:
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

/me waits for translation from Alchera or Sir_Fz ;)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: script request

Post by Sir_Fz »

stalix wrote:i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks = :lol:
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.
s
stalix
Voice
Posts: 23
Joined: Tue Sep 13, 2005 6:06 pm

Post by stalix »

example put in channel

<stalix> hello

and the eggdrop with "hello"respond with aleatory phrase in database.ç


sorry my english :roll:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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
}
s
stalix
Voice
Posts: 23
Joined: Tue Sep 13, 2005 6:06 pm

Post by stalix »

[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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
s
stalix
Voice
Posts: 23
Joined: Tue Sep 13, 2005 6:06 pm

Post by stalix »

but i can for example one word more
here for example


bind pub - hello bye aleatory
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Re: script request

Post by Alchera »

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 = :lol:
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
Locked