send - command doesn't work in minecraft

04/30/2013 14:43 zerox3015#1
Hey,
i'm new to autoit and wanted to start of by writing a script that's supposed to do knothing but let the minecraft figure run and jump over a hole, but my problem is it stops running before jumping and space also isn't pressed every time

Code:
#include <Misc.au3>

$letter = "4a" ;"j"

while 1
   
while _IsPressed($letter)=0 ;start script when "j" is pressed
   sleep(10)
WEnd

send("w")
send("{w down}") ;double w -> run
sleep(200)
send("{SPACE}") ;jump
sleep(200)
send("{w up}")

WEnd
thx in advance:D
zerox
04/30/2013 15:42 Achat#2
Put
Code:
#requireadmin
ontop of your script. Sometimes it helps.

Kind Regards
05/01/2013 11:34 zerox3015#3
I already tried, didn't work for me..-.-
But thanks for your quick answer:D
05/01/2013 12:49 YatoDev#4
Code:
#RequireAdmin
#include <Misc.au3>

$letter = "4a" ;"j"

while 1
   
while _IsPressed($letter) ;start script when "j" is pressed
   sleep(10) ;script do this if letter is pressed
WEnd

send("w")
send("{w down}") ;double w -> run
sleep(200)
send("{SPACE}") ;jump
sleep(200)
send("{w up}")

WEnd
isnt this better ?
Code:
#RequireAdmin
#include <Misc.au3>

$letter = "4a" ;"j"

while 1

If _IsPressed($letter) Then ;start script when "j" is pressed
   sleep(10) ;script do this if letter is pressed
Else
;if not is pressed then do this
send("w")
send("{w down}") ;double w -> run
sleep(200)
send("{SPACE}") ;jump
sleep(200)
send("{w up}")
EndIf
WEnd
05/01/2013 22:04 Croco™#5
Try it with ControlSend.
05/04/2013 22:41 FacePalmMan#6
4A is j as a capital letter. keyboards don't return capital letters. try 6A instead of 4A!