| View previous topic :: View next topic |
| Author |
Message |
stalix Voice
Joined: 13 Sep 2005 Posts: 23
|
Posted: Tue Sep 13, 2005 6:09 pm Post subject: script request |
|
|
i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks =  |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Sep 13, 2005 6:12 pm Post subject: |
|
|
/me waits for translation from Alchera or Sir_Fz  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 13, 2005 6:49 pm Post subject: Re: script request |
|
|
| 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
stalix Voice
Joined: 13 Sep 2005 Posts: 23
|
Posted: Tue Sep 13, 2005 6:50 pm Post subject: |
|
|
example put in channel
<stalix> hello
and the eggdrop with "hello"respond with aleatory phrase in database.ç
sorry my english  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 13, 2005 7:05 pm Post subject: |
|
|
Here's an example
| Code: | 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
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
stalix Voice
Joined: 13 Sep 2005 Posts: 23
|
Posted: Tue Sep 13, 2005 7:28 pm Post subject: |
|
|
[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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 13, 2005 7:43 pm Post subject: |
|
|
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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
stalix Voice
Joined: 13 Sep 2005 Posts: 23
|
Posted: Tue Sep 13, 2005 7:49 pm Post subject: |
|
|
but i can for example one word more
here for example
bind pub - hello bye aleatory |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 13, 2005 8:19 pm Post subject: |
|
|
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: | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Sep 13, 2005 9:24 pm Post subject: Re: script request |
|
|
| 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 |
|
| Back to top |
|
 |
|