baconspud Posted December 10, 2006 Posted December 10, 2006 I have used AutoIT before to write simple fishing scripts and such for online games. I was trying to write a very very simple script to actually help me get through the incredibly annoying mini-games on an old PC version of FF7. Script plan: Simply press numpadenter for X amount of time then release ... wait Y amount of time ... rinse and repeat The problem: No commands are going through to the FF7 client (window is labeled DEFAULT). I have created scripts for WoW and FFXI and in both cases I could simply put a delay at the begining of my script allowing myself time to Alt-tab over to the correct window, or I would have AutoIT find and switch to the correct window. Neither of these approaches are allowing me to send any commands to this simple client side program. Please help an idiot out.
theguy0000 Posted December 10, 2006 Posted December 10, 2006 (edited) hmmm.....anyone got a crystal ball? Mine isn't quite working...http://www.autoitscript.com/fileman/users/gafrost/cbemoticon.gif Edited December 10, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
Zedna Posted December 11, 2006 Posted December 11, 2006 Put your current code here. Use WinActivate() at begining to switch to your destination app. Then use Send() @D-Generation X Nice crystal ball Resources UDF ResourcesEx UDF AutoIt Forum Search
baconspud Posted December 11, 2006 Author Posted December 11, 2006 As I said, very simple code: $win_title = "DEFAULT" WinActivate($win_title, "") WinSetOnTop($win_title, "", 0) $repeats = 0 Sleep(5000) while $repeats > 10 Send("{NUMPADENTER DOWN}") Sleep(1000) Send("{NUMPADENTER UP}") Sleep(1000) $repeats = $repeats + 1 wend
xcal Posted December 11, 2006 Posted December 11, 2006 $repeats starts at 0 This never happens - while $repeats > 10. I think you wanted < How To Ask Questions The Smart Way
The Kandie Man Posted December 11, 2006 Posted December 11, 2006 Like this? $x = 5 ;seconds to wait $y = 5 ;seconds to wait Local $i_Timestamp While 1 $i_Timestamp = TimerInit() While (TimerDiff($i_Timestamp)/1000) <= $x ;multiply by 1000 to convert it into milliseconds, because computers use milliseconds, not seconds Send("{NUMPADENTER}") Wend ConsoleWrite("Just finished press." & @LF) sleep($y * 1000);multiply by 1000 to convert it into milliseconds, because computers use milliseconds, not seconds ConsoleWrite("Just finished sleep."&@LF) Wend "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire
baconspud Posted December 11, 2006 Author Posted December 11, 2006 As I said, very simple code:$win_title = "DEFAULT"WinActivate($win_title, "") WinSetOnTop($win_title, "", 0) $repeats = 0Sleep(5000) while $repeats > 10Send("{NUMPADENTER DOWN}") Sleep(1000)Send("{NUMPADENTER UP}") Sleep(1000) $repeats = $repeats + 1wendFigured out my problem.It appears thatSend("{NUMPADENTER DOWN}") is not being recognized at all. All I had to do was change my in-game bindings from numpadenter to another key (s) and my script worked flawlessly. Thanks for your help guys and for pointing out my <> mistake. Is it normal that keys like numpadenter should not be able to be held down by the script, or was this unique to my machine?
baconspud Posted December 11, 2006 Author Posted December 11, 2006 Oh yes, and if anyone happens to feel nostalgic and want to go back and play FF7 ... here is a script for easy unlimited gold in the golden saucer basketball minigame: $win_title = "DEFAULT" WinActivate($win_title, "") WinSetOnTop($win_title, "", 0) $repeats = 0 Sleep(5000) while $repeats < 1000 Send("{S DOWN}") Sleep(450) Send("{S UP}") Sleep(3000) $repeats = $repeats + 1 wend
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