| View previous topic :: View next topic |
| Author |
Message |
SCHADOWFOX Guest
|
Posted: Wed Mar 31, 2004 10:50 am Post subject: read file and foreach line bind trigger |
|
|
Hello
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
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 |
|
 |
|
|
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
|
|