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.

repeat in seconds

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

repeat in seconds

Post by collett9 »

I'm trying to make a script that will repeat a certain text in a specific number of seconds (on a specified command)

set channel "#mychannel"

bind pub - .repeatgo cmd:repeatgo

proc cmd:repeatgo {nick host handle chan text} {
foreach channel $channel {

<here is where I'm lost>

}
}


Thanks in advanced.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

set channel "#mychannel" 

bind pub - .repeatgo cmd:repeatgo 

proc cmd:repeatgo {nick host handle chan text} {
#you have to make a global call to $channel
  global channel
#Why do you do a loop when you only have one channel?
#also.. here you overwrite the previous global channel, change the first var
  foreach c $channel { 
#output the text you want
    puthelp "PRIVMSG $c :....the text you want here..."
  } 
#and here you just add a utimer
  utimer 30 [list cmd:repeatgo $nick $host $handle $chan $text]
} 
Elen sila lúmenn' omentielvo
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

So what happens if a user types ".repeatgo" 100 times immediately after each other?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

alot ;)
Elen sila lúmenn' omentielvo
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

hehe :o :wink:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

egghead wrote:So what happens if a user types ".repeatgo" 100 times immediately after each other?
Then that user gets "Excess flood", along with the bot... heh. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked