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.

idle time check

Old posts that have not been replied to for several years.
Locked
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

idle time check

Post by difoo »

hi, how can i let the bot say something to the channel when a user talks after he was a specific amount of time idling? lets say 10 hrs?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

check 'getchanidle' (returns the number of minutes they've been idle) every time someone says something.
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Post by difoo »

i tried numerous scripts but all they do is do something after someone reached a specific amount of idle.

i need a script that says something into the channel when a user says something after he was a specific amount of time idleing in the channel.

difoo
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Your initial post suggested you were going to code it yourself...why didn't you say you want somebody to do the job for you in the first place? Enjoy wasting people's time?
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Post by difoo »

im sorry i didnt just ask in the first place. and yes i need someone to help me doing this. the idle scripts that are available dont do what i would want.

difoo
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

try this

Post by user »

Code: Select all

bind pubm - * checkIdle
proc checkIdle {n u h c a} {
	# 600 minutes == 10 hours...
	if {[getchanidle $n $c]>600} {
		puthelp "PRIVMSG $c :Welcome back $n!"
	}
}
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Re: try this

Post by difoo »

user wrote:

Code: Select all

bind pubm - * checkIdle
proc checkIdle {n u h c a} {
	# 600 minutes == 10 hours...
	if {[getchanidle $n $c]>600} {
		puthelp "PRIVMSG $c :Welcome back $n!"
	}
}
am i correct that the pubm is for pubm(essage) ?
also can you explain proc checkIdle {n u h c a} { ?

I read nick uhost h=hour? chan args

-difoo
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: try this

Post by user »

difoo wrote:am i correct that the pubm is for pubm(essage) ?
and kool, it works ;-)
yes...and you can include a channel name in the mask if you want to limit it to a particular channel and a flag to only let it be triggered by certain people...eg:

Code: Select all

bind pubm o|o "#yourchan *" checkIdle
would only be triggered by +o users in #yourchan (+o the flag, not the channel mode)
Remember to .restart or unbind the old bind manually if you change it.

the 'h' is 'handle'; {nick uhost handle channel argument}
Last edited by user on Sun Aug 08, 2004 9:34 am, edited 1 time in total.
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Post by difoo »

i understand. yes i know of o|o. if im right o|o stands for o in chan & global. next time i really should read the tcl-commands.tcl. thanks user.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

difoo wrote:i understand. yes i know of o|o. if im right o|o stands for o in chan & global. next time i really should read the tcl-commands.tcl. thanks user.
| means OR, not AND (&)
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Post by difoo »

one last qustion, how would you add 2 other "if" variables to your if statement?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

difoo wrote:one last qustion, how would you add 2 other "if" variables to your if statement?
What do you mean? You want different messages depending on how long they've been idle?

Code: Select all

if {expression1} {
    action 1
} elseif {expression2} {
    action 2
};# etc..
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Post by difoo »

like this: if {[validuser $hand] && [matchattr $hand o|o $chan]} {

& your if statement. I keep getting extra-character errors
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

difoo wrote:& your if statement. I keep getting extra-character errors
"extra characters after close-brace"? you need spaces between words in tcl. Add some spaces and try it again :)
Have you ever read "The Manual"?
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

Post by difoo »

got it now ;-)

thanks to you

difoo
Locked