Results 1 to 16 of 16

Thread: Mouse-keys simulated dropping

  1. #1
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default Mouse-keys simulated dropping

    Heya,

    So a few people have been asking around about the possibility of making Simba use Mouse-Keys for obvious reasons in their scripts. Although I'm not entirely sure if Simba has the ability to do this or not, I've tried many, many times and failed to use real mouse keys through Simba. So instead, using YoHoJo's original idea, I've make a quick-'n-dirty fake mouse-keys dropper.

    If you've ever used mouse-keys for dropping items in Runescape you'll notice the mouse is actually not moved from an item to the "Drop" option; it's instantly moved there. This would rule out using procedures like MMouse. Instead I've used the original MoveMouse as it seems to do the trick perfectly.

    Also the standard clicking is a bit slow to truly simulate real mouse keys for dropping, so I've included a slightly faster ClickMouse2. It works the same way, just faster and with a different name.

    Simba Code:
    procedure FastClick(button: variant);
      var
        a,b,c : integer;
        iButton: Integer;
      begin
        if (button) then
          iButton := mouse_left
        else
          iButton := mouse_right;

        GetMousePos(b, c);

        HoldMouse(b, c, iButton);

        for a := 0 to 2 do
          Wait(20 + Random(30));

        GetMousePos(b, c);
        ReleaseMouse(b, c, iButton);
      end;

    By default, this procedure will drop slot 5 and down in column 1, slot 2 and down in column 2, 3 and down in column 3, and slot 4 and down in column 4.

    Parameters:
    C1S: Slot to start from on column 1
    C2S: Slot to start from on column 2
    C3S: Slot to start from on column 3
    C4S: Slot to start from on column 4

    Simba Code:
    procedure MKDrop(C1S, C2S, C3S, C4S: Integer);
      var
        i,x,y,MS: integer;
        MP: TPoint;
      begin
        MS := MouseSpeed;
        MouseSpeed := 20;
      {Column 1}
        MP := MiddleBox(InvBox(C1S));
        //BrakeMMouse(MP.x, MP.y-6, 8, 3);
        MMouse(MP.x, MP.y-6, 8, 3);

        for i := 1 to 5 do  //Change 5 to how many items 'below' to drop
        begin
          FastClick(False);
          GetMousePos(x, y);
          MoveMouse(x, y+40);
          FastClick(True);
        end;

      {Column 2}
        MP := MiddleBox(InvBox(C2S));
        //BrakeMMouse(MP.x, MP.y-6, 8, 3);
        MMouse(MP.x, MP.y-6, 8, 3);

        for i := 1 to 6 do
        begin
          FastClick(False);
          GetMousePos(x, y);
          MoveMouse(x, y+40);
          FastClick(True);
        end;

        {Column 3}
        MP := MiddleBox(InvBox(C3S));
        //BrakeMMouse(MP.x, MP.y-6, 8, 3);
        MMouse(MP.x, MP.y-6, 8, 3);

        for i := 1 to 6 do
        begin
          FastClick(False);
          GetMousePos(x, y);
          MoveMouse(x, y+40);
          FastClick(True);
        end;

        {Column 4}
        MP := MiddleBox(InvBox(C4S));
        //BrakeMMouse(MP.x, MP.y-6, 8, 3);
        MMouse(MP.x, MP.y-6, 8, 3);

        for i := 1 to 6 do
        begin
          FastClick(False);
          GetMousePos(x, y);
          MoveMouse(x, y+40);
          FastClick(True);
        end;

        MouseSpeed := MS;
      end;

    You will need to do editing to change how many slots in each column to drop.

    http://www.youtube.com/watch?v=JqWp_yC3DJ0
    Thanks masterBB for telling me the correct way to include a video. :P

    Again, if you don't know what MouseKeys are or would like to compare mine to the real thing, you can view this page.

    If you have any questions post here because it may be a bit unclear on defining how many slots per column to drop.
    Last edited by Flight; 06-13-2012 at 02:17 AM.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Glad this has been made!
    Will try later and let you know!

    For those who don't know - mouse keys are simply an uber-fast-way to drop the items in your inventory.

  3. #3
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    in real mouse key there is still blank inputs for the 2,5,4,6,8 and i wonder if java can actually detect if they are pressed or not (even thou its not typing anything thing).
    Oh Hai Dar

  4. #4
    Join Date
    May 2012
    Posts
    190
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im guessing we dont have to use this just for SMART do we?
    BOT TILL YOU DROP!

  5. #5
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Main View Post
    in real mouse key there is still blank inputs for the 2,5,4,6,8 and i wonder if java can actually detect if they are pressed or not (even thou its not typing anything thing).
    That's the only thing I'm concerned about.

    Quote Originally Posted by ABC! View Post
    Im guessing we dont have to use this just for SMART do we?
    Not at all, none of it is directly related to SMART.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #6
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Someone has an herb cleaner on here that can clean 13k ish herbs per hour (or so I have read, never actually used it), as far as I knew this was only possible with mouse keys, so how did they manage to bump the speed of other mouse functions so drastically?

  7. #7
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default



    [.YOUTUBE]JqWp_yC3DJ0[/YOUTUBE]

    edit:
    Also fixed the standards slightly. A variant seems unnecessary if you don't use it.
    Simba Code:
    procedure FastClick(button: Boolean);
    var
      x, y: integer;
      iButton: Integer;
    begin
      if (button) then
        iButton := mouse_left
      else
        iButton := mouse_right;

      GetMousePos(x, y);
      HoldMouse(x, y, iButton);

      Wait(RandomRange(60, 90));

      GetMousePos(x, y);
      ReleaseMouse(x, y, iButton);
    end;
    Last edited by masterBB; 06-12-2012 at 08:59 AM.
    Working on: Tithe Farmer

  8. #8
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    [.YOUTUBE]JqWp_yC3DJ0[/YOUTUBE]
    Ahh thank you very much. I've obviously never used that before.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  9. #9
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Made a small mistake:

    Simba Code:
    procedure FastClick(button: Boolean);
    var
      x, y: integer;
      iButton: Integer;
    begin
      if (button) then
        iButton := mouse_left
      else
        iButton := mouse_right;

      GetMousePos(x, y);
      HoldMouse(x, y, iButton);

      Wait(RandomRange(60, 150));

      GetMousePos(x, y);
      ReleaseMouse(x, y, iButton);
    end;
    Working on: Tithe Farmer

  10. #10
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Thanks for that video masterbb, really demonstrates just how fast and effective this is

  11. #11
    Join Date
    Dec 2011
    Location
    USA
    Posts
    362
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I remember reading about MouseKeys way back when on the official forums. I thought that they had a way to tell if you are actually using mousekeys. Love the idea of mimicking it though, its dang fast!
    Currently: Very busy
    Future Goals: finish nursing school, RS later.

  12. #12
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by JN13 View Post
    I remember reading about MouseKeys way back when on the official forums. I thought that they had a way to tell if you are actually using mousekeys. Love the idea of mimicking it though, its dang fast!
    Absolutely. No matter how many bots say they are using mousekeys, they aren't. The reason for this is that no matter what, they all somehow implement a mouse function which sends clicks to the canvas at specific positions. Jagex can obviously detect these clicks.

    Mousekeys sends a different mouse message.

    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx A reference to the MouseKeys Structure.

    http://en.wikipedia.org/wiki/Mouse_keys A reference to the formula used.

    You can test this by doing SendInput or SendMessage to see if a mouse button is down or up. If the mouse is Up and the application is recieving a click, then the user is using mousekeys. If the mouse is down and the application is recieving clicks then of course the user is using a mouse and not mousekeys. When you implement the mousekeys structure, the BM_CLICK message doesn't register. At least on my comp it doesn't and WM_KeyDown/WM_MouseDown doesn't register either. But when I click with the mouse, it does. ClickMouse and ClickMouse2 always send a message similar to WM_MouseDown on windows.


    Though flight did do a good job of simulating it.
    Last edited by Brandon; 06-13-2012 at 12:52 AM.
    I am Ggzz..
    Hackintosher

  13. #13
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    I'm not sure, but wouldn't these be helpful to have added to Simba's keyboard file?
    Code:
    NumpadDot, NumpadDiv, NumpadMult, NumpadAdd, NumpadSub, NumpadEnter
    I'm no expert, (let alone a novice) on mouse keys, but wouldn't adding those help set the no. pad 5's action when wanting to left&right click simultaneously (via use of setting with NumpadMult I think)? Then again, I get lost in how to set the speed without directly opening up the mouse keys window in windows os. :<

  14. #14
    Join Date
    Jul 2012
    Location
    Estonia, dont try to find it from the map its a cave!
    Posts
    60
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Hmm didnt quite get it however my goal is not to use this function to drop I wanna buy runes with this function instead from npcs so not sure how to do that exactly I wish some1 had video tutorial on this explaining every single line.
    and yeah Im beginner scripter been doing basic scripts for about 1 month now.

  15. #15
    Join Date
    Aug 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i would like to appreciate you for sharing such a great info with us

  16. #16
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    ---
    Last edited by Hoodz; 08-22-2013 at 10:36 AM. Reason: gravedig

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
  •