Code: Select all
proc msg:calculate {nick host hand arg} {
global botnick opchan
set fname "remember.txt"
set fp [open $fname "r"]
set data [read -nonewline $fp]
close $fp
set lines [split $data "\n"]
set linetodelete 0
set lines [lreplace $lines $linetodelete $linetodelete]
set fp [open $fp "w"]
puts $fp [join $lines "\n"]
close $fp
putserv "PRIVMSG Fujin :Done."
}
To remove a line from a txt file.