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 

script request

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Tue Sep 13, 2005 6:09 pm    Post subject: script request Reply with quote

i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks = Laughing
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Sep 13, 2005 6:12 pm    Post subject: Reply with quote

/me waits for translation from Alchera or Sir_Fz Wink
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 13, 2005 6:49 pm    Post subject: Re: script request Reply with quote

stalix wrote:
i can if is possible a tcl for when put channel "xxx" get in database aleatory phrase, is possible thanks = Laughing

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
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Tue Sep 13, 2005 6:50 pm    Post subject: Reply with quote

example put in channel

<stalix> hello

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


sorry my english Rolling Eyes
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 13, 2005 7:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Tue Sep 13, 2005 7:28 pm    Post subject: Reply with quote

[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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 13, 2005 7:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Tue Sep 13, 2005 7:49 pm    Post subject: Reply with quote

but i can for example one word more
here for example


bind pub - hello bye aleatory
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 13, 2005 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Sep 13, 2005 9:24 pm    Post subject: Re: script request Reply with quote

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 = Laughing

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. Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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