stig90 Posted August 25, 2011 Posted August 25, 2011 im pretty new to autoit used some other programs like it in the past but it's been along time im having problems getting the HotKeySet command to work and i can't figure out what im doing wrong i tried setting up the script on just a continuous loop to make sure it would work and it did but when i introduce HotKeySet into the script nothing here is the script dont laugh at it's feebleness i just started ^.^ ---------------------------------------------------------------------------------------------------------------------------------------------------------------- expandcollapse popupHotKeySet( "{q}" , "_runag" ) Func _runag() Send( "{T}" ) Sleep( 100 ) MouseMove( 306,150 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) MouseMove( 385, 454 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) Send( "{Backspace}" ) Sleep( 100 ) Send( "{5}" ) Send( "{0}" ) Send( "{0}" ) Sleep( 100 ) MouseMove( 534, 456 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 1000 ) Send( "{T}" ) Sleep( 100 ) Send( "{E}" ) Sleep( 100 ) MouseMove( 744, 176 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) MouseMove( 740, 450 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) Send( "{Backspace}" ) Sleep( 100 ) Send( "{5}" ) Send( "{0}" ) Send( "{0}" ) MouseMove( 963, 452 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 5000 ) EndFunc While 1 WEnd
pieeater Posted August 25, 2011 Posted August 25, 2011 (edited) Copy and paste this under the HotKeySet(): While 1 Sleep(100) WEnd What it does is keep your script alive so you can use the function Edited August 25, 2011 by pieeater [spoiler]My UDFs: Login UDF[/spoiler]
stig90 Posted August 25, 2011 Author Posted August 25, 2011 yea i tried that as well the script is staying alive it just wont run the function i will try again though and post results here
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90,You have un-needed { } around the "key" parameter. This works for me: HotKeySet("q", "_runag") While 1 Sleep(10) WEnd Func _runAg() ConsoleWrite("Hit" & @CRLF) EndFuncM23 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
stig90 Posted August 25, 2011 Author Posted August 25, 2011 (edited) new script still nothing expandcollapse popupHotKeySet( "{q}" , "_runag" ) While 1 Sleep( 100 ) WEnd Func _runag() Send( "{T}" ) Sleep( 100 ) MouseMove( 306,150 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) MouseMove( 385, 454 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) Send( "{Backspace}" ) Sleep( 100 ) Send( "{5}" ) Send( "{0}" ) Send( "{0}" ) Sleep( 100 ) MouseMove( 534, 456 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 1000 ) Send( "{T}" ) Sleep( 100 ) Send( "{E}" ) Sleep( 100 ) MouseMove( 744, 176 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) MouseMove( 740, 450 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) Send( "{Backspace}" ) Sleep( 100 ) Send( "{5}" ) Send( "{0}" ) Send( "{0}" ) MouseMove( 963, 452 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 5000 ) EndFunc edited to be less huge and annoying since i forgot the [autoit] part on the coding Edited August 25, 2011 by stig90
stig90 Posted August 25, 2011 Author Posted August 25, 2011 lol made that previous post b4 i saw melba23's ill try that out and see what the results are
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90,Read my post above! M23P.S. When you post code please use Code tags. Put [autoit] before and [/autoit] after your posted code. 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
stig90 Posted August 25, 2011 Author Posted August 25, 2011 expandcollapse popupHotKeySet( "q" , "_runag" ) While 1 Sleep( 100 ) WEnd Func _runag() Send( "{T}" ) Sleep( 100 ) MouseMove( 306,150 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) MouseMove( 385, 454 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) Send( "{Backspace}" ) Sleep( 100 ) Send( "{5}" ) Send( "{0}" ) Send( "{0}" ) Sleep( 100 ) MouseMove( 534, 456 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 1000 ) Send( "{T}" ) Sleep( 100 ) Send( "{E}" ) Sleep( 100 ) MouseMove( 744, 176 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) MouseMove( 740, 450 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 100 ) Send( "{Backspace}" ) Sleep( 100 ) Send( "{5}" ) Send( "{0}" ) Send( "{0}" ) MouseMove( 963, 452 ) Sleep( 100 ) MouseClick( "Left" ) Sleep( 5000 ) EndFunc still nothing
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90,If you run the exact script I posted - do you get the "Hit" in the SciTE console? That will show if the code works (and it does for me). What are you trying to automate with this script? Perhaps it is that app which is resisting the automation - not your script failing. 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
stig90 Posted August 25, 2011 Author Posted August 25, 2011 (edited) ur script doesn't work for me as well notta it's a knockoff of mysql for college just trying to do mindless tasks without me having to do them ^.^ Edited August 25, 2011 by stig90
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90,If pressing the "q" key with that script running does not fire the function then there is something wrong. Do you by chance have a previous instance of the script already running and so blocking the "q" key? 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
stig90 Posted August 25, 2011 Author Posted August 25, 2011 (edited) nope tbh i used autoit in the past along with some different programs like it and i vaguely remember hotkeyset working but since ive redownloaded autoit havn't been able to get it to work i can run the script once or set it on an infinite loop and it will work fine Edited August 25, 2011 by stig90
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90,Please run this:$iRet = HotKeySet("q", "fred") If $iRet Then MsgBox(0, "HotKey", "has been SET") Else MsgBox(0, "HotKey", "has NOT been SET") EndIf Func fred() EndFuncPerhaps you already have something blocking the "q" key from being set by AutoIt. 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
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90, So try this: HotKeySet("q", "fred") While 1 Sleep(10) WEnd Func fred() MsgBox(0, "HotKey", "Pressed") Exit EndFunc Having fun? 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
stig90 Posted August 25, 2011 Author Posted August 25, 2011 worked pretty cool way of using autoit to problem solve something within autoit i have alot to learn lol
Moderators Melba23 Posted August 25, 2011 Moderators Posted August 25, 2011 stig90,i have alot to learnSo did we all at the beginning! And do not get discouraged - you can get lots of help here if you show some effort. 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
stig90 Posted August 25, 2011 Author Posted August 25, 2011 well i hope on my first post i showed at least a glimpse of effort
fosder Posted September 9, 2011 Posted September 9, 2011 (edited) mm... hi! I also encountered this problem. for this code, the result is "has been set". $iRet = HotKeySet("q", "fred") If $iRet Then MsgBox(0, "HotKey", "has been SET") Else MsgBox(0, "HotKey", "has NOT been SET") EndIf Func fred() EndFunc and for this HotKeySet("q", "fred") While 1 Sleep(10) WEnd Func fred() MsgBox(0, "q", "Pressed") Exit EndFunc nothing but keys like space or escape are read correctly please help me Edited September 9, 2011 by fosder
Moderators Melba23 Posted September 9, 2011 Moderators Posted September 9, 2011 fosder,Your second snippet works perfectly for me. Are you saying that you do not get a MsgBox? 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
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