L3G3NdKillEr Posted August 15, 2007 Share Posted August 15, 2007 i want to make keys for games with the help of autoits. for instance W = up arrow i make this hotkeyset("w", "up") while 1 sleep(50) wend func up() send("{up}") endfunc and problem is that it does'nt work fine. i make this for racing game and w for accelerator and is there any way to work this key perfectly. i cannot change key from game. i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
probedrone Posted August 15, 2007 Share Posted August 15, 2007 umm... when are u calling that function? when is it going to exit from that infinite loop? Link to comment Share on other sites More sharing options...
Achilles Posted August 15, 2007 Share Posted August 15, 2007 #Include <Misc.au3> hotkeyset("w", "up") while 1 sleep(50) wend Func up() While _IsPressed('57') Send("{up}") WEnd EndFunc I don't if this will help you at all... I just noticed that games recognize if you a hold a key down for a long time it will send it for a long time. HotkeySet would just call the function once... But maybe this will solve that problem. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 16, 2007 Author Share Posted August 16, 2007 no problem is not completely solved. it just like that u press half trigger. is there anyother way sooo tell........, i apreciate........, i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
Joon Posted August 16, 2007 Share Posted August 16, 2007 no problem is not completely solved. it just like that u press half trigger. is there anyother way sooo tell........, i apreciate........, Try and see if it hold down the accelerator for 5 seconds. Send("{up down}") Sleep(5000) Send("{up up}") Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 17, 2007 Author Share Posted August 17, 2007 (edited) yes it hold key for 5 sec. but its not work perfectly for me. i want it work like orignal keys means work like up and down key of keyboard. Thanxx. Edited August 17, 2007 by L3G3NdKillEr i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
newb_powa' Posted August 17, 2007 Share Posted August 17, 2007 #Include <Misc.au3> hotkeyset("w", "up") Hotkeyset("{ESC}", "_exit") while 1 sleep(50) wend Func _exit() Exit EndFunc Func up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc This is the mix of the two exemple Joon and Piano Man gave you. It's untested but try it. Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 17, 2007 Share Posted August 17, 2007 Try adjusting the SendKeyDownDelay option. I know some programs require a slightly longer delay, an anti-macro feature I suppose. Try using 10 ms, 15ms, etc. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 18, 2007 Author Share Posted August 18, 2007 thanx all and i made this. CODE#Include <Misc.au3> hotkeyset("w", "up") HotKeySet("{numpad4}", "left") HotKeySet("{numpad6}", "right") Hotkeyset("{ESC}", "_exit") while 1 sleep(50) wend Func _exit() Exit EndFunc Func up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc func left() send("{left Down}") while _ispressed("{numpad4}") sleep(10) WEnd send("{left up}") EndFunc func right() send("{right down}") while _ispressed("{numpad6}") Sleep(10) WEnd Send("{right up}") EndFunc "w" works perfectly but other keys not work correctly. but otherwise thanx i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
martin Posted August 18, 2007 Share Posted August 18, 2007 thanx all and i made this. CODE#Include <Misc.au3>hotkeyset("w", "up")HotKeySet("{numpad4}", "left")HotKeySet("{numpad6}", "right")Hotkeyset("{ESC}", "_exit")while 1sleep(50)wendFunc _exit() ExitEndFuncFunc up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc func left() send("{left Down}") while _ispressed("{numpad4}") sleep(10) WEnd send("{left up}") EndFunc func right() send("{right down}") while _ispressed("{numpad6}") Sleep(10) WEnd Send("{right up}") EndFunc"w" works perfectly but other keys not work correctly. but otherwise thanxYou're confusing send and _Ispressed. Look in the help and you will see that _IsPressed needs numbers, "{numpad6}" won't work it should be 66. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 18, 2007 Author Share Posted August 18, 2007 ok i change to this but its also not work for me. CODE#Include <Misc.au3> AutoItSetOption("SendKeyDownDelay", 15) hotkeyset("w", "up") HotKeySet("e", "left") HotKeySet("r", "right") Hotkeyset("{ESC}", "_exit") while 1 sleep(50) wend Func _exit() Exit EndFunc Func up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc func left() send("{left Down}") while _ispressed("{numpad4}") sleep(10) WEnd send("{left up}") EndFunc func right() send("{right down}") while _ispressed("{numpad6}") Sleep(10) WEnd Send("{right up}") EndFunc i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
martin Posted August 18, 2007 Share Posted August 18, 2007 ok i change to this but its also not work for me.CODE#Include <Misc.au3>AutoItSetOption("SendKeyDownDelay", 15) hotkeyset("w", "up")HotKeySet("e", "left")HotKeySet("r", "right")Hotkeyset("{ESC}", "_exit")while 1sleep(50)wendFunc _exit() ExitEndFuncFunc up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc func left() send("{left Down}") while _ispressed("{numpad4}") sleep(10) WEnd send("{left up}") EndFunc func right() send("{right down}") while _ispressed("{numpad6}") Sleep(10) WEnd Send("{right up}") EndFuncWhat did you change? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Achilles Posted August 18, 2007 Share Posted August 18, 2007 Try that... expandcollapse popup#Include <Misc.au3> AutoItSetOption("SendKeyDownDelay", 15) hotkeyset("w", "up") HotKeySet("e", "left") HotKeySet("r", "right") Hotkeyset("{ESC}", "_exit") while 1 sleep(50) wend Func _exit() Exit EndFunc Func up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc func left() send("{left Down}") While _ispressed("64") sleep(10) WEnd send("{left up}") EndFunc func right() send("{right down}") While _ispressed("66") Sleep(10) WEnd Send("{right up}") EndFunc My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 19, 2007 Author Share Posted August 19, 2007 ohhhhh sorry but its also does'nt work only one key work at a time i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 20, 2007 Author Share Posted August 20, 2007 anyone plzzzzz help......., i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
Achilles Posted August 20, 2007 Share Posted August 20, 2007 anyone plzzzzz help.......,If this works for one key try making four different scripts... That's the only thing I can think of... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted August 21, 2007 Author Share Posted August 21, 2007 no its work in one script made this and thanks for gave me some ideas.. expandcollapse popup#Include <Misc.au3> AutoItSetOption("SendKeyDownDelay", 15) hotkeyset("w", "up") HotKeySet("e", "left") HotKeySet("r", "right") HotKeySet("u", "down") while 1 sleep(50) wend Func up() Send("{UP DOWN}") While _IsPressed('57') Sleep(10) WEnd Send("{UP UP}") EndFunc func left() send("{left Down}") While _ispressed('45') sleep(10) WEnd send("{left up}") EndFunc func right() send("{right down}") While _ispressed('52') Sleep(10) WEnd Send("{right up}") EndFunc Func down() send("{down Down}") While _IsPressed('55') sleep(10) WEnd send("{down Up}") EndFunc i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> 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