as a sidenote, could i also change set file to set variablefile and then use $variablefile (or something like that) just to really make sure that i am not obstructing any other vars or soCosmicD wrote:wow,
when i created the file in the eggdrop root it started saving data.. thats cool
now I actually hope it'll also load this data on startup,
i created a sepparate tcl for this procedure you gave me...
UPDATE:
ok now it saves and loads all, thanks for your patience and help, i just need to do something and that is, to unify the way you set the file and you load the userfile on that last line
so i have the script you provided in a sepparate tcl:
Well, shouldnt that last file now be:Code: Select all
# saving your "topicinfo" array to "your.file" bind evnt - save yourSave bind evnt - prerehash yourSave proc yourSave args { global topicinfo set file "mybot.public" if {[info exists topicinfo]} { if {[file writable $file]} { saveArray topicinfo $file putlog "Saving extra variables..." } else { putlog "can't write $file" } } else { putlog "no array? :/" } } proc saveArray {array file {mode w}} { if {![file writable $file]} return upvar 1 $array Array set data [array get Array] set f [open $file $mode] puts $f $data close $f } proc loadArray {array file} { if {![file readable $file]} return upvar 1 $array Array array set Array {} set f [open $file] set data [read -nonewline $f] close $f array set Array $data } loadArray topicinfo mybot.public
Code: Select all
loadArray topicinfo $file