Jump to content

Double Tap to change macro


Toda
 Share

Recommended Posts

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 by Toda
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

  • Moderators

Toda,

Its for the game Darkfall

Sorry, not interested any more. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Toda,

Sorry, not interested any more. ;)

M23

Why? 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

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
Link to comment
Share on other sites

  • Moderators

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. :evil:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

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. :evil:

M23

BOT?

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 by Toda
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...