[OSRS] Mousekey dropping

Discussion in 'Developer Support' started by Geashaw, Feb 26, 2015.

  1. Geashaw

    Joined:
    Jan 8, 2015
    Messages:
    985
    Likes Received:
    169
    Would anyone be willing to help me out by spoonfeeding code? I did find this (credits to Github);

    Code (Java):
    1. public void useMouseKeys() {
    2.     for (int col = 0; col < 4; col++) {
    3.         int mouseX = (ctx.backpack.getItemAt(col).getComponent().getCenterPoint().x + Random.nextInt(-10, 10));
    4.         int rowOffset = Random.nextInt(-10, 10);
    5.         int mouseY = (ctx.backpack.getItemAt(col).getComponent().getCenterPoint().y + rowOffset);
    6.         ctx.mouse.move(mouseX, mouseY);
    7.         for (int row = 0; row < 7; row++) {
    8.             ctx.mouse.hop(mouseX, ctx.backpack.getItemAt(row * 4 + col).getComponent().getCenterPoint().y + rowOffset);
    9.             this.sleep(85, 100);
    10.             ctx.mouse.click(false);
    11.             while (!ctx.menu.isOpen()) {
    12.                 this.sleep(85, 100);
    13.             }
    14.             String[] acts = ctx.menu.getItems();
    15.             for (int a = 0; a < acts.length; a++) {
    16.                 if (acts[a].contains("Drop")) {
    17.                     this.sleep(80, 100);
    18.                     ctx.mouse.click(true);
    19.                 }
    20.             }
    21.         }
    22.     }
    23. }
     
  2. PhaseCoder

    Joined:
    Jan 1, 2015
    Messages:
    270
    Likes Received:
    25
    leme take a look brb
     
  3. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,779
    Likes Received:
    731
    If you explain to me how mousekeys work and how to use them legit I can write the code whenever I find a spare moment.
     
  4. Geashaw

    Joined:
    Jan 8, 2015
    Messages:
    985
    Likes Received:
    169
    @SlashnHax Mousekey dropping means it clicks on the first item on the top left (the actual first item) and goes down. Then to the second column and down again, etc.

    Any ideas?
     
  5. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,779
    Likes Received:
    731
    Oh, so pretty much going vertical instead of horizontal?
     
  6. PhaseCoder

    Joined:
    Jan 1, 2015
    Messages:
    270
    Likes Received:
    25
    Well mousekeys like hop the mouse, this api doesn't support Mouse#hop the best i came up with was droping from different colloms, like

    from 4 to 0
    5 to 8
    12 to 16

    etc etc

    and from 28 to 4
    3 to 27 etc

    or 4 to 28
    27 to 3
     
  7. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,779
    Likes Received:
    731
    Just loop through the items and skip 4 each time?
     
  8. PhaseCoder

    Joined:
    Jan 1, 2015
    Messages:
    270
    Likes Received:
    25

    with mousekeys you never drop the last row tho
    not it doesnt work like that it hops to "Drop"
     
  9. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,779
    Likes Received:
    731
    Are mousekeys something that's able to be done legit?
    --- Double Post Merged, Mar 2, 2015, Original Post Date: Mar 2, 2015 ---
    Hopping can be done, but it's really not recommended at all.
     
  10. PhaseCoder

    Joined:
    Jan 1, 2015
    Messages:
    270
    Likes Received:
    25

    Yea osbuddy has it as default feature, or youtube it for rs and you will see.
     
  11. Geashaw

    Joined:
    Jan 8, 2015
    Messages:
    985
    Likes Received:
    169
    @PhaseCoder I'll probably post a video this evening
    --- Double Post Merged, Mar 2, 2015, Original Post Date: Mar 2, 2015 ---
    @PhaseCoder
     
  12. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,779
    Likes Received:
    731
    Hmmm, if I were to do it I'd feel like I'd have to send the keypresses as well just to be safe haha, mouse hopping is one thing, and that can be explained by mousekeys, but without the keypresses it could be a bit dangerous.
     

Share This Page

Loading...