SRL Archive - General Botting Help

Question about pressing 2 keys at once


Smitty

2013-12-16 19:43:07

ok so i just started doing this again after being gone for quite a while so im probably just making a beginners mistake. But my problem is i need to press the Left Arrow key and keep it held then press the D button. my script runs but it doesn't execute it right. so do i have the correctly written or what can i change?

procedure RockHitLeft;
begin
KeyDown (37); // this is Left Arrow key being pressed
wait (22);
KeyDown (44); // this is D key being pressed
wait (RandomRange (212,218));
KeyUp (37);
wait (RandomRange (23,44));
KeyUp (44);
end;

Smitty

2013-12-16 21:39:08

figured out that the scripting references page about virtual keyboard is wrong, i just looked for ASCII codes

still would like if someone critiqued my script tho

Kevin

2013-12-17 16:29:49

Since there's not much of a script here, it's hard to critique much, but I'll point out what I can (as a side note, welcome back after many years, and sorry I missed this yesterday). As far as "wait (22);" is concerned, I would increase the wait. It's entirely possible that the game did not update the fact your left arrow is pressed within that time - especially for a browser based game. That is about one fiftieth of a second, and in any slower game, or in any case of lag, it simply may not have had time to recognize the left arrow press (not to mention, randomness should be added at a small scale). I would probably use
wait(randomrange(08, 120));//or at least roughly this
As for anything else, so long as timing doesn't matter as a part of the game, I think the other lines should be fine.

weequ

2013-12-17 16:42:12

Do this to make the code prettier:

KeyDown(VK_LEFT);
Wait..
KeyDown(VK_D);
Wait..
KeyUp(VK_LEFT);
Wait..
KeyUp(VK_D);
VK_D is actually 68 so that might be why your code wasn't working. Another option is to use something like KeyDown(GetKeyCode('D'));