SRL Archive - SRL Archives

Procedure DropToFast(StartSlot, EndSlot: Integer);


JAD

2007-06-18 19:14:04


program New;
{.include SRL/SRL.scar}

function ChooseOptionFast(x, y, Over: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
Mouse(x + Length(txt) * 3 + (Over), y + 3, 2, 2, True);
end
else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
Mouse(x + 9, y + 3, 2, 2, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;

{*********************************************************************
procedure DropToFast(StartSlot, EndSlot: Integer);
By: JAD
Description: A re-make of SRL's function DropTo. This drops items just
like DropTo does, but it does it much faster! It drops downward, and
when the mouse clicks drop, the mouse is ready to click on the next
item. The inventory numbers are numbered top left and down. So
Inventory slot 1 is 1, Inventory slot 5 is 2, Inventory slot 9 is 3...
etc.
*********************************************************************}

procedure DropToFast(StartSlot, EndSlot: Integer);
var FastSlot: array[1..28] of Integer;
DropSlot: array[1..28] of TPoint;
I, Q, T: Integer;
begin
T := 1;
for I := 1 to 28 do
begin
FastSlot[I] := T + Q;
Q := Q + 4;
if(Q > 24)then
begin
T := T + 1;
Q := 0;
end;
end;
GameTab(4);
Q := 0;
for I := StartSlot to EndSlot do
begin
if(ExistsItem(FastSlot[I]))then
begin
DropSlot[I] := ItemCoords(FastSlot[I]);
Mouse(DropSlot[I].x,DropSlot[I].y,3,3,false);
if(I > 7)then
ChooseOptionFast(x,y,30,'Drop') else
ChooseOptionFast(x,y,4,'Drop');
end;
end;
end;

begin
SetupSRL;
ActivateClient;
wait(2500+random(1000));
DropToFast(1, 28);
end.

First of all, get a full inventory of items and just try this out. You will see how much faster it drops and how it does it from just that.

Credits: ChooseOptionFast is exactly the same as ChooseOption except I just added to the x to click over to the right more so the mouse is closer to the next item, and dropping faster.

I made this because this is how I always dropped when playing legit, so it's much faster, and it's how the smart real person does it :)

So test it, and test it without just dropping the full inventory to see if there's any errors! I did some testing with random numbers and it worked perfectly. Just remember how the slots are numbered!

Enjoy! :)

WhiteShadow

2007-06-18 19:26:41

I tried it with some copper, it's a lot faster than SRL's, good job. :)

badandymitch

2007-06-18 19:33:42

wow worked great, just as fast as if i did it

JAD

2007-06-18 19:42:16

Great guys! Thanks :)

I may put a temp mouse speed in there like WhiteShadow suggested (over msn) to make it a bit faster.

Wanted

2007-06-18 22:49:01

Shouldn't be to hard.

procedure NewProcedure;
var
OldMouseSpeed: Integer;
begin
OldMouseSpeed := MouseSpeed;
MouseSpeed := 0;
//do stuff
MouseSpeed := OldMouseSpeed;
end;

Nice procedure, if I ever make a script that drops i.e. powerminer I'll be sure to edit and use this (full credits of course :-p).

JAD

2007-06-19 10:34:54

From: Icefire908
Shouldn't be to hard.

procedure NewProcedure;
var
OldMouseSpeed: Integer;
begin
OldMouseSpeed := MouseSpeed;
MouseSpeed := 0;
//do stuff
MouseSpeed := OldMouseSpeed;
end;

Nice procedure, if I ever make a script that drops i.e. powerminer I'll be sure to edit and use this (full credits of course :-p).


Awesome! :)

And I know how to use it and make it in 2 seconds :p I just wasn't sure if I should edit it. Because if the user wants the mouse faster, all they need to do is go


TempSpeed := MouseSpeed;
MouseSpeed := 7;
DropToFast(1, 28);
MouseSpeed := TempSpeed;

like that. I guess I could add another parameter for if they want me to change the mouse speed to :p

Anyways, thanks!

Mjordan

2007-06-19 11:10:55

Very nice JAD. I actually might be using this in a woodcutting script I'm making :)

JAD

2007-06-19 14:19:59

From: Mjordan
Very nice JAD. I actually might be using this in a woodcutting script I'm making :)


Awesome! Good to hear :) And thanks.

n3ss3s

2007-06-19 14:26:09

Gj, I actually before my membership was kinda trying to do that for my powerminer script, but I didnt know for loop so I quit :D
And I wanted to use Bitmap.

JAD

2007-06-19 14:28:04

From: n3ss3s
Gj, I actually before my membership was kinda trying to do that for my powerminer script, but I didnt know for loop so I quit :D
And I wanted to use Bitmap.


Yeah, it was much harder then it looked! I had a lot of testing, and a lot of weird problems with this and switching the slots around. I Had to think a lot of how I could get it to work. Another problem I encountered was it used TPoint for ItemCoords, and I had to do some other things to get it to work…

Over all it took me about 2-3 hours to do :p

Anyways, thanks!

n3ss3s

2007-06-19 15:37:11

Yup, it really when you first time think of it sounds easy but when you start making it somehow…