itaypro121 Posted April 13, 2015 Share Posted April 13, 2015 I have a problem relating my code, I have just started coding and I would like for someone here help me with one. Well basically I need a while loop that everytime I press the key Alt(12) it will press the key x ( 58), So for example I press and hold alt it will press and hold x, I release the alt it releases the x kind of bind one key to another, I could not make it work , Please someone write me an example code for me to undertand.. Thanks in advance! Link to comment Share on other sites More sharing options...
MikahS Posted April 13, 2015 Share Posted April 13, 2015 Welcome to the AutoIt Forum itaypro121! Can you show us what you have tried, along with what you are trying to automate with this? Thanks, MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
itaypro121 Posted April 13, 2015 Author Share Posted April 13, 2015 (edited) #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") While 1 Sleep(10) If _IsPressed("12", $hDLL) Then Send("{58") Send("{58") Send("{58}") Else Send("{58}") Send("{58") Send("{58}") EndIf WEnd DllClose($hDLL)Please help me make this do what I'm trying to - and again I'm trying to make an automode that makes one key press another and do the same actions I do with that key to other one, For example, If I press Alt I want it to press x, if I release alt I want it to release x, Edited April 13, 2015 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 13, 2015 Moderators Share Posted April 13, 2015 itaypro121,When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MikahS Posted April 13, 2015 Share Posted April 13, 2015 You're missing curly brackets on a couple of those send functions. Also, any chance you could let us know what it is for, might give us a better idea of how to help you out. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
itaypro121 Posted April 13, 2015 Author Share Posted April 13, 2015 (edited) You're missing curly brackets on a couple of those send functions. Also, any chance you could let us know what it is for, might give us a better idea of how to help you out. Oki, Well I have a program that does something when I press the bottum 'x' but 'x' is annoying to press! and 'x' cannot be changed! so I want to make a program that press the 'x' when I presss alt This is the source code of the script with the 'x' but I cannot find a way to change the 'x' to alot <snip> Edited April 13, 2015 by Melba23 Code removed Link to comment Share on other sites More sharing options...
mikell Posted April 13, 2015 Share Posted April 13, 2015 https://www.gamersfirst.com/apb/ Tss tss Link to comment Share on other sites More sharing options...
itaypro121 Posted April 13, 2015 Author Share Posted April 13, 2015 https://www.gamersfirst.com/apb/ Tss tss :DDDD Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 13, 2015 Moderators Share Posted April 13, 2015 itaypro121,Unfortunately you appear to have missed the >Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts