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.

timer problem

Old posts that have not been replied to for several years.
Locked
m
mg123
Voice
Posts: 4
Joined: Sun May 08, 2005 5:43 pm

timer problem

Post by mg123 »

I want my bot to send a msg to the channel ever x minutes, and I need a way to change the message or the time intervals in irc rather than through the code. is there a way to do this?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

the only way you can change the interval is via the TCL code. however you can use a var which can be dynimatically modified for the interval length.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
m
mg123
Voice
Posts: 4
Joined: Sun May 08, 2005 5:43 pm

Post by mg123 »

is it possible to make it so i can change the message via irc like a command
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

De Kus wrote:however you can use a var which can be dynimatically modified for the interval length.
to repeat it: yes! (the command just needs to alter the var I was talking about)
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
m
mg123
Voice
Posts: 4
Joined: Sun May 08, 2005 5:43 pm

Post by mg123 »

Code: Select all

############################
#### ADV on Timer v.4  #####
# Whats new on v0.4 ?  ############
# -Added on multiple text message!#
# Whats new on v0.3 ?             #######################################
# -Added on multiple channel advertisment				#
#########################################################################
# Credits:								#
# Mainly to Egghelp.Org helpers on behalf helping solving out errors    #
# Errors/comments/suggestions do please email me: boojingyou@hotmail.com#             
# Do visit my personnal webby @ http://singnet.per.sg                   #
# For users who wanna chat with me, do loginto irc.GalaxyNet.Org        #
# #JingYou . My Nickname would be JingYou.       --Have fun--           #
################################################################################
# COLORS / BOLD								       #
# To make a text bold do this: \002TEXT-BOLD\002			       #
# To make a text with colors do this: \00304TEXT-RED\003 (04 = red, e.g.)      #
# To make a text with colors and bold do this: \002\00304TEXT-RED-BOLD\003\002 #
# Alternative, hit ctrl+k in IRC and copy paste in to dialog box. (RECOMMENDED)#
################################################################################

##### GENERAL SETTINGS ####
# EDIT the channel names or REMOVE one or two depending on which channel you intend the bot the advertise
set channel "#oh.heck"

# Edit the time cycle which is in minutes format depending on the time intervals you want the bot to flow out the advertisment
set time 1

# EDIT the text or REMOVE or ADD lines including inverted commas at the starting and ending at each line 
set text {
"No message."
}

proc pub_time {nick uhost hand chan rest} {
    set time {
    $arg
    }
    putquick "NOTICE $nick :Set interval to $time minutes"
    return 0
   }

bind pub o -mtime pub_time

proc pub_mmessage {nick uhost hand chan arg} {
    set text "$arg"
    putquick "NOTICE $nick :Set message to - $arg"
    return 0
   }

bind pub o -mmessage pub_mmessage

proc pub_mchannels {nick uhost hand chan rest} {
	set channel [lrange $rest 1 end]
	putquick "NOTICE $nick :Set channels to message to $channel"
	return 0
}

bind pub o -mchannels pub_mchannels


proc pub_rehash {nick uhost hand chan rest} {
    rehash
    putquick "notice $nick :Rehashing."
    return 0
   }

bind pub o -rehash pub_rehash

proc pub_debug {nick uhost hand chan rest} {
	putquick "MSG $chan :Text $text"
	putquick "MSG $chan :Time $time minutes"
	putquick "MSG $chan :Channels $channel"
	return 0
	}
bind pub o  -debug pub_debug

proc pub_die {nick uhost hand chan rest} {
		if {[llength $text] > 1} {
			set reason [lrange $text 1 end]
		} else {
			    set reason "Die command recieved from $nick"
		}
    
   die $reason
    return 0
   }

bind pub m .die pub_die
bind msg m die pub_die


##### DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING #####

if {[info exists channel] == 1} {
if {[info exists text] == 1} {
if {[info exists time] == 1} {

if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }

proc go {} {
global channel time text timer
foreach chan $channel {
foreach line $text { putquick "PRIVMSG $chan :$line" }
}
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }
}

}
}
}

putlog "\002Loaded Auto-ADV script by JingYou @ Galaxynet #JingYou (v.4 13nov03)\002"


what is wrong with this? its not working
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Do you see any errors in partyline ? that's what you need to tell us, not just ask what's wrong.

Anyway, I noticed an error at first after quickly looking through the code.

Code: Select all

proc pub_time {nick uhost hand chan rest} { 
    set time { 
    $arg 
    } 
    putquick "NOTICE $nick :Set interval to $time minutes" 
    return 0 
   }
there's no variable called arg in this proc, so I guess they mean $rest instead of $arg.
m
mg123
Voice
Posts: 4
Joined: Sun May 08, 2005 5:43 pm

Post by mg123 »

the variables arent changing no matter what i do
Locked