anyway the problem is this
[8:19am]<Fox-Info> [17:24] Tcl error in script for 'timer5':
[8:19am]<Fox-Info> [17:24] syntax error in expression ""[strftime %H%M]" <= "[string map {{:} {}} $second]" || "[st...": variable references require preceding $
Code: Select all
####################################
### Simple advertise script v1.0 ###
### by DeeJay-SpunK ###
### ###
### msn: djs@deejay-spunk.dk ###
### irc: #DeeJay ###
####################################
### ###
### The script is a advertise ###
### script to msg a random ###
### advertisement from a file ###
### into a channel on certain ###
### times with a delay between ###
### the messages. Can be ###
### configured after your needs ###
####################################
### If you want the messages only to be shown in a specific timesquare, then put in the times here (20:00 to 21:00 etc, seperate with spaces)
set adv_time "0:00 23:00"
### Should the bot shut up some days? Write them here (Seperate them with spaces)
set adv_days ""
### The file where the advertise messages is stored in. (FILE MUST EXISTS IN THAT FOLDER! Remember to give write access/chmod 755
set adv_file "/home/doc/eggdrop/scripts/advertise.db"
### Channels the advertise message should go to
set adv_chans "#foxs-lair"
### How long time between the messages (In minutes)
set adv_timer "2"
#################################################
### DONT EDIT BELLOW HERE UNLESS YOU HAVE TO! ###
#################################################
timer $adv_timer adv:do
proc adv:do {} {
global adv_chans adv_timer adv_time
foreach channel $adv_chans { putquick "PRIVMSG $channel :[advmsg]"}
timer $adv_timer adv:do
}
proc advmsg {} {
global adv_file adv_from adv_to
set first "[lindex [split "$adv_time"] 0]"
set second "[lindex [split "$adv_time"] 1]"
if {"[strftime %H%M]" <= "[string map {{:} {}} $second]" || "[strftime %H%M]" >= "[string map {{:} {}} $first]" && !isin "[strftime %A]" [strftime %A]} {
set f [open $adv_file]
set l [split [read $f] \n]
close $f
set n [rand [llength $l]]
if {[set x [lindex $l $n]]!=""} {return "$x"}
}
}
putlog "Advertise script by DeeJay loaded succesfully"