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.

read file and foreach line bind trigger

Old posts that have not been replied to for several years.
Locked
S
SCHADOWFOX

read file and foreach line bind trigger

Post by SCHADOWFOX »

Hello :D

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
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
Locked