This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

can someone help with Simple advertise script please please

Support & discussion of released scripts, and announcements of new releases.
Post Reply
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

can someone help with Simple advertise script please please

Post by drfox »

yeah i know im being a pain but you guys are great and im learning alot from this so thanks for that

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"
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

!isin "[strftime %A]" [strftime %A]
whats that supposed to mean? its total nonesense for a boolan expression
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

well i didnt write the script im still learning all new to me
guess thats why it dont work any ideas on how to make it work
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

contact the author, I have no clue what it is supposed to do, the only thing I could do would be removing it, but that would most likely change the intented behavior of that script.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

ok do you know off another one that spills a random line of text from a text file at a given time span say every 2-5 mins
Post Reply