Jump to content

ispressed func prob


Coda
 Share

Recommended Posts

  • Moderators

Coda,

Just wait until the key is released before continuing - look at the example in the Help file which shows exactly how to do it.

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

1 hour ago, Melba23 said:

Coda,

Just wait until the key is released before continuing - look at the example in the Help file which shows exactly how to do it.

M23

As i said it always send space i want a way to stop it and wait until i press alt again and so one.

Link to comment
Share on other sites

  • Moderators

Coda,

Which is what I have told you above will achieve: press the key and {SPACE} is sent twice, wait for the key to be released and then continue to loop until the key is pressed again:

While 1
    ; Is the key pressed?
    If _IsPressed(12) Then
        ; Yes, so send {SPACE} twice
        Send("{Space}")
        Sleep(17)
        Send("{Space}")
        ; Now wait for the key to be released
        While _IsPressed(12)
            Sleep(10) ; Do this to stop the CPU overheating
        Wend
        ; Now the key is released, so reenter the loop
    Else
        ; No, key not pressed
        Sleep(10) ; Again do this to prevent the CPU overheating if key is not pressed
    EndIf
WEnd

And as you are calling _IsPressed in a tight loop, I would also strongly recommend opening 'user32.dll' first and using the returned handle in the $vDLL parameter.

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

5 minutes ago, Melba23 said:

Coda,

Which is what I have told you above will achieve: press the key and {SPACE} is sent twice, wait for the key to be released and then continue to loop until the key is pressed again:

While 1
    ; Is the key pressed?
    If _IsPressed(12) Then
        ; Yes, so send {SPACE} twice
        Send("{Space}")
        Sleep(17)
        Send("{Space}")
        ; Now wait for the key to be released
        While _IsPressed(12)
            Sleep(10) ; Do this to stop the CPU overheating
        Wend
        ; Now the key is released, so reenter the loop
    Else
        ; No, key not pressed
        Sleep(10) ; Again do this to prevent the CPU overheating if key is not pressed
    EndIf
WEnd

And as you are calling _IsPressed in a tight loop, I would also strongly recommend opening 'user32.dll' first and using the returned handle in the $vDLL parameter.

M23

Thanks for your effort bro but i need something to pause the script after it send the second send cuz in my game if i pressed alt it always send space

Link to comment
Share on other sites

  • Moderators

Coda,

Firstly, you have obviously not tried the code I gave you because that is exactly what it does.

Secondly I warned you here that our patience has limits, but you continue to post gamebot scripts. I am sorely tempted to ban you now, but you get one, and only one, more chance - another game-related script and you will be removed from the community.

Thread locked.

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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