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.

sponsor advert tcl script

Old posts that have not been replied to for several years.
Locked
c
collett9
Voice
Posts: 11
Joined: Mon Dec 15, 2003 11:38 pm

sponsor advert tcl script

Post by collett9 »

I want to make a script for advertising our sponsors's "messages" every hour or so, but a different message each time (random), how do I do this?

thanks
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

set adchan "#shells"
set ads { "ad 1"
              "ad 2"
              "so forth"
              "so on"
           }
bind time - "00 *" time:ad
proc time:ad { mi h d m y } {
  global adchan ads
  puthelp "PRIVMSG $adchan :[lindex $ads [rand [llength $ads]]]"
  return
}
photon?
c
collett9
Voice
Posts: 11
Joined: Mon Dec 15, 2003 11:38 pm

Post by collett9 »

Code: Select all

set adchan "#shells" 
I want it to /amsg it, so just seperate the channel with ","'s ?

also, did your script include the time? (I am really new to this), if it didn't, I'd like it to spam every hour at like :25 after

thanks
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

set ads { "ad 1" 
              "ad 2" 
              "so forth" 
              "so on" 
           } 
bind time - "25 *" time:ad 
proc time:ad { mi h d m y } {
  foreach adchan [channels] {
    puthelp "PRIVMSG $adchan :[lindex $::ads [rand [llength $::ads]]]"
  } 
  return 
} 
if you want the same ad msg'd to all channels;

Code: Select all

proc time:ad { mi h d m y } {
  set currentad "[lindex $::ads [rand [llength $::ads]]]"
  foreach adchan [channels] {
    puthelp "PRIVMSG $adchan :$currentad"
  } 
  return 
}
 
edit: fixed broken [censored]
photon?
c
collett9
Voice
Posts: 11
Joined: Mon Dec 15, 2003 11:38 pm

Post by collett9 »

so.. if I understand you correctly

for example below

Code: Select all

set adchan "#teamefn"
set ads { "WiredLabs" 
              "WiredServers" 
              "Olternit" 
              "iDesigns" 
           } 
bind time - "25 *" time:ad 
proc time:ad { mi h d m y } { 
  set currentad "[lindex $::ads [rand [llength $::ads]]]" 
  foreach adchan [channels] { 
    puthelp "PRIVMSG $adchan :$currentad" 
  } 
  return 
} 
^ That will advertise the 4 in the list at random (or in order, doesn't matter, as long as it's a new one every time) at :25 past the hour, every hour, in all channels
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

set currentad "[lindex $::ads [rand [llength $::ads]]]"
this returns a random message from $ads, so probably each time it'll be a different message.
Locked