Results 1 to 7 of 7

Thread: help with KeyDown(A2); please

  1. #1
    Join Date
    Apr 2016
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default help with KeyDown(A2); please

    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);

  2. #2
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    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 >.<

    <------------------>



  3. #3
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    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

  4. #4
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    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.

  5. #5
    Join Date
    Aug 2016
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Code:
    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:
    Code:
    writeln(GetKeyCode('v'));
    That will give the key code for v. In my case, it gave 86.

  6. #6
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    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.

  7. #7
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    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/lib...(v=vs.60).aspx

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •