PDA

View Full Version : Mouse-keys simulated dropping



Flight
06-12-2012, 06:05 AM
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.


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


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

JqWp_yC3DJ0

Again, if you don't know what MouseKeys are or would like to compare mine to the real thing, you can view this (http://runescape.wikia.com/wiki/Mouse_keys) page.

If you have any questions post here because it may be a bit unclear on defining how many slots per column to drop.

Abu
06-12-2012, 06:40 AM
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.

Main
06-12-2012, 06:50 AM
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).

ABC!
06-12-2012, 06:59 AM
Im guessing we dont have to use this just for SMART do we?

Flight
06-12-2012, 07:26 AM
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.


Im guessing we dont have to use this just for SMART do we?

Not at all, none of it is directly related to SMART.

Hazzah
06-12-2012, 08:08 AM
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?

masterBB
06-12-2012, 08:22 AM
JqWp_yC3DJ0

[.YOUTUBE]JqWp_yC3DJ0[/YOUTUBE]

edit:
Also fixed the standards slightly. A variant seems unnecessary if you don't use it.
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;

Flight
06-12-2012, 08:54 AM
[.YOUTUBE]JqWp_yC3DJ0[/YOUTUBE]

Ahh thank you very much. I've obviously never used that before. :huh:

masterBB
06-12-2012, 09:10 AM
Made a small mistake:

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;

Abu
06-12-2012, 10:45 PM
Thanks for that video masterbb, really demonstrates just how fast and effective this is :)

JN13
06-13-2012, 12:21 AM
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!

Brandon
06-13-2012, 12:50 AM
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/library/windows/desktop/dd373593%28v=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.

Le Jingle
06-23-2012, 08:31 AM
I'm not sure, but wouldn't these be helpful to have added to Simba's keyboard file?
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. :<

kriss1993
06-27-2013, 12:32 AM
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.

honey
08-22-2013, 05:55 AM
i would like to appreciate you for sharing such a great info with us

Hoodz
08-22-2013, 10:18 AM
---