Maddy Posted January 29, 2009 Posted January 29, 2009 (edited) hi, i want to make a hotkey for a beat em up game. i tried with autohotkey and it works, BUT theres one little problem. as i want to do combos with exact timing, the sleep times between attacks must be perfect. Somehow this doesnt work perfectly, as the sleep time (in milliseconds) seems to be not perfectly syncronious to the frames per second of the game (which is fluctuating). so it might be that the delay sometimes varies some milliseconds before or after than its supposed to be and the combo doesnt work anymore. My idea now is, to not sleep in milliseconds, but let my script wait for the next frame(s) of the game. so is there any possibility to read out the frames of the game with autoit ? thx, Maddy Edited January 29, 2009 by Maddy
JSThePatriot Posted January 29, 2009 Posted January 29, 2009 Maddy, It should be possible, but for anyone to actually know, they would need the name of the game. Also you will still have to do calculations on it because the sleep would still be in MS, but it could/would be flexible based upon the input it was receiving from the FPS...also with your FPS changing all the time, I don't know how feasible this will be to get down to x number of frames per second...It constantly fluxes so how would it know how many frames have actually passed? You would have to really dig into the game to see if any of that information is available. I would just do a more generic formula based on average FPS based on where you are in the game. I know you don't sit there watching the FPS to decide when to press the combo yourself. You time it in your head. Just use that timing in the scripts. Thanks, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Maddy Posted January 29, 2009 Author Posted January 29, 2009 Maddy,It should be possible, but for anyone to actually know, they would need the name of the game. Also you will still have to do calculations on it because the sleep would still be in MS, but it could/would be flexible based upon the input it was receiving from the FPS...also with your FPS changing all the time, I don't know how feasible this will be to get down to x number of frames per second...It constantly fluxes so how would it know how many frames have actually passed? You would have to really dig into the game to see if any of that information is available. I would just do a more generic formula based on average FPS based on where you are in the game. I know you don't sit there watching the FPS to decide when to press the combo yourself. You time it in your head. Just use that timing in the scripts.Thanks,Jarvisthe game is called Super Smash Brothers (N64 game) . and its emulated on the Project64 emulator. if its possible to read out anything of the game, can u tell me? or at least give me a tip how to face it?thanks so far.
JSThePatriot Posted January 29, 2009 Posted January 29, 2009 the game is called Super Smash Brothers (N64 game) . and its emulated on the Project64 emulator. if its possible to read out anything of the game, can u tell me? or at least give me a tip how to face it?thanks so far.Maddy,I don't have the game or the emulator, so I wouldn't know very much, but you could google for the information you're looking for. There should be something if you searched about scripting the frames per second or something along those lines.Thanks,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Maddy Posted January 29, 2009 Author Posted January 29, 2009 theoretically i could send you the emulator and the game, its only few mb ^^ i actually raped google for that but with "frames" it mostly links to the frames of windows
JSThePatriot Posted January 29, 2009 Posted January 29, 2009 theoretically i could send you the emulator and the game, its only few mb ^^ i actually raped google for that but with "frames" it mostly links to the frames of windows I still wouldn't know where to begin other than at google if I had the emulator, nor would I have the time. Try not to spell it all out. Try using 'FPS'.Sorry I couldn't help more,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
jaberwacky Posted January 29, 2009 Posted January 29, 2009 hi, i want to make a hotkey for a beat em up game. i tried with autohotkey and it works, BUT theres one little problem. as i want to do combos with exact timing, the sleep times between attacks must be perfect. Somehow this doesnt work perfectly, as the sleep time (in milliseconds) seems to be not perfectly syncronious to the frames per second of the game (which is fluctuating). so it might be that the delay sometimes varies some milliseconds before or after than its supposed to be and the combo doesnt work anymore. My idea now is, to not sleep in milliseconds, but let my script wait for the next frame(s) of the game. so is there any possibility to read out the frames of the game with autoit ? thx, Maddy Try this accurate sleep udf that I just found ;----- accurate sleep by ludocus ----- ;www.autoitscript.com/forum/index.php?showtopic=74082&hl=accurate+sleep Func _AccurateSleep($sTime) $timer=TimerInit() Do $tmp = TimerDiff($timer) Until $tmp >= $sTime EndFunc Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Authenticity Posted January 29, 2009 Posted January 29, 2009 If you don't care to spark your CPU with this _Sleep function then it's pretty accurate.
Maddy Posted January 30, 2009 Author Posted January 30, 2009 (edited) Try this accurate sleep udf that I just found ;----- accurate sleep by ludocus ----- ;www.autoitscript.com/forum/index.php?showtopic=74082&hl=accurate+sleep Func _AccurateSleep($sTime) $timer=TimerInit() Do $tmp = TimerDiff($timer) Until $tmp >= $sTime EndFunc thx !!! this works pretty well, not perfect but really close to that and much better than sleep , i think its enough thank you for help Edited January 30, 2009 by Maddy
Maddy Posted January 30, 2009 Author Posted January 30, 2009 another question, how do i make my hotkeys only work, when the window of my game is active? i tried winactive and some others but dont work... in autohotkey i got it to work with: #ifWinActive, SMASH BROTHERS - Project64k Version 0.13 Core 1.4 on top of the script.
JSThePatriot Posted January 30, 2009 Posted January 30, 2009 (edited) Try the following... If WinActive("SMASH BROTHERS - Project64k Version 0.13 Core 1.4") Then HotKeySet("^!x", "_TerminateApp") HotKeySet("{PAUSE}", "_PauseApp") Else HotKeySet("^!x", "") HotKeySet("{PAUSE}", "") EndIf Even though I didn't say it, that would obviously need to be in some sort of a loop that keeps your program alive when you're in other windows. I hope that helps some, Jarvis Edited January 30, 2009 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Maddy Posted January 30, 2009 Author Posted January 30, 2009 hmmm with this, i get an error: HotKeySet("t","") Error: Unknown function name. obviously cause i didnt definde the function "" ...
Authenticity Posted January 30, 2009 Posted January 30, 2009 You need to call this function without the second optional parameter to unset previous hot-key binding. HotKeySet('t')
azure Posted January 30, 2009 Posted January 30, 2009 hmmm with this, i get an error: HotKeySet("t","") Error: Unknown function name. obviously cause i didnt definde the function "" ... Try HoeKeySet("t") The function parameter is optional, and if you don't specify it, it should unset the previous hotkey.
herewasplato Posted January 30, 2009 Posted January 30, 2009 Off-Topic: Some typos are quite humorous in English/slang HoeKeySet [size="1"][font="Arial"].[u].[/u][/font][/size]
JSThePatriot Posted January 30, 2009 Posted January 30, 2009 Maddy, My bad on the HotKeySet...Glad you got it sorted. Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
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