SRL Archive - News and General

New 'MouseKeys' Drop Procedure


YoHoJo

2011-12-01 21:34:22

About Mousekeys:
http://runescape.wikia.com/wiki/Mouse_keys

TL;DR
Script that simulates what mousekys does.
Super fast dropping, so much better xp/hr.
Yes it's allowed and legit.
Video:
http://www.youtube.com/watch?v=i1PQlmBYOQo

Basically all OS's have a built in or downloadable function to make certain keyboard keys control the mouse. In windows it's called mousekeys. Basically you set it up and pressing 2 moves the mouse down a few pixels, and you pres 5 and it right clicks. Many legit players use this to drop entire inventories of items in a few seconds making drop time very fast so you get better xp/hr when powering a skill.

Before you ask if it's okay to use etc etc read this part of the link:
http://runescape.wikia.com/wiki/Mouse_keys#Legality
YES, it is 100% okay and acceptable and used by many players!

Back when reflections bots were around I noticed that certain scripts had the option to use mousekey drop (except they didn't ACTUALLY use mousekeys, they just used their own mouse/click procedures to look like/simulate/be as fast as actual mousekeys) which greatly helped with speed and xp/hr.

So I made my own ghetto version of this. I'm sure many of you more pro coders and 'optimize' my code better and things like that, but basically it works and gets the job done. The below code basically does exactly what mouse-keys does and is just ghetto quickly sample code. It works for dropping ores only right now, but you can replace the DTM with whatever you want.

Program MouseKeySimulator;

//{$DEFINE SMART}
{$i SRL\SRL.scar}

var
RockPattern: TIntegerArray;


Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function InvMMouse(InvSlot:Integer) : boolean;
Var
TB: TBox;
CurrPT : TPoint;
Begin
result := false;
GameTab(tab_inv);
Result := true;
Writeln('InvMousing:' + IntToStr(InvSlot));
TB := InvBox(InvSlot);
GetMousePos(CurrPT.x,CurrPT.y);
If PointInBox(CurrPT,TB) Then
MouseBox(Max(CurrPT.x-random(2),TB.x1),Max(CurrPT.y-random(2),TB.y1),
Min(CurrPT.x+random(2),TB.x2),Min(CurrPT.y+random(2),TB.y2),3) //LOL Pro-human much!
Else
MouseBoxEx(TB.X1, TB.Y1, TB.X2, TB.Y2,14, 3);
End;

Procedure MouseKeyDrop;
var
I, X, Y, OreMid: Integer;
SlotBox:TBox;
Begin
RockPattern:=[1,5,9,13,17,21,2,6,10,14,18,22,3,7,11,15,19,23,4,8,12,16,20,24];
OreMid := DTMFromString('78DA63CC626260E0606440054C601226CA584' +
'C849A3C209F8F809A6C209F19BF1A00AD2101F4');
For I:=0 to 23 Do
Begin
StatsGuise('Dropping Ores: ' + IntToStr(I));
SlotBox:=InvBox(RockPattern[I]);
If FindDTm(OreMid, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
Writeln('dtm found');
Writeln('I is:' + IntToStr(I));
If InIntArray([0,6,12,18], I) Then
Begin
Writeln('TopBox');
//InvMMouse(RockPattern[I]);
MMouse(X, Y, 5, 3);
End;
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
WaitOptionMultiEx(['Us'], 'item', Nothing, 5000);
MoveMouse(X, Y+40);
GetMousePos(X, Y);
ClickMouse(X, Y, mouse_Left);
Wait(50+Random(20));
End;
End;
End;

Begin
SetUpSRL;
MouseKeyDrop;
end.


Here is a video of the script in action:
http://www.youtube.com/watch?v=i1PQlmBYOQo


So enjoy, feel free to use and tweak the code to work in your scripts and enjoy you better xp rates! Pretty sure I've done a good job making it function just like mousekeys (I mouselogged myself to see exactly what mousekeys did and just turned that into pascal code to do the same thing) so it shouldn't get you banned or anything.

Note: Mousekeys nor the script can handle the bottom 4 slots because the chooseoption menu pops up in a different spot because the bottom boundary of the client. Those four slots can be dropped with whatever method you choose.

Ummm… Yeah!

Coh3n

2011-12-01 21:44:19

From: YoHoJo
Note: Mousekeys nor the script can handle the bottom 4 slots because the chooseoption menu pops up in a different spot because the bottom boundary of the client. Those four slots can be dropped with whatever method you choose.

I'm assuming that's what it's like no matter what? Legit or script?

I would make it more general for SRL. Instead of just DTM, use ItemExists, or have the scripter specify the slots to drop as a parameter.

YoHoJo

2011-12-01 21:47:37

Yeah I wasn't thinking that it would even get into SRL because all 'yall so picky about that!
So I just made it work and stuff for people to use and tweak however they want, but I think it would be nice to have in SRL, it's legit and stuff so why not. (I would like to do some long term testing to see if you get flagged/warned/banned etc, but no one does for mousekeys, so I don't see why this would).

As for the last 4 slots yes, legit mousekeys or script the bottom 4 must be dropped 'manually' or with a normal scripted method.

Coh3n

2011-12-01 21:53:31

I'm sure Jagex can identify when legit players are using mouseKeys because they're actually hitting keys. This is using very inhuman mouse movements, which could pose a problem. Why not just use actual mouseKey strokes?

Flight

2011-12-01 22:01:31

From: Coh3n
I'm sure Jagex can identify when legit players are using mouseKeys because they're actually hitting keys. This is using very inhuman mouse movements, which could pose a problem. Why not just use actual mouseKey strokes?


That's kinda what I'm thinking. But also, Coh3n, I'm quite sure Simba doesn't suppose mouse keys. I've tried every angle possible to try and use them with Simba, nothing has worked for me in the past.

YoHoJo

2011-12-01 22:02:40

Because then users would have to turn it on and set it up and adjust acceleration and speed and disable it when they don't want to use it and it won't work within SMART!

I mouselogged myself. When hitting number keys they are not actually interpreted as keyboard stokes so that's okay. When moving the mouse it always move exactly the same Y coordinates downwards and it's a 'jump' just like movemouse. None of the coordinates between point A and B are not moved upon. And when clicking the wait between key up and key down is always either 0, 15, or 16ms.

So as far as I can tell the script does EXACTLY what mousekeys does based on results when I mouselogged myself, so they are indistinguishable ad far ad I can see.


E: just read your post flight. Proably because like I said when mousekys is enabled and you press a keyboard button that mousekeys uses the computer (and then probably therefor Simba) doesn't recognize it as a keypress it just goes straigt to doing it's designated mouse task. Get it?

Brandon

2011-12-01 23:27:25

From: YoHoJo
Because then users would have to turn it on and set it up and adjust acceleration and speed and disable it when they don't want to use it and it won't work within SMART!

I mouselogged myself. When hitting number keys they are not actually interpreted as keyboard stokes so that's okay. When moving the mouse it always move exactly the same Y coordinates downwards and it's a 'jump' just like movemouse. None of the coordinates between point A and B are not moved upon. And when clicking the wait between key up and key down is always either 0, 15, or 16ms.

So as far as I can tell the script does EXACTLY what mousekeys does based on results when I mouselogged myself, so they are indistinguishable ad far ad I can see.


E: just read your post flight. Proably because like I said when mousekys is enabled and you press a keyboard button that mousekeys uses the computer (and then probably therefor Simba) doesn't recognize it as a keypress it just goes straigt to doing it's designated mouse task. Get it?



An extension or plugin can probably do this:


keybd_event(BYTE bVk, BYTE bScan, DWORD dwFlags, ULONG_PTR dwExtraInfo );
Everytime you send a keypress and move the mouse, just call that keybd function and the OS would register it as a keypress. Of course when smart is open, the keypress will be trapped but the OS will still register it, just the smart window won't get it is all. There is no way for jagex to actually tell if the key/hardware was actually pressed down.. they must rely on the system to tell them the keystate.. Since simba doesn't communicate with the OS directly or whatever and just simulates keypresses that don't register with the os, u can just register these using a plugin or extension with extern.

I remember doing an extension for FindWindow and it actually worked.. so Im almost 100% sure u can do one for a keypress.

Overtime

2011-12-02 00:01:03

Your link in the video is broken. Links to a new thread. Fix. But this is amazing :D

Im wet.

Coh3n

2011-12-02 00:15:16

From: YoHoJo
So as far as I can tell the script does EXACTLY what mousekeys does based on results when I mouselogged myself, so they are indistinguishable ad far ad I can see.
Fair enough. ;)

Gaston7eze

2011-12-23 06:58:24

Where should we change the the name of what we want to put?
For example,you put "Ore" and i want to put "Log" Where should i put it?
And got this error:

[COLOR="Red"]Program MouseKeySimulator;[/COLOR]
//{$DEFINE SMART}
{$i SRL\SRL.scar}
var
RockPattern: TIntegerArray
;Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Function InvMMouse(InvSlot:Integer) : boolean;
Var TB: TBox;
CurrPT : TPoint;
Begin
result := false;
GameTab(tab_inv);
Result := true;
Writeln('InvMousing:' + IntToStr(InvSlot));
TB := InvBox(InvSlot);
GetMousePos(CurrPT.x,CurrPT.y);
If PointInBox(CurrPT,TB) Then
MouseBox(Max(CurrPT.x-random(2),TB.x1),Max(CurrPT.y-random(2),TB.y1),
Min(CurrPT.x+random(2),TB.x2),Min(CurrPT.y+random(2),TB.y2),3) //LOL Pro-human much!
Else
MouseBoxEx(TB.X1, TB.Y1, TB.X2, TB.Y2,14, 3);
End;
Procedure MouseKeyDrop;
var I, X, Y, OreMid: Integer;
SlotBox:TBox;
Begin
RockPattern:=[1,5,9,13,17,21,2,6,10,14,18,22,3,7,11,15,19,23,4,8,12,16,20,24];
OreMid := DTMFromString('78DA63CC626260E0606440054C601226CA584' +
'C849A3C209F8F809A6C209F19BF1A00AD2101F4');
For I:=0 to 23 Do
Begin
StatsGuise('Dropping Ores: ' + IntToStr(I));
SlotBox:=InvBox(RockPattern[I]);
If FindDTm(OreMid, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
Writeln('dtm found');
Writeln('I is:' + IntToStr(I));
If InIntArray([0,6,12,18], I) Then
Begin
Writeln('TopBox');
//InvMMouse(RockPattern[I]);
MMouse(X, Y, 5, 3);
End;
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
WaitOptionMultiEx(['Us'], 'item', Nothing, 5000);
MoveMouse(X, Y+40);
GetMousePos(X, Y); ClickMouse(X, Y, mouse_Left);
Wait(50+Random(20));
End;
End;
End;
Begin
SetUpSRL;
MouseKeyDrop;
end.



Procedure AntiBan;
Begin
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
1: Wait(100);
2 : PickUpMouse;
End
If(FindColorTolerance(x,y,857114,MMX1, MMY1, MMX2, MMY2, 5))then
begin
Mouse(x,y,5,5,true);
End;
end;
Procedure Start;
Begin
MakeCompass('N');
Wait(100+random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N')
End;

begin;
Smart_Server := 1;
Smart_Members := False;
Smart_Signed := false;
Smart_SuperDetail := False;
ClearDebug;
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
Start;
end.

[Error] (47:1): 'BEGIN' expected at line 46
Compiling failed.

YoHoJo

2011-12-23 11:38:40

You just need to make a DTM of logs and replace the ore DTM.
go watch my video tutoial or read my text tutorial about making DTMs.

Wyn

2012-03-26 12:40:46

Why not just use InvCount and/or convert a slot to a x, y; rather then a dtm?

Imanoobbot

2012-03-26 17:02:33

From: YoHoJo
About Mousekeys:
http://runescape.wikia.com/wiki/Mouse_keys

TL;DR
Script that simulates what mousekys does.
Super fast dropping, so much better xp/hr.
Yes it's allowed and legit.
Video:
http://www.youtube.com/watch?v=i1PQlmBYOQo

Basically all OS's have a built in or downloadable function to make certain keyboard keys control the mouse. In windows it's called mousekeys. Basically you set it up and pressing 2 moves the mouse down a few pixels, and you pres 5 and it right clicks. Many legit players use this to drop entire inventories of items in a few seconds making drop time very fast so you get better xp/hr when powering a skill.

Before you ask if it's okay to use etc etc read this part of the link:
http://runescape.wikia.com/wiki/Mouse_keys#Legality
YES, it is 100% okay and acceptable and used by many players!

Back when reflections bots were around I noticed that certain scripts had the option to use mousekey drop (except they didn't ACTUALLY use mousekeys, they just used their own mouse/click procedures to look like/simulate/be as fast as actual mousekeys) which greatly helped with speed and xp/hr.

So I made my own ghetto version of this. I'm sure many of you more pro coders and 'optimize' my code better and things like that, but basically it works and gets the job done. The below code basically does exactly what mouse-keys does and is just ghetto quickly sample code. It works for dropping ores only right now, but you can replace the DTM with whatever you want.

Program MouseKeySimulator;

//{$DEFINE SMART}
{$i SRL\SRL.scar}

var
RockPattern: TIntegerArray;


Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function InvMMouse(InvSlot:Integer) : boolean;
Var
TB: TBox;
CurrPT : TPoint;
Begin
result := false;
GameTab(tab_inv);
Result := true;
Writeln('InvMousing:' + IntToStr(InvSlot));
TB := InvBox(InvSlot);
GetMousePos(CurrPT.x,CurrPT.y);
If PointInBox(CurrPT,TB) Then
MouseBox(Max(CurrPT.x-random(2),TB.x1),Max(CurrPT.y-random(2),TB.y1),
Min(CurrPT.x+random(2),TB.x2),Min(CurrPT.y+random(2),TB.y2),3) //LOL Pro-human much!
Else
MouseBoxEx(TB.X1, TB.Y1, TB.X2, TB.Y2,14, 3);
End;

Procedure MouseKeyDrop;
var
I, X, Y, OreMid: Integer;
SlotBox:TBox;
Begin
RockPattern:=[1,5,9,13,17,21,2,6,10,14,18,22,3,7,11,15,19,23,4,8,12,16,20,24];
OreMid := DTMFromString('78DA63CC626260E0606440054C601226CA584' +
'C849A3C209F8F809A6C209F19BF1A00AD2101F4');
For I:=0 to 23 Do
Begin
StatsGuise('Dropping Ores: ' + IntToStr(I));
SlotBox:=InvBox(RockPattern[I]);
If FindDTm(OreMid, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
Writeln('dtm found');
Writeln('I is:' + IntToStr(I));
If InIntArray([0,6,12,18], I) Then
Begin
Writeln('TopBox');
//InvMMouse(RockPattern[I]);
MMouse(X, Y, 5, 3);
End;
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
WaitOptionMultiEx(['Us'], 'item', Nothing, 5000);
MoveMouse(X, Y+40);
GetMousePos(X, Y);
ClickMouse(X, Y, mouse_Left);
Wait(50+Random(20));
End;
End;
End;

Begin
SetUpSRL;
MouseKeyDrop;
end.


Here is a video of the script in action:
http://www.youtube.com/watch?v=i1PQlmBYOQo


So enjoy, feel free to use and tweak the code to work in your scripts and enjoy you better xp rates! Pretty sure I've done a good job making it function just like mousekeys (I mouselogged myself to see exactly what mousekeys did and just turned that into pascal code to do the same thing) so it shouldn't get you banned or anything.

Note: Mousekeys nor the script can handle the bottom 4 slots because the chooseoption menu pops up in a different spot because the bottom boundary of the client. Those four slots can be dropped with whatever method you choose.

Ummm… Yeah!



Oh my god I love you so much for this ;)

Only thing I saw so far is that it of course wont drop the gems we are gining while mining. Try to add that. But seems to be hard for me cause im at the really beginning.

* Got tons of ideas how to solve that problem while reading the code again. Should have the time on thursday to do so.