Sign in to follow this  
Followers 0
DrLouie

N00b Question !

6 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

add "#Include <Misc.Au3>" to the top of ur script


There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

why not just change it to activate when you press the button down. wouldnt this cause it to only activate once per press?

Share this post


Link to post
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
Sign in to follow this  
Followers 0