Jump to content

ControlSend


jace808
 Share

Recommended Posts

Trying to make something that will hold down the space bar while a certain area is blue and when its red the space bar is released. I see there is a command Send("{SPACE down}") which is exactly what I need, but the game I'm playing has gameguard. I have no problems sending keys with ControlSend however I don't see an option like with Send to hold down a key. Can someone enlighten me how I can make this work? Send doesn't work like ControlSend at least with 2moons and gameguard.

P.S. This is unfinished code.

; 1280x1024 [32]
; BLUE  0x3569B8
; RED   0xBC0000

sleep(2500)

Do

    ControlSend("2Moons","","","{l}"); L START FISHING
    sleep(500)
    MouseClick("left"); CAST IN TO WATER
    sleep(5000)

DO
    
    $coord = PixelSearch (123, 142, 323, 148, 0x3569B8); CHECK FISH NOT FIGHT (BLUE)

    If not @error then
        ControlSend("2Moons","","","{SPACE down}"); REEL IN FISH
    ;Send("{SPACE down}")
    endif
    
    $coord = PixelSearch (123, 142, 323, 148, 0xBC0000); CHECK FISH FIGHTING (RED)

    If not @error then
        ControlSend("2Moons","","","{SPACE up}"); REEL IN FISH
    ;Send("{SPACE up}")
    endif
    
UNTIL $i = 2
Link to comment
Share on other sites

from the help file:

To hold a key down (generally only useful for games)

Send("{a down}") ;Holds the A key down

Send("{a up}") ;Releases the A key

Yes. As I stated, this works but NOT in 2moons with gameguard. I can only use ControlSend with success. But thanks anyway.

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