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