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.

Using a command doesn't reset idle

Old posts that have not been replied to for several years.
Locked
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Using a command doesn't reset idle

Post by Quinie »

I have a script that checks the idle time. When a user uses a command like .quote or something this doesn't resets his idle time.

function goes like this
if {[getchanidle $theNick $chan] > 1} {
}

is this normal ? or is this a bug. is there a way around this ?
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

no clue, but why is this even neccesary? The variables set global-idle-kick and set idle-kick do this as it is, no :?:
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

just tested with my eggdrop 1.6.18+notesfix and it resets idle even if the command proc returns 1.

idea: have you any funny script bind to RAW for commands?
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...
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

No funnyscripts. Only my own. i'm running eggdrop v1.6.17. The code above is for a rebuild of the timebomb.tcl. I'm letting people pass the bomb but they can't give it to someone who's idle

if {[getchanidle $theNick $chan] > 1} {
IRCPrivMSG $chan "You can only give the bomb to someone who isn't idle"
return 0
}

full part of the code. Result for this error is on IRC that someone can give you a bomb by using .timebomb Quinie. And you can't give it back because the user is idle.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

use this

Code: Select all

if { [getchanidle $theNick $chan] > 5 && $theNick != $nick} {
      putserv "PRIVMSG $chan :$theNick is Away. Choose another victim!"
      return
}
Change number to however many minutes you require.

I too added a lot of stuff to the timebomb script for my Server including cant be bombed if idle for more than 5 minutes, a kick counter and random bomb messages.

Hope this helps.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

well the problem isn't the function I think. The problem is with starting the timebomb

[8:00pm] [ @Quinie] timebomb noname
[8:00pm] [a] legna: stuffs the bomb into noname's pants. The display reads [47] seconds. [a]
[8:00pm] [@legna] Diffuse the bomb by cutting the correct wire. There is one wire. It is Lavender.
[8:00pm] [Noname] passbomb Quinie
[8:00pm] [@legna] You can only give the bomb to someone who isn't idle

in this example I used the timebomb after being away for 2 minutes.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

This thread should be in the TCL section.

I see you have modified it to pass the bomb from person to person. how are you storing who now has the bomb and how does the detonate proc know who has it? Are you getting any errors on the partyline?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

sorry for posting in the wrong forum

i use global vars to store the users.
These vars are call on the first line of the function

Code: Select all

global db gTimebombTarget botnick bombispassed gTimebombActive gTimebombGavebomb changeofdrop bombstatsstable gAtoombombActive
target was a existing var. I just added gavebomb. So who now has the bomb was allready in the script. After passing i update those vars

Code: Select all

set gTimebombTarget "$theNick"
set gTimebombGavebomb "$nick"
$nick comes from the proc call and $TheNick from the $args

Code: Select all

proc doPassbomb {nick uhost hand chan arg} {

Code: Select all

set theNick [lindex $arg 0]
There seems to be no error there. The script runs without any errors. The only problem is with using the command when being idle. Your idle time isn't resetted.

I can't find any error with the script without being idle. I can even config the script so you can only give the bomb back to the person whom gave you the bomb.

Code: Select all

#if {[string tolower $gTimebombGavebomb] != [string tolower $theNick]} {
			#	IRCPrivMSG $chan "You can only give the bomb back to $gTimebombGavebomb "
			#	return 0
			#}
This works fine. But when using timebomb when your idle this results in the same error. You can't give the bomb to someone who is idle.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Quinie wrote:This works fine. But when using timebomb when your idle this results in the same error. You can't give the bomb to someone who is idle.
Ok i am lost now, ( not hard to lose me :P ) does the problem occur when the person who starts the proc is idle or when the person they are giving it too is idle?
you want to deny them from passing the bomb to someone who is idle or starting the proc on someone who is idle?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

It's like the chat above

Code: Select all

[8:00pm] [ @Quinie] timebomb noname
Here i give the bomb to a user on the channel this user isn't idle
Before typing the command i have been idle. I think using the command resets my idle time with the bot

Code: Select all

[8:00pm] [a] legna: stuffs the bomb into noname's pants. The display reads [47] seconds. [a]
[8:00pm] [@legna] Diffuse the bomb by cutting the correct wire. There is one wire. It is Lavender.
Here the user gets the bomb.

Code: Select all

[8:00pm] [Noname] passbomb Quinie
Here the user wants to give me back the bomb. Well i gave it to the user in the first place so i shouldn't be idle. The tcl script is going to run this code

Code: Select all

set theNick [lindex $arg 0]
if {[getchanidle $theNick $chan] > 1} {
				IRCPrivMSG $chan "You can only give the bomb to someone who isn't idle"
				return 0
			}
As you can see my nick is used as $theNick. And I started the bomb

Code: Select all

[8:00pm] [@legna] You can only give the bomb to someone who isn't idle 
This is the result. I would think the bot would pass me the bomb but he/she doesn't :). If I would type any line and the user passes the bomb again. I recieve the bomb.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Ahh i have noticed this 'Glitch' before it seems to not reset your idletime if you trigger a bind. the way you could get around this is to do something like this.

Code: Select all

# set this var as null at top of script.
set gStarter ""

# In proc StartTimeBomb add this, also add global call to proc
set gStarter $theStarter

# code snippet
# if the target matches the starter do whatever you want and return
# else do the getchanidle thing.

if { [string tolower $gTimebombTarget] == [string tolower $gStarter] } {
      # do whatever you want here blow them up etc
    set gStarter ""
    return
  } else if { [getchanidle $theNick $chan] > 1 } {
    IRCPrivMSG $chan "You can only give the bomb to someone who isn't idle"
    return 0
}
This should work but not tested.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

Well that was my idea to just to check if the user whom gave it is the same as whom your going to pass to.

But like you said this "Glitch" you have seen before. I thought I should post it here as a bug, or maybe I'm doing something wrong here, or this is just a normal reaction.

The workaround should work but would not resolve the problems as it could be a small bug.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Aye i never thought of it as a bug more a quirk :D.

From what i can see you have done nothing wrong and for now you will just have to use workarounds, If you wish to report this as a bug you can do it here
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

Thx for the link and the help. Going to implement the workaround and will do some testing on other bots on same server etc. Maybe after that i'll send it in as a bug.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

before reporting as bug, I suggest you to try the 1.6.18 nightly build, because as told, my idle time gets reset even with commands binds ^^.

PS: plz do a [split ] before using [lindex ] on user input :D. but as long the target is the only possible argument, i'd recommend to just use $arg ^^
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...
Locked