montagesnmore Posted October 2, 2013 Share Posted October 2, 2013 (edited) Greetings everyone! I am new to Autoit scripting and I have just completed my scripting and I have my GUI completely functional (see pic below). My next question is, how can I extract a key toggle script into the program itself, so when I open/close my program, anyone can press the hot key "F1 or F2" to enable the script above. My only problem I am encountering is, I do not know how to create the toggle script. How can I convert the AutoHotKey into AutoIt? Here is the script form AutoHotkey: $F2:: ;Command button to execute script no_hud++ if (no_hud = 1) ;disable bf3 hud { Send {vkC0sc029 down} sleep, 1 Send {vkC0sc029 up} sleep, 1 send UI.DrawEnable 0 {enter} sleep, 1 Send {vkC0sc029 down} sleep, 1 Send {vkC0sc029 up} } if (no_hud = 2) ;Enable bf3 hud { Send {vkC0sc029 down} sleep, 1 Send {vkC0sc029 up} sleep, 1 send UI.DrawEnable 1 {enter} sleep, 1 Send {vkC0sc029 down} sleep, 1 Send {vkC0sc029 up} no_hud = 0 } return Edited October 2, 2013 by montagesnmore Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 2, 2013 Moderators Share Posted October 2, 2013 (edited) montagesnmore,Welcome to the AutoIt forum. But that is not AutoIt3 code - are you sure you are on the correct forum? And looking at the title of the GUI you posted, you might like to read the Forum rules (there is also a link at bottom right of each page) before you ask any more questions. M23Edit: Moved to "General Help and Support" section Edited October 2, 2013 by Melba23 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...
montagesnmore Posted October 2, 2013 Author Share Posted October 2, 2013 Thanks for the reply, I'm sorry about the forum rules ...I am trying to get a key toggler to execute when I open the program. I cannot find out how to do it, unfortunately. The script I provided was from AutoHotKey, however I prefer to use Autoit, because I find it to be a little bit more easier to code. My program is by no means illegal or trying to do anything illegal, spam, etc and alike. I just wanted to know how to create a key toggler so that when you press the button, it opens up the console in the video game and it writes the script for you. Example: Press F2 , while you are playing your game, then it opens up the console and enters the command for you. I can code greatly in CMD, but I want to take it to the next step by using AutoIT by using GUIs, coding in C++, etc. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 2, 2013 Moderators Share Posted October 2, 2013 montagesnmore, I'm sorry about the forum rulesSo you read them - and then still expect help for a script which you admit you use while playing a game? I suggest you read them more carefully before you post again - thread closed. 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