SRL Archive - SRL Archives

procedure DepositAllButAxes;


Doofy

2007-06-26 16:52:35

Stores everything from your inventory into bank except any axes. For use in WoodCutting obviously.


{*********************************************************************
function ExistsInIntArray(number : integer; intarray : Array of integer) : boolean;
By: The_Rs_Monkey
Checks to see if a number exists in an array of integer.
*********************************************************************}
function ExistsInIntArray(number : integer; intarray : Array of integer) : boolean;
var
e : integer;
begin
for e := 0 to GetArrayLength(intarray) - 1 do
begin
if intarray[e] = number then
begin
Result := True;
Exit;
end;
end;
end;

{*********************************************************************
procedure DepositAllButTheseDTM(item : array of integer);
By: The_Rs_Monkey
Usage: DepositAllButThese([bmp1, bmp2, bmp3, bmp4]);
Deposits everything in the inventory except these item (represents by an array of DTMs);
*********************************************************************}
procedure DepositAllButTheseDTM(item : array of integer);
var
Spots : Array Of Integer;
e, i, q, Mx, My : integer;
begin
GameTab(4);
if GetArrayLength(item) = 0 then Exit;
for e := 0 to 6 do
begin
for i := 0 to 3 do
begin
Mx := (561 + (i * 43));
My := (208 + (e * 37));
for q := 0 to GetArrayLength(item) - 1 do
begin
if (FindDTM(item[q], x, y, Mx, My, Mx + 40, My + 35)) then
begin
SetArrayLength(Spots, GetArrayLength(Spots) + 1);
Spots[GetArrayLength(Spots) - 1] := e * 4 + i + 1;
Break;
end;
end;
end;
end;

for i := 1 to 28 do
begin
if Not ExistsInIntArray(i, Spots) then
if ExistsItem(i) then
Deposit(i, i, 2);
end;
end;

{*******************************************************************************
procedure DepositAllButAxes;
By: Doofy
Description: Deposits everything in inventory except any axes, using
The_Rs_Monkey's DepositAllButTheseDTM and the DTM's from SRL/SRL/skill/
WoodCutting.
*******************************************************************************}
procedure DepositAllButAxes;
var
Axes: Array [0..5] of Integer;
begin
if (not(LoggedIn)) or (not(BankScreen)) then
begin
Exit;
end;
Axes[0]:= DTMFromString('78DA639CCEC4C0F09401051485F1318800694' +
'620FE0F048C4B806AEEA2AA718E4864E082AA0101C6C54035F751' +
'D5D887C6A1AA590A547313558D4B740A8A1A00CFA10E03'); //rune
Axes[1]:= DTMFromString('78DA6374606060686440014D497C0C22409A1' +
'188FF0301A337905187AAC6C6D786810BAA0604187D804415AA1A' +
'7B7F7B5435BE40A21C558D73B0338A1A00C1660AA8'); //addy
Axes[2]:= DTMFromString('78DA633CC4C4C010C0C8800C5A53F81852803' +
'448F43F10309E05AAF14155636111CCC0055503028CE7816A5C51' +
'D5D839C4A2AA3981A9C6C52D0D450D0061FC0C64'); //mith
Axes[3]:= DTMFromString('78DA63CC636260D8C3C8800C5A53F81852803' +
'448F43F10305602D5EC4055939B9ACAC0055503028CD540351B51' +
'D594E5E5A2AA29C154D3545989A20600C3BC0E32'); //steel
Axes[4]:= DTMFromString('78DA63BCC9C4C0309191010498182020C6859' +
'34103488344FF0301E353A04C2F230332F0707161E082AA0101C6' +
'0740356DA86A22838351D5BC00AAE94655932ACA89AAE639A6394' +
'1DEDE286A00B1F90F6D'); //iron
Axes[5]:= DTMFromString('78DA63EC626060086140016DA97C0C22409A1' +
'188FF0301E33420C307558D97A5220317540D08304E051201A86A' +
'DCCCE451D54C07129EA86AFC6C5450D40000D77E0AA2'); //bronze
DepositAllButTheseDTM(Axes);
end;

Smartzkid

2007-06-26 17:01:22

Why use individual axe dtm's when you can just make a universal dtm of an axe that'll work for any axe?

Doofy

2007-06-26 17:30:01

From: Smartzkid
Why use individual axe dtm's when you can just make a universal dtm of an axe that'll work for any axe?


Because I absolutley suck with DTM's and I wouldn't know how to do that. I was only able to make this because SRL already had the DTMs in it for me.

JAD

2007-06-26 17:31:39

It's not hard.. :p Just make sure when you click a black dot is in the middle of the pixel box, that's it. Read YoHoJo's tutorial :p

Doofy

2007-06-26 19:36:20

ok… ill read that sometime soon. thanks.

Bobarkinator

2007-06-26 22:15:15

Ya just make a DTM of the wood part so it will work for any axe but otherwise good work.

YoHoJo

2007-06-26 22:21:01

I love ruining stuff:
Procedure DepositAllButAxes;
Begin
For I:=1 To 28 Do
Begin
If ExistsItem(I) Then
Begin
GetMousePos(x,y);
Status('At Item '+IntToStr(I))
MMouseItem(I);
If Not(IsUpTextMulti('Axe','xe','xe')) Then
Begin
Mouse(x,y,0,0,False);
ChooseOption(x,y,'Al');
End;
End;
End;
End;
Of course yours is more creative tough =)

Ruroken

2007-06-26 23:29:24

YoHo you meany :p

Doofy

2007-06-27 10:34:27

From: YoHoJo
I love ruining stuff:
Procedure DepositAllButAxes;
Begin
For I:=1 To 28 Do
Begin
If ExistsItem(I) Then
Begin
GetMousePos(x,y);
Status('At Item '+IntToStr(I))
MMouseItem(I);
If Not(IsUpTextMulti('Axe','xe','xe')) Then
Begin
Mouse(x,y,0,0,False);
ChooseOption(x,y,'Al');
End;
End;
End;
End;
Of course yours is more creative tough =)


I guess I'll give this ruining thing a go then =]

I'm not positive but mine should be quicker, because mine goes through and depositsall and looks for a quick DTM (I have to get that dtm still) while yours waits for uptext on every single one. Not sure, but I think so.

ALSO, yours should not work, because you have the GetMousePos before MMouseItem(I), and when it gets to Mouse(x, y, 0, 0, False) then it is going to click wherever the mouse started at. And it will keep doing that because the mouse ends near the same place too.:p