Sign in to follow this  
Followers 0
Golbez

send key question

8 posts in this topic

#1 ·  Posted (edited)

i play a game where is w is pressed twice you jump foward.. i want trying to make a program so when i press w once the program will send the game the second w... i cant seem 2 get it 2 work..

this what i got so far..

Global $game = IniRead("shoot.ini", "Other", "game", "NotFound")
Global $ek = IniRead("shoot.ini", "Other", "killkey", "NotFound")
Global $jk = IniRead("shoot.ini", "Other", "jumpkey", "NotFound")
Global $del = IniRead("shoot.ini", "Other", "delay", "NotFound")

$jk = "{W}"
$ek = "{END}"
HotKeySet($ek, "Terminate")
HotKeySet($jk, "wpressed")
IF WinActive ( $game ) = 0 Then WinActivate($game )

While 1

WEnd

Func wpressed()
    ControlSend ($game, "","", ($jk))
   ;send ($jk)
EndFunc
Func Terminate()
    Exit 0
EndFunc
Edited by Golbez

Share this post


Link to post
Share on other sites



HotKeySet('w', '_WFunction')
While 1
    Sleep(1000)
WEnd

Func _WFunction()
    HotKeySet('w')
    Send('ww')
    HotKeySet('w', '_WFunction')
EndFunc


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i play a game where is w is pressed twice you jump foward.. i want trying to make a program so when i press w once the program will send the game the second w... i cant seem 2 get it 2 work..

this what i got so far..

Do you really need to INIRead to do this?

HotKeySet("w", "DoubleW")

While 1
Sleep(1000)
Wend

Func DoubleW()
Send("{w}")
EndFunc
Edited by Paulie

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

hmm eather that dont work or its blocked..

im goen its blocked...

Opt("SendKeyDelay", 1)      ;1 milliseconds
Opt("SendKeyDownDelay", 1)  ;1 millisecond
Global $game = IniRead("shoot.ini", "Other", "game", "NotFound")
Global $ek = IniRead("shoot.ini", "Other", "killkey", "NotFound")
Global $del = IniRead("shoot.ini", "Other", "delay", "NotFound")
Global $sk = IniRead("shoot.ini", "Other", "startkey", "NotFound")


Global $jk = 'w'
HotKeySet($ek, "Terminate")
HotKeySet($jk, "_WFunction")
HotKeySet($sk, "shoot")
IF WinActive ( $game ) = 0 Then WinActivate($game )


While 1
    Sleep(100)
WEnd

Func shoot()
    If $y = 0 then
        $y = 1
        While 1
            ControlSend ($game, "", "{LCTRL}")
            sleep ($del)
            If $y = 1 then ExitLoop
        WEnd
    Else
        MsgBox (0,"pressed", $sk + " presed", 1)
        $y = 0
    EndIf
EndFunc
Func _WFunction()
    HotKeySet($jk)
    Send('WW')
    HotKeySet($jk, '_WFunction')
EndFunc
Func Terminate()
    Exit 0
EndFunc

this is the current code.. if possable can u fix what i did with the shoot function..

i wanted it 2 be so if i pressed the key again it would stop but i could figure it out :whistle:

edit: yeah i think its blocked... it Works in Word but doesnt Work ingame.. thanx guys... but if possable can u tell me how 2 fix the shoot funtion

Edited by Golbez

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Golbez...

1. If you had bothered to just try mine by itself, you would have seen it would have worked.

2. Paulies won't work because all it will do is send w forever.

3. If this is the same game, how much tourment are you going to put us and the yourself through before you realize that your game is blocking whatever you try to do? I've told you this already but you persist thinking some magical answer is going to solve your issue. Short of you programming a RObot to manually press all your keys for you and not simulate keys, you had better figure a way to hack the game blocker they are using.

Edit:

Where do you guys figure that regular character keys need the curly brackets around them?

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

i did try yours... and 2 it didnt work ingame...

i got the shoot thing 2 work..

i had 2 press the key while the game was minimized...

n im sry if i affended u in anyway i did not mean 2..

i sry

-Golbez

edit: just wanted u 2 see the code.

Opt("SendKeyDelay", 1)       ;1 milliseconds
Opt("SendKeyDownDelay", 1)   ;1 millisecond
Dim $shot = 0
Global $game = IniRead("shoot.ini", "Other", "game", "NotFound")
Global $ek = IniRead("shoot.ini", "Other", "killkey", "NotFound")
Global $del = IniRead("shoot.ini", "Other", "delay", "NotFound")
Global $sk = IniRead("shoot.ini", "Other", "startkey", "NotFound")


Global $jk = 'w'
HotKeySet($ek, "Terminate")
HotKeySet($jk, "DoubleW")
HotKeySet($sk, "Shoot")
While 1
    Sleep(100)
    If $shot = 1 Then
        For $shuot = 1 to 1
            If $shot = 0 Then ExitLoop
            IF Not WinActive($game) Then WinActivate($game)
            Send ("{LCTRL}")
            sleep ($del)
        Next
    EndIf
WEnd
Func Shoot()
    If $shot = 0 Then
        $shot = 1
    Else
        $shot = 0
    EndIf
EndFunc
Func DoubleW()
    HotKeySet($jk)
    Send('WW')
    HotKeySet($jk, '_WFunction')
EndFunc
Func Terminate()
    Exit 0
EndFunc
Edited by Golbez

Share this post


Link to post
Share on other sites

i did try yours... and 2 it didnt work ingame...

i got the shoot thing 2 work..

i had 2 press the key while the game was minimized...

n im sry if i affended u in anyway i did not mean 2..

i sry

-Golbez

I'm not offended... your just beating a dead horse IMHO. Mine does work, run it in SciTe by itself... and you'll see.

Replace ControlSend() with Send() with my example, if ControlSend() is working for you then it will work with my example as well.

What game is this anyway, people can tell you whether or not your barking up the wrong tree, and if you are, how to bark louder to get actual results.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

www.gunzonline.com (its like a rpg fps)

theres a glitch in a way..

if u have your swords out and u jump,dash (ww thing) then attack really fast over n over u fly..

but its hard to do cause you have to time the dash perfect

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