I have a problem with a timer command.
when I call utimer as a loop it whines to me about missing arguments.
here is the script:
here is what happens if I try it..
proc txt1 {nick host hand chan arg} {
global basechan handle interval
if {$chan != $basechan} {
return 0
}
if {[file exists /home/acio/eggdrop/text/txt1.txt]} {
set o_fid [open "/home/acio/eggdrop/text/txt1.txt" "RDONLY"]
gets $o_fid txt1msg
close $o_fid
set channelzahl 0
foreach c [channels] {
if {[strlwr $c] != [strlwr $basechan]} {
incr channelzahl
}
}
if {[string match "*NICK*" $txt1msg]} {
set txt1msg [varrep $txt1msg "NICK" $nick]
}
putserv "PRIVMSG $chan :\[$handle-announcer\] txt1 broadcast msg: $txt1msg"
putserv "PRIVMSG $chan :\[$handle-announcer\] is beeing send to $channelzahl channels with an interval of $interval seconds! Watch chanlist with !showchans."
set i 0
foreach c [channels] {
if {[strlwr $c] != [strlwr $basechan]} {
utimer $interval [list puthelp "PRIVMSG $c :$txt1msg"]
incr i }
}
} else {
putserv "PRIVMSG $chan :\[$handle-announcer\] Error: File not found / no message set"
}
utimer 30 txt1}
[03:08] Tcl error in script for 'timer2':
[03:08] wrong # args: should be "txt1 nick host hand chan arg"
I've tried pretty much everything. when I add txt1 to the list it just tells me to add another one..
on a sidenote the rest works fine. I just want it to recurr every X minutes (yes I know that utimer does seconds, it's just for testing purposes)
does anyone have an idea?
cous i'm lost :/
Tried looking online for over 5 hours..haha..
Thanks in advance!