Hello! If I want to display everything of a textfile in a channel I use this script. proc foo {nick uhost hand chan arg} { set fd [open $::foofile r] while {![eof $fd]} { putquick "PRIVMSG $chan :[gets $fd]" } close $fd } The output looks like this: (@Bot) bla (@Bot) blabla (@Bot) blablabl...
Hello!
I wonder if it is possible to delete a textfile with an eggdrop. With "catch {close [open $fname w]}" you can create a file. Is there a possibility to delete it with another command?
Now it should work. I deleted some mistakes. set gamefile "scripts/game.txt" if {![file exists $gamefile]} { catch {close [open $gamefile w]} } bind pub - !add pub:add proc pub:add {nick uhost hand chan arg} { set game [lindex [split $arg] 0] set code [lindex [split $arg] 1] if {$game != &...
Hello! If I use the command "lsearch" to look for the word "test" in a textfile, there is a difference between test and Test. But I want that they are equal. Unfortunately the function -nocase is only available from TCL 8.5. As I am using a windrop, compiling is not that easy. So...
That sould do it I hope: set gamefile "scripts/game.txt" if {![file exists $gamefile]} { catch {close [open $gamefile w]} } bind pub - !add pub:add proc pub:add {nick uhost hand chan arg} { set game [lindex [split $arg] 0] set code [lindex [split $arg] 1] if {$game != "" &&am...
I have shortened the script above a little bit
So its not the $nick directly who says !afk. The bot who is $nick reproduces everything from a game, so there are people in the game who type !afk. So its [lindex [split $arg] 0] who says !afk.