Ok, I've fine tuned my Auto-Register script. I haven't tested much, but I seem to have eliminated the crashing issue. There was a problem when other tables popped up and stole focus from the Tournament Registration window, thus halting the script and crashing everything.
Here it is fwiw: This has been tested on OS X v10.5.7 and works with the most recent Stars update. You must be running OS X v10.3.0 or later (Panther, Tiger or Leopard) as GUI Scripting was not added to the Mac OS until Panther. It should work on Snow Leopard as well when it comes out in September.
Also, you must enable GUI Scripting before running it. Open SystemPreferences.app and tick the check box to 'Enable Access for Assistive Devices' in the Universal Access pane.
Copy/paste this code into ScriptEditor.app (Applications > AppleScript > ScriptEditor) and
save it as a stay-open application. File > Save, make sure the File Format is set to 'Application' and check the 'Stay Open' box. This allows the script to run continuously in the background. If you don't save it this way, it won't do anything for you. Save it wherever and name it whatever.
I will get into automating table actions soon. Let me know if any issues come up (I'm still an AppleScript noob).
Enjoy
Code:
on idle
tell application "System Events"
tell application process "PokerStars"
if window "Tournament Registration" exists then --wait until reg box appear after clicking reg button
--make sure we complete the reg process without other tables popping up and stealing focus from the tourney reg window
set done to false
repeat until done is true
keystroke "1" using command down --make sure the Stars lobby has focus and not other tables. when the tourney reg window is open, sending a command-1 keystroke (normally to give the lobby focus) gives the tourney reg window focus.
if exists radio button 1 of window "Tournament Registration" then --make sure we're registering and not unregistering
click radio button 1 of window "Tournament Registration" --click buy-in
repeat until button "OK" of window "Tournament Registration" exists --wait until reg confirmation OK button appears.
end repeat
click button "OK" of window "Tournament Registration"
repeat until window "Tournament Registration" exists --wait until reg confirmation dialog appears
end repeat
click button "OK" of window "Tournament Registration" --reg confirmation dialog
else --we're unregistering; buy-in refunded
repeat until button "OK" of window "Tournament Registration" exists --wait until OK button appears after unregistering
end repeat
click button "OK" of window "Tournament Registration"
end if
set done to true
end repeat
end if
end tell
end tell
return 0.5 --allow the script to continuously run in the background, updating every 0.5 seconds
end idle