| View previous topic :: View next topic |
| Author |
Message |
AciD Voice
Joined: 28 Nov 2007 Posts: 20
|
Posted: Wed Dec 05, 2007 12:41 pm Post subject: Hi, help me fix this advert script. |
|
|
Hi, i have a script found in somebodys post in the egghelp forum. The code is:
| Code: |
###############################################
# 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  |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu Dec 06, 2007 11:22 am Post subject: |
|
|
| Code: | ###############################################
# 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*... |
|
| Back to top |
|
 |
Sydneybabe Op
Joined: 27 Apr 2007 Posts: 106 Location: Philippines
|
Posted: Sun Dec 28, 2008 6:42 am Post subject: |
|
|
Hi, I use this script and i encounter an error at partyline which the bot doesn't advertise on the channel:
| Quote: | <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" |
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Dec 28, 2008 12:30 pm Post subject: |
|
|
| Code: | 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. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Fri Mar 04, 2011 7:36 am Post subject: |
|
|
| What about making the script to color the advertisements automatically. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Mar 05, 2011 2:52 am Post subject: |
|
|
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?  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Mar 05, 2011 3:23 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|