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 

read file and foreach line bind trigger

 
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
SCHADOWFOX
Guest





PostPosted: Wed Mar 31, 2004 10:50 am    Post subject: read file and foreach line bind trigger Reply with quote

Hello Very Happy

I need help with a little script I am trying to write

currently it reads a file (format: index content) and binds foreach index a trigger like !index and now i am trying to bring out the stuff saved in content

like

Me: !test
Bot: content of test

the problem is i don't know how to do that Sad

i can bind it but it wont give me the output

current script

Quote:

bind pub m|m !ctrigs create:triggers

proc create:triggers {nich uhost hand chan arg} {
global eglrn

set chid [open $eglrn(dbfile) r+]
while {![eof $chid]} {
set line [gets $chid]
set first [lindex [split $line] 0]
set second [lrange [split $line] 1 end]
if {$first != ""} {
dccbroadcast "debug: creating trigger for => $first"
bind pub - !$first getInfo:$first

set content($first) $second
proc getInfo:$first {nich uhost hand chan arg} {
puthelp "PRIVMSG $chan : {$line}"
}
dccbroadcast "debug: trigger for => $first ... added"
}
}
close $chid
}


thx 4 your help
Back to top
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