PDA

View Full Version : help with KeyDown(A2); please



Exiledbotter
08-28-2016, 10:02 PM
Hello, I've been making a bot that will copy/paste links onto notepad++

but I can't get the CTRL key to be held down, while the bot presses "V" to paste the link.

the id for Left Control key is "A2", why does this A2 code NOT work with this code "KeyDown();"

heres my code;

KeyDown(A2);
PressKey(56);
KeyUp(A2);

AFools
08-28-2016, 10:59 PM
I don't think you can cut and paste in runescape period.

** More than likely for something different to RS; hence the category it was posted in >.<

acow
08-28-2016, 11:11 PM
I don't think you can cut and paste in runescape period.
Then it's probably not being used in runescape..

@op, I've used ctrl before...can't remember what exactly I used that worked for me, I'll go find the script in a bit for ya once I'm done w/ some st00f

Aspect
08-28-2016, 11:33 PM
Make sure you press the v key before the KeyUP command for ctrl. You might also want to try the Right control button to see if anything changes.
This might seem obvious, but just in case.


begin
KeyDown(A2);
wait(RandomRange(50, 100));
PressKey(83);
wait(RandomRange(50, 100));
KeyUp(A2);
end.

Rishi
08-28-2016, 11:53 PM
procedure Paste;
begin
keyDown(17);
PressKey(86);
keyUp(17);
end;


That seems to work for me. I guess the documentation may be incorrect or the key code may be different for your each computer.

A good way to check what a character is by using this:


writeln(GetKeyCode('v'));


That will give the key code for v. In my case, it gave 86.

Citrus
08-29-2016, 12:02 AM
56 is the hex value. The documentation isn't really clear, but some are given in hex and some in dec.
So you can use 56$ or 86.

acow
08-29-2016, 12:39 AM
What I used before is the same as what Rishi posted ^
keyUp(17)

This link should help w/ other keys
https://msdn.microsoft.com/en-us/library/aa243025(v=vs.60).aspx