Idle Event

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Locked
ajhunt
Posts: 266
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom
Contact:

Idle Event

Post by ajhunt »

Just wondering if there is a way to change the seconds setting for "Book/Actions/Idle Event" time from within an application so a user could select his/her own idle time. Don't think it's possible but always ask the experts. Thanks for any help.
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Idle Event

Post by Gaev »

ajhunt:

Haven't tried it myself ... so I am not sure if there might be unintended consequences like e.g. "changes to Focused Object" ... but if all else fails, you might consider doing your own timing within the "Idle Event Handler" (subroutine).

1) set the NeoBook Idle Time value to the smallest allowable value e.g. 15 seconds

2) reserve a variable (say IdleLoopMax) where you store a value that represents a multiple of the NeoBook Idle Time value (e.g 1,2,3,4,5 etc.).

You can present the user with a ListBox that allows him/her to select these values (1,2,3,4,5 etc.) ... or multiples of the NeoBook Idle Time (e.g. 15, 30, 45, 60 , 75 etc.) and then divide the user's selection by the NeoBook Idle Time value

3) reserve another variable (say IdleLoopCounter) ... when a user changes the value of IdleLoopMax, set the same value to IdleLoopCounter

4) At the start of the "Idle Event Handler" (subroutine) ...

a) subtract one from IdleLoopCounter
b) if the new value is 1 or more, Return from the subroutine
c) else, set IdleLoopCounter to IdleLoopMax ... and perform the desired commands before doing a Return

If a more fine grained control of the "Idle Time" is required, variables can be used to store actual times (instead of using the simpler loop counters).
ajhunt
Posts: 266
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom
Contact:

Re: Idle Event

Post by ajhunt »

Hi Gaev, as always your a superstar with ideas to solve problems - I'll have a go with that later today. Many thanks to you yet again for your time and help. Kind regards Anthony
Locked