also when i do the command !next i have to put the lnie number is it possible to just do !next without line number so it will read each line seperate this used to work but has been messed up somewere
Code: Select all
[15:49] Tcl error in file 'eggdrop.conf':
[15:49] missing close-brace
while executing
"proc next_proc { nick uhost hand chan arg } {
global out_chan txt_file
set line [lindex [split $arg] 0]
if {$line == ""} {
putserv "PRIVMSG $chan..."
(file "scripts/training.tcl" line 6)
invoked from within
"source scripts/training.tcl"
(file "eggdrop.conf" line 1332)
[15:49] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Code: Select all
set out_chan "#Trainingroom"
set txt_file "Training.txt"
bind pub SA|SA !next next_proc
bind pub SA|SA !back back_proc
proc next_proc { nick uhost hand chan arg } {
global out_chan txt_file
set line [lindex [split $arg] 0]
if {$line == ""} {
putserv "PRIVMSG $chan :Usage: !next <linenumber>"
return
}
set take_me [open $txt_file r]
set take_all [split [read $take_me] "\n"]
close $take_me
}
foreach txt_line $take_all {
if {$txt_line != ""} {
putquick "PRIVMSG $out_chan :$txt_line"
}
}
proc back_proc { nick uhost hand chan arg } {
global out_chan txt_file
set line [lindex [split $arg] 0]
if {$line == ""} {
putserv "PRIVMSG $chan :Usage: !back <line number>"
return
}
set take_me [open $txt_file r]
set take_all [split [read $take_me] "\n"]
close $take_me
set data [lindex $take_all [expr $line - 1]]
putquick "PRIVMSG $out_chan :$data"
}
}