Yes, I know it's tricky. But I tried and I can't find the trick! What do I do to be able to refer to a file using an absolute path in Tcl used by Windrop? Please help D:
I tend to use the 'file join' command to add whatever separator is appropriate for the operating environment. This would work irrespective of the bot being an Eggdrop on a Linux shell or a Windrop on your Windows based PC.
For example you could enquire if the directory c:\windows and/or d:\windows exists using the following Tcl via the windrops partyline (providing of course partyline .tcl commands are activated on in the bot's .conf file) :-
[13:41] <arfer> .tcl set x [file isdirectory [file join c: windows]]
[13:41] <osmosis> Tcl: 1
[13:55] <arfer> .tcl set x [file isdirectory [file join d: windows]]
[13:55] <osmosis> Tcl: 0
If I was opening a file for reading with a path relative to the bots root directory, I could use something like the following for example :-
set id [open [file join scripts data whatever.txt] r]