Toda Posted December 22, 2009 Share Posted December 22, 2009 (edited) Hello, I am new to the forums and writing scripts. I would like to know if there is a command to use one key to do two separate functions simply by either single tapping or double tapping the key. And/or. To tap or press and hold the same button for two different functions. Thanks a bunch. Edited December 22, 2009 by Toda Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 22, 2009 Moderators Share Posted December 22, 2009 Toda, Welcome to the AutoIt forum. Do you want to single/double press a particular key (if so, which one?) or react when any key is single/double pressed? 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...
Toda Posted December 22, 2009 Author Share Posted December 22, 2009 Melba23 Do explain clearly I will ave to tell you what I am doing. Its for the game Darkfall. I want the use the "`" key to perform two different functions depending on how it is pressed. If I tap the "`" key I want it to cycle to a casting bar and cast a Nuke spell. If I hold the "`" key I want it to cycle to a different casting bar and cast a heal spell. The cycling and stuff I can do with the easy Send, and Sleep commands. It is the double tapping I cant figure out. Even if it where to just be holding the button for a second instead of double tapping it would work. i have been playing around with "If" "Then" statements all morning. something like this Func Heal_Nuke() If Heal_nuke() Then sleep (500) If Heal_Nuke () Then send("!1") sleep(100) send("9") sleep(200) send("{F2}") sleep(100) Send("1") sleep(195) mouseclick("left") EndIf If Not Heal_Nuke Then send("!1") sleep(100) send("9") sleep(200) send("!2") sleep(100) Send("1") sleep(195) mouseclick("left") EndIf EndIf EndFunc ;==> Heal_Nuke I know this doesn't work right now but I am experimenting Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 22, 2009 Moderators Share Posted December 22, 2009 Toda,Its for the game DarkfallSorry, not interested any more. 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...
Toda Posted December 22, 2009 Author Share Posted December 22, 2009 Toda,Sorry, not interested any more. M23Why? Because its something that gets people interested in learning new stuff? Like coding. Or is it because its just a game and not some coding program to steal your credit card number? Link to comment Share on other sites More sharing options...
SEuBo Posted December 22, 2009 Share Posted December 22, 2009 How about something like this: #include <Misc.au3> $user32 = DllOpen("user32.dll") $key = 01 ; left mouse button While 1 * Sleep(10) If _IsPressed($key,$user32) Then $t = TimerInit() Do Sleep(10) Until Not _IsPressed($key,$user32) Or TimerDiff($t) > 150 If _IsPressed($key,$user32) Then ; if still pressed ConsoleWrite("Cast Heal" & @CRLF) Sleep(1000) Else ConsoleWrite("Cast Nuke" & @CRLF) Sleep(1000) EndIf EndIf WEnd AutoIt Examples/UDF's:Generate Function at Runtime using IRunningObjectTable / AutoItObjectVery Simple Inter-Process Communication (using AutoItObject Pure AutoIt) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 22, 2009 Moderators Share Posted December 22, 2009 Toda,I give my time here voluntarily and I decide what I will help with and what I will not - and I do not help bot games of any description if I become aware of it.Or is it because its just a game and not some coding program to steal your credit card number?That is pretty insulting and absolutely guarantees that you get no more help from me. Merry Christmas. 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...
Toda Posted December 22, 2009 Author Share Posted December 22, 2009 How about something like this: #include <Misc.au3> $user32 = DllOpen("user32.dll") $key = 01 ; left mouse button While 1 * Sleep(10) If _IsPressed($key,$user32) Then $t = TimerInit() Do Sleep(10) Until Not _IsPressed($key,$user32) Or TimerDiff($t) > 150 If _IsPressed($key,$user32) Then ; if still pressed ConsoleWrite("Cast Heal" & @CRLF) Sleep(1000) Else ConsoleWrite("Cast Nuke" & @CRLF) Sleep(1000) EndIf EndIf WEnd Thank you SEuBo I will try. Link to comment Share on other sites More sharing options...
Toda Posted December 22, 2009 Author Share Posted December 22, 2009 (edited) Toda,I give my time here voluntarily and I decide what I will help with and what I will not - and I do not help bot games of any description if I become aware of it.That is pretty insulting and absolutely guarantees that you get no more help from me. Merry Christmas. M23BOT?Before you suggest things you should ask questions. It is not a botting program it is simply a command I would like to make one button do one thing or the other. It is simply something to make my bad reflex's up to par with the younger generation.Sorry I took up some of your time. Edited December 22, 2009 by Toda 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