PDA

View Full Version : Can I do this with the Windows - Wait command?



Mark F
October 13th, 2002, 03:55 PM
Actually, you would use the USerEvent plugin to generate a second event at a defined time after the first event.

For example, define a multigroup that has Command1 and a UserEvent command (Command2). The UserEvent is defined (in THIS example) as Event2, delayed by 3 seconds. Define a command (not part of the multigroup) called Command3.

Learn the original event (Event1) for the multigroup. Learn the UserEvent (Event2) for Command3.

When Event1 occurs, the multigroup is triggered. Command1 executes and then Command2 (UserEvent) executes which causes a 3 second delay before Event2 is generated by the UserEvent plugin. When Event2 occurs, Command3 executes. During the 3 second delay, anything else (events, commands, whatever) can occur.

Is this a bit clearer? :)

Mark F
October 13th, 2002, 03:55 PM
Don -

I'm obviously not being very clear here. Sorry.

*MY* definitions:
EVENTS are the things that hardware normally generates. (keystrokes, IR button presses, TCP/IP based messages, etc.) These can cause Girder to execute COMMANDS or MULTIGROUPS. A COMMAND is a single action. A MULTIGROUP is a ordered group of COMMANDS. You use the LEASRNING process to associate an event with a command or multigroup.

The UserEvent plugin allows you to define a new event that you want to use to trigger the execution of a command or mutigroup. Optionally, you can cause this new event to be delayed before it is passed to Girder.


In a multigroup, if I had a command 4 directly after the command 2(Userevent) does control pass to command 4 after command 3 finishes?
No, Command 4 would execute right after Command 2. Command 2 schedules an event to be delivered later and returns control to Girder. Girder does the next command (Command 4). When the time is right (after the delay), Event 2 will be passed from the UserEvent plugin to Girder and any command or multigroup that has this event "learned" will execute.

If you want to add a command 4 that executes after command 3, build a multigroup with command 3 and 4 and learn event 2 for that group.


What settings for the User Event plugin should I use beyond the delay this event?
Set the Event String to EVENT2
Use either TimeStamp or Payload data
Use Delay this event (relative, whatever amount of time (3 seconds?))


Do I set target to anything special?
Targeting is not used by this plugin.


How exactly do I Learn Event for the User Event command? I select User Events then go into Learn Event but am not sure what is wants there.
It wants the exact Event String (EVENT2 from the instructions above).

I have attached a .GML file that shows the basics of what I'm saying. :) It has a delayed (by 10 seconds) command 3. To try it out, execute (test command) the multigroup.

Mark F
October 13th, 2002, 03:55 PM
I've had a revelation! The closer to noon that I type a reply, the more coherent I become. :D

When I first offered the plugin, I wasn't sure it would be used. Now it has become a really valuable tool for the scripts I write. I'm glad this does what you want and I'm open to any enhancements you may suggest for the plugin. ;)


What started this was the Windows-Wait command "turning off" Girder during the wait. Do you think this is an enhancement request? Is there a place for feature requests?

You are in the right area to ask for Girder enhancements and this would definitely be considered an enhancement or feature request. Please keep in mind that Girder isn't Ron's only priority in life right now so he might not add this in the near future.

I have never seen the Gider source but I would GUESS this would require a LOT of work since it is such a large paradigm shift. (Suspending the current command execution thread while letting another command execution thread run? OUCH! Sounds hard to me.) However, it never hurts to ask (nicely :) ).

vynce
October 13th, 2002, 03:55 PM
You can do this with the userevent plugin (http://www.girder.nl/downloadn.php?Link=331). This won't wait for a window though, if that is specifically what you need.

windtrader
October 13th, 2002, 03:55 PM
It seems that while the Windows-wait command is actually performing the wait, other Girder commands arriving during the wait queue up and execute once the wait time has expired.

I am using the wait command in a multi group and want to pause between two other commands. I would like Girder to accept and process other commands arriving during the wait. Is there a way to use Windows Wait to accomplish this or is there another technique?

The target is set to default which is explorer.exe, shell_traywind, child object button, and the send to foreground task is checked.

Thanks,
Don

windtrader
October 13th, 2002, 03:55 PM
Vynce,

I tried the User Event plugin and it did not pause between two other commands. The user event command has a 3 second delay defined.

When I execute the multigroup (command 1, user event command, command 3), all trigger sequentially with no delay. When I used a windows-wait command instead of the user event command, I got the desired wait between commands 1 and 3.

Maybe I don't have the user event settings correct. Any suggestions? Also, could you provide a typical scenario or two where user event really shines? It is not clear to me what this does. ;-)

Don

windtrader
October 13th, 2002, 03:55 PM
Mark,

In a multigroup, if I had a command 4 directly after the command 2(Userevent) does control pass to command 4 after command 3 finishes?

Other questions:

What settings for the User Event plugin should I use beyond the delay this event?

Do I set target to anything special?

How exactly do I Learn Event for the User Event command? I select User Events then go into Learn Event but am not sure what is wants there.

Thanks,
Don

windtrader
October 13th, 2002, 03:55 PM
Mark,

Thanks, that was a really super reply! I finally got it all wired in my head and see what type of scenarios make this command shine.

I can use it to fire off commands with varying delays that emulate the windows-wait but immediately frees Girder to accept and process other commands while the others are in delay mode. Performs just what I want.

What started this was the Windows-Wait command "turning off" Girder during the wait. Do you think this is an enhancement request? Is there a place for feature requests?

Thanks again,
Don