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.

Hi, help me fix this advert script.

Support & discussion of released scripts, and announcements of new releases.
Post Reply
A
AciD
Voice
Posts: 20
Joined: Wed Nov 28, 2007 8:44 pm

Hi, help me fix this advert script.

Post by AciD »

Hi, i have a script found in somebodys post in the egghelp forum. The code is:

Code: Select all

###############################################
# iNgADvert.tcl by iNgLiSh                    #
# -adapted from newaidle.tcl by Felipe Tonioli#
# BE SURE TO EDIT WITH PICO or other linux    #
# editor, or else it will all get messed up!  #
# ie. in shell commandline: pico ingadvert.tcl#
# and then ctrl+x to save and close.          #
# Enjoy!!!          -iNgLiSh                  #
###############################################

# How often should it spit out ad:(in minutes ie. set ad-at 5 
# would make it advertise every 5 min) :
set ad-at- 10
set vers "v o.1"
# Chan to advertise in:
set chan "#grigai"

###########Edit add ads inside "\002 HERE \002"############
 set adtext {

     "0,1 Puslapis:4 http://grigai.lt "
     "0,1 Forumas:4 http://forum.grigai.lt "
     "0,1 Banu Sarasas:4 http://bans.grigai.lt "
     "0,1 Statistika:4 http://stats.grigai.lt "
      }

#######DO NOT EDIT BELOW THESE LINES#######

	set notnick "$botnick" 
	set notnick [string tolower ${nick}]
	if {![info exists {ald}]} {
  	global notnick chan ad-at- adtext
  	set ald 1
  	timer ${ad-at-} printing
	}

	proc printing {} {
  	global notnick chan ad-at- adtext
  	set printochan [lindex $adtext [rand [llength $adtext]]]
      putserv "PRIVMSG $chan : $printochan"
  	timer ${ad-at-} printing
	}
But wtf? i get the random message in 10 min, but in the wrong channel. I need the channel to be #grigai, but i get ir #kz or #mercenaries... Help fix this pls :(
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Code: Select all

############################################### 
# iNgADvert.tcl by iNgLiSh                    # 
# -adapted from newaidle.tcl by Felipe Tonioli# 
# BE SURE TO EDIT WITH PICO or other linux    # 
# editor, or else it will all get messed up!  # 
# ie. in shell commandline: pico ingadvert.tcl# 
# and then ctrl+x to save and close.          # 
# Enjoy!!!          -iNgLiSh                  # 
############################################### 

# How often should it spit out ad:(in minutes ie. set ad-at 5 
# would make it advertise every 5 min) : 
set ad-at- 10 
set vers "v o.1" 
# Chan to advertise in: 
set chan1 "#grigai" 

###########Edit add ads inside "\002 HERE \002"############ 
 set adtext { 

     "0,1 Puslapis:4 http://grigai.lt " 
     "0,1 Forumas:4 http://forum.grigai.lt " 
     "0,1 Banu Sarasas:4 http://bans.grigai.lt " 
     "0,1 Statistika:4 http://stats.grigai.lt " 
      } 

#######DO NOT EDIT BELOW THESE LINES####### 

   set notnick "$botnick" 
   set notnick [string tolower ${nick}] 
   if {![info exists {ald}]} { 
     global notnick chan1 ad-at- adtext 
     set ald 1 
     timer ${ad-at-} printing 
   } 

   proc printing {} { 
     global notnick chan1 ad-at- adtext 
     set printochan [lindex $adtext [rand [llength $adtext]]] 
      putserv "PRIVMSG $chan1 : $printochan" 
     timer ${ad-at-} printing 
   } 
EDITED: Use it, it should do the trick.
|AmDeAtH @ Undernet
Death is only the *Beginning*...
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hi, I use this script and i encounter an error at partyline which the bot doesn't advertise on the channel:
<Bot> [18:37] Tcl error in script for 'timer576':
<Bot> [18:37] list element in quotes followed by "I" instead of space
<Owner> .set errorInfo
<Bot> [18:37] #Owner# set errorInfo
<Bot> Currently: list element in quotes followed by "I" instead of space
<Bot> Currently: while executing
<Bot> Currently: "llength $adtext"
<Bot> Currently: (procedure "printing" line 3)
<Bot> Currently: invoked from within
<Bot> Currently: "printing"
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

set adtext [list "\00300,01Puslapis:\002\00304 http://grigai.lt\002" \
     "\00300,01Forumas:\002\00304 http://forum.grigai.lt\002" \
     "\00300,01Banu Sarasas:\002\00304 http://bans.grigai.lt\002" \
     "\00300,01Statistika:\002\00304 http://stats.grigai.lt\002"]
The script uses embedded control characters and doesn't quite qualify as a perfect tcl list. The above code does qualify as a perfect tcl list, and also uses escape sequences to generate chars rather than embedding them. Use it in place of the original set adtext.
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Post by Amr »

What about making the script to color the advertisements automatically.
User avatar
spithash
Master
Posts: 248
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

uhm, pardon me but, this topic must be moved in the "Scripting Help" category: http://forum.egghelp.org/viewforum.php?f=2

am I right? :?: :!: :D
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

umm, no, I don't think you are. He has a script made by someone else and he needs a few adjustments, thus moved it here rather than Scripting Help.

Anyway, if you consider a topic should be moved to another category you should contact a moderator about it or go directly to slennox if it's really necessarily.
Once the game is over, the king and the pawn go back in the same box.
Post Reply