AHK knight online Script Need Help Topic is solved

Ask gaming related questions (AHK v1.1 and older)
k0olpka
Posts: 5
Joined: 13 Jun 2017, 09:00

AHK knight online Script Need Help

13 Jun 2017, 09:23

Can some help me make a code for a game knight online
i want to be able to press Q
to do the following:
(3) then 0.3 or 0.4 second delay then (W) move just once to cancel animation skill for 3 then it should stop.
so if i press Q this happen 3 (0.3sec delay) W move. that way when i ever i press Q this following keystrokes should happen. i dont want on\off switch




also i need Minor skill combo with key bind on 0 to do 8+9+0 1 after the other as fast as possible and should be repeated 5 times
example : i press 0 once, action done => 890890890890890 really quickly then stops.

i hope someone can do it for me thanks.
User avatar
DyaTactic
Posts: 221
Joined: 04 Apr 2017, 05:52

Re: AHK knight online Script Need Help

15 Jun 2017, 08:37

Code: Select all

SendMode, Input

q::	; Press Q to activate.
	SEND, 3	; Use skill.
	SLEEP 300
	SEND, w	; Walk to cancel animation.
	Return	; Stop.
	
$0::	; Press 0 to activate. $ makes sure the hotkey is not triggered by autohotkey keystrokes.
	Loop 5	Do everything between { and } 5 times.
	{
		SEND, 890	; Shoot skills 8, 9 and 0.
	}
	Return	; Stop.
Let me know if this works. I can imagine the keystrokes of 890 are too fast for the game to register correctly. This is different for each game.
k0olpka
Posts: 5
Joined: 13 Jun 2017, 09:00

Re: AHK knight online Script Need Help

15 Jun 2017, 14:41

DyaTactic wrote:

Code: Select all

SendMode, Input

q::	; Press Q to activate.
	SEND, 3	; Use skill.
	SLEEP 300
	SEND, w	; Walk to cancel animation.
	Return	; Stop.
	
$0::	; Press 0 to activate. $ makes sure the hotkey is not triggered by autohotkey keystrokes.
	Loop 5	Do everything between { and } 5 times.
	{
		SEND, 890	; Shoot skills 8, 9 and 0.
	}
	Return	; Stop.
Let me know if this works. I can imagine the keystrokes of 890 are too fast for the game to register correctly. This is different for each game.
they both they don't work, first one wont register in-game but, rather it would on note pad just fine but in-game nothing,
2nd one wont work anywhere at all

i tried to make

SendMode, Input

0:: ; Press 0 to activate.
SEND, 8 ; Use skill.
SLEEP 50
SEND, 9 ; Use skill.
SLEEP 50
SEND, 0 ; Use skill.
SLEEP 50
SEND, 8 ; Use skill.
SLEEP 50
SEND, 9 ; Use skill.
SLEEP 50
SEND, 0 ; Use skill.


Return ; Stop.
which should do the combo twice
instead on text it went on press spree of 89898989 nonstop
User avatar
DyaTactic
Posts: 221
Joined: 04 Apr 2017, 05:52

Re: AHK knight online Script Need Help

15 Jun 2017, 15:31

This is the first thing I see missing in my script. The comments on the line with Loop 5 were not commented, i.e. ; was missing.
Surprisingly enough this did not create an error message. I belive it is fixed now.

Code: Select all

SendMode, Input

q::	; Press Q to activate.
	SEND, 3	; Use skill.
	SLEEP 300
	SEND, w	; Walk to cancel animation.
	Return	; Stop.
	
$0::	; Press 0 to activate. $ makes sure the hotkey is not triggered by autohotkey keystrokes.
	Loop 5	; Do everything between { and } 5 times.
	{
		SEND, 890	; Shoot skills 8, 9 and 0.
	}
	Return	; Stop.
The code you wrote tiggers itself with every SEND, 0 line. Thats why it keeps running. And the zero's which should appear in notepad don't due to the hotkey 0::. You can use $0:: instead.

Is the game running with administrator privilege? This means that Autohotkey should so too.
Let me know what you find.
k0olpka
Posts: 5
Joined: 13 Jun 2017, 09:00

Re: AHK knight online Script Need Help

16 Jun 2017, 01:09

DyaTactic wrote: The code you wrote tiggers itself with every SEND, 0 line. Thats why it keeps running. And the zero's which should appear in notepad don't due to the hotkey 0::. You can use $0:: instead.

Is the game running with administrator privilege? This means that Autohotkey should so too.
Let me know what you find.
i have tried running the new code with administrator privilege and it seem that the first combo q= 3w does not register at all in-game.

the 2nd part seems to work on the in-game chat but it wont actually presses any of heal skills 890 when not typing in-game chat.
if there is nothing to do with the code it's fine i greatly appreciate your time trying to help me
User avatar
DyaTactic
Posts: 221
Joined: 04 Apr 2017, 05:52

Re: AHK knight online Script Need Help

16 Jun 2017, 02:38

That sounds like the game can differentiate real key presses and fake ones. Possibly as an anti scripting safety. However I have never seen it this way.
User avatar
DyaTactic
Posts: 221
Joined: 04 Apr 2017, 05:52

Re: AHK knight online Script Need Help  Topic is solved

16 Jun 2017, 02:53

This makes the script act more slowly just like when we are pressing the buttons. Possibly this works.

Code: Select all

SendMode, Input
HumanDelay := 40	; Sleep amount in ms.

q::	; Press Q to activate.
	SEND, {3 Down}	; Use skill.
	SLEEP, HumanDelay
	SEND, {3 Up}
	SLEEP 300
	SEND, {w Down}	; Walk to cancel animation.
	SLEEP, HumanDelay
	SEND, {w Up}
	Return	; Stop.
	
$0::	; Press 0 to activate. $ makes sure the hotkey is not triggered by autohotkey keystrokes.
	Loop 5	; Do everything between { and } 5 times.
	{
		;SEND, 890	; Shoot skills 8, 9 and 0.
		SEND, {8 Down}
		SLEEP, HumanDelay
		SEND, {8 Up}
		SLEEP, HumanDelay
		SEND, {9 Down}
		SLEEP, HumanDelay
		SEND, {9 Up}
		SLEEP, HumanDelay
		SEND, {0 Down}
		SLEEP, HumanDelay
		SEND, {0 Up}
		SLEEP, HumanDelay
	}
	Return	; Stop.
k0olpka
Posts: 5
Joined: 13 Jun 2017, 09:00

Re: AHK knight online Script Need Help

16 Jun 2017, 07:10

nicely done @Dyatactic it's working in game now i had to
replace Q to number 3 which was the problem cz apparently it was bound in-game for targeting closest enemy how ever the time is a bit too fast so im going to fix that i might increase the sleep to 500.

as for the 2nd one worked just fine but it is awfully slow, if i change human delay from 40 to let say 120 would it affect the first code?? or better yet i could split the code into two different scripts.

on skill 890 i have 8 = mana potion cooldown 1 maybe, 9+0 are heal skill (same skill) cooldown about 0.1 sec i wanted it to make human delay maybe 10 or 15 does that sound right??
k0olpka
Posts: 5
Joined: 13 Jun 2017, 09:00

Re: AHK knight online Script Need Help

16 Jun 2017, 07:45

OK now its working fine,
I have changed sleep to 520 the sweet spot (human delay 10 timing managed included) for the 3w animation canceling. As for 890 changed human delay to 10 which is good for me, thank you for making the code you are the best.

Now i can make different scripts based on that code appreciate your help.
User avatar
DyaTactic
Posts: 221
Joined: 04 Apr 2017, 05:52

Re: AHK knight online Script Need Help

17 Jun 2017, 16:15

I am glad I could help. You are most welcome.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 32 guests