AlanR Posted October 1, 2007 Share Posted October 1, 2007 (edited) Just a simple one for those who like to play (Windows) Spider Solitaire. I've always been annoyed with having to keyboard in Ctrl+z to undo the last move. All other moves can be done with just the mouse. This script enables the right-click of the mouse to undo the last move, allowing the whole game to be played using just the mouse.CODE#include <Misc.au3>Dim $Program, $PID $dll = DllOpen("user32.dll") $Program = "C:\WINDOWS\system32\spider.exe" $PID = Run($Program, "", @SW_SHOW) WinWaitActive("Spider") While 1Sleep ( 150 ) If Not WinExists("Spider") Then ExitLoop If WinActive("Spider") AND _IsPressed("02", $dll) ThenWinActivate("Spider") Send("^z") EndIf WEnd DllClose($dll) ExitAlan Edited October 3, 2007 by AlanR Link to comment Share on other sites More sharing options...
lordofthestrings Posted October 1, 2007 Share Posted October 1, 2007 looks like a nice & clearly written script! Link to comment Share on other sites More sharing options...
gseller Posted October 1, 2007 Share Posted October 1, 2007 Nice... One suggestion might be to have it close when the game closes.. Link to comment Share on other sites More sharing options...
AlanR Posted October 2, 2007 Author Share Posted October 2, 2007 (edited) Nice... One suggestion might be to have it close when the game closes..I'm quite the beginner with many aspects of AutoIt. I thought that the While loop would have taken care of closing the script, when the "Spider" window no longer existed i.e. closed by user. Is there a better/ more correct way to do this?AlanEdit - I've edited the original script so that (I think) it will exit once Spider is closed. Edited October 3, 2007 by AlanR Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now