Jump to content

N00b Question !


DrLouie
 Share

Recommended Posts

Well i made a simple script to convert my F key in DOWN - RIGHT - E but the problem is that it keeps looping i mean if i hold F it keeps doing it and is there any way i can make it so it doesnt loop so i just have to press it every time it does down - right -e? its for a simple fighting game

Func f()

send("{DOWN}")

sleep(19)

Send("{LEFT}")

sleep(19)

Send("e")

EndFunc

Link to comment
Share on other sites

Well i made a simple script to convert my F key in DOWN - RIGHT - E but the problem is that it keeps looping i mean if i hold F it keeps doing it and is there any way i can make it so it doesnt loop so i just have to press it every time it does down - right -e? its for a simple fighting game

Func f()

send("{DOWN}")

sleep(19)

Send("{LEFT}")

sleep(19)

Send("e")

EndFunc

Have a look at _IsPressed in the help file

Either of these to methods should achieve what you require.

Method 1

#Include <Misc.u3>

HotKeySet("f","f")

While 1
        Sleep(100)  
WEnd

Func f()
    HotKeySet("f")
    send("{DOWN}")
    sleep(19)
    Send("{LEFT}")
    sleep(19)
    Send("e")
    While _IsPressed("46")
        Sleep(100)
    WEnd
    HotKeySet("f","f")
EndFuncoÝ÷ ØÇ­vjëh×6#Include <Misc.u3>

HotKeySet("f","f")

While 1
        Sleep(100)  
WEnd


Func f()
    BlockInput(1)
    send("{DOWN}")
    sleep(19)
    Send("{LEFT}")
    sleep(19)
    Send("e")
    While _IsPressed("46")
        Sleep(100)
    WEnd
    BlockInput(0)
EndFunc

Bowmore

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

Have a look at _IsPressed in the help file

Either of these to methods should achieve what you require.

Method 1

#Include <Misc.u3>

HotKeySet("f","f")

While 1
        Sleep(100)  
WEnd

Func f()
    HotKeySet("f")
    send("{DOWN}")
    sleep(19)
    Send("{LEFT}")
    sleep(19)
    Send("e")
    While _IsPressed("46")
        Sleep(100)
    WEnd
    HotKeySet("f","f")
EndFuncoÝ÷ ØÇ­vjëh×6#Include <Misc.u3>

HotKeySet("f","f")

While 1
        Sleep(100)  
WEnd
Func f()
    BlockInput(1)
    send("{DOWN}")
    sleep(19)
    Send("{LEFT}")
    sleep(19)
    Send("e")
    While _IsPressed("46")
        Sleep(100)
    WEnd
    BlockInput(0)
EndFunc

So what am i doing wrong?

Link to comment
Share on other sites

BlockInput(1)
    send("{DOWN}")
    sleep(19)
    Send("{LEFT}")
    sleep(19)
    Send("e")
    While _IsPressed("46")
        Sleep(100)
    WEnd
    BlockInput(0)

I would like to point out that _IsPressed with always return false in this state, because the user cannot "press" a key when they are blocked.

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