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.

say script

Old posts that have not been replied to for several years.
Locked
B
Bytez
Op
Posts: 168
Joined: Mon Aug 11, 2003 1:42 pm

say script

Post by Bytez »

Hi, I want my bot to say a message to the bot every x seconds. Which script will do that? I tried a search but to no avail. Don't need a DCC command, just a basic script that repeats text on a specified channel. thanks.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

## interval between each message in seconds
set intsecs "60"
## message to send
set chanmsg "your message"

timer $intsecs [list message:tochan]

proc message:tochan {} {
foreach chan [channels] {
 putserv "PRIVMSG $chan :$::chanmsg"
 }
timer $::intsecs [list message:tochan]
}
B
Bytez
Op
Posts: 168
Joined: Mon Aug 11, 2003 1:42 pm

Post by Bytez »

Code: Select all

## interval between each message in seconds
set intsecs "2700"
## message to send
set chanmsg "\00304,12If you are receiving spam from other people in private message, ignore them\003."

timer $intsecs [list message:tochan]

proc message:tochan {} {
foreach chan [channels] {
 putserv "PRIVMSG $chan :$::chanmsg"
 }
timer $::intsecs [list message:tochan]
}
the bot says the message but the bot will say it to the channel at random intervals, 3 minutes, 6 miinutes, it totally ignores the interval I set at the top. I only had the script up for an hour or so.
User avatar
BarkerJr
Op
Posts: 104
Joined: Sun Mar 30, 2003 1:25 am
Contact:

Post by BarkerJr »

I think you have two issues:

1) You're using timer, rather than utimer.

2) You're rehashing rather than restarting.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

yes, sorry my bad.

you must put the timer in minutes, unless you want it to be in seconds then change timer to utimer.
B
Bytez
Op
Posts: 168
Joined: Mon Aug 11, 2003 1:42 pm

Post by Bytez »

I changed timer to utime, restarted the bot, it still says stuff to the channel at different times, I put 2700 seconds but the bot says stuff in 24 minutes, 21 minutes. The first time, it says in 45 minutes but afterwards, it ignores the 2700 I set in the file. :roll:
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

## interval between each message in minutes 
set intsecs "45" 
## message to send 
set chanmsg "your message" 

timer $intsecs [list message:tochan] 

proc message:tochan {} { 
foreach chan [channels] { 
 putserv "PRIVMSG $chan :$::chanmsg" 
 } 
timer $::intsecs [list message:tochan] 
}
although the utimer should work fine, but try this.
Locked