SRL Archive - SRL Archives

DepositInv


Rich

2009-04-30 19:44:04

A simple function which will press the "Deposit Inventory" button when the bank window is open.

Every time I have tested it, it has worked. I'm going to make another two for the "Deposit Wielding" and "Beast of Burden" ones.

procedure DepositInv;

//Presses the "Deposit Inventory" button in the bank screen.
//By R1ch

var
X, Y, Button : Integer;

begin
Button := DTMFromString('78DA630C666060B064400195DE32609A11CA6' +
'78C06126E0C688011558D33116A6C81841901352033F408A88924' +
'424D3C90B0C054C385EE1E17DCE6B0013100A5900544');
if FindDTM(Button, X, Y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 5, 5, True);
end.

program DepositBeast;

//Presses the "Deposit Beast of Burden" button in the bank screen.
//By R1ch

var
X, Y, Button : Integer;

begin
Button := DTMFromString('78DA639464606010624001BD0B77826946289' +
'F5115480830A0014654350A40429A801A3E22D430030941026A58' +
'80040B013522408299801A65C26A00D444031C');
if FindDTM(Button, X, Y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 5, 5, True);
FreeDTM(Button);
end.

program DepositWorn;

//Presses the "Deposit Worn Items" button in the bank screen.
//By R1ch
var

X, Y, Button : Integer;

begin
Button := DTMFromString('78DA6394646060E0614001CB17CE00D38C503' +
'EA32A90E06340038CA86A9481843401351244A8E123420D339010' +
'22420D2B0135A2408299801A25C26A004E7C0347');
if FindDTM(Button, X, Y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 5, 5, True);
FreeDTM(Button);
end.

procedure DepButtons(Inv, Beast, Worn : Boolean; RandX, RandY : Integer);

//Can press the bank "Deposit Buttons" in one function, with user set randomness
//By R1ch
//Used: DepButton(True, False, True, 5, 5);

var
X, Y, InvDTM, BeastDTM, WornDTM : Integer;

begin
if Inv then
begin
InvDTM := DTMFromString('78DA630C666060B064400195DE32609A11CA6' +
'78C06126E0C688011558D33116A6C81841901352033F408A88924' +
'424D3C90B0C054C385EE1E17DCE6B0013100A5900544');
if FindDTM(InvDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, RandX, RandY, True);
FreeDTM(InvDTM);
end;

if Beast then
begin
BeastDTM := DTMFromString('78DA639464606010624001BD0B77826946289' +
'F5115480830A0014654350A40429A801A3E22D430030941026A58' +
'80040B013522408299801A65C26A00D444031C');
if FindDTM(BeastDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, RandX, RandY, True);
FreeDTM(BeastDTM);
end;

if Worn then
begin
WornDTM := DTMFromString('78DA6394646060E0614001CB17CE00D38C503' +
'EA32A90E06340038CA86A9481843401351244A8E123420D339010' +
'22420D2B0135A2408299801A25C26A004E7C0347');
if FindDTM(WornDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, RandX, RandY, True);
FreeDTM(WornDTM);
end;
end.

Try it out and tell me what you think.

Thanks!

Edit: Added Beast and Worn
Edit2: Added 3 in 1
Edit3: Edited 3 in 1

Naike

2009-04-30 19:47:07

DepositAll in the newest SRL Rev(32) does the same?

Rich

2009-04-30 19:54:54

Oh…I didn't know about that. Are there function which deposit what you are wearing and the beast of burden one, because I just made them…Meh, I might as well post them…Sigh

ShowerThoughts

2009-04-30 19:56:04

Yea, it's a Tvariant it's weird you probably have to check the include before you understand how it works.

Rich

2009-04-30 20:08:10

From: Hermpie
Yea, it's a Tvariant it's weird you probably have to check the include before you understand how it works.


Huh?

footballjds

2009-04-30 20:13:10

lol, already in srl ;) nice try though….

Rich

2009-04-30 20:15:33

Are the Beast and Worn ones already in SRL? And what about the one function that does all in one?

Thanks anyway,
Richard

footballjds

2009-04-30 20:20:57

lol, no. but you don't need a dtm

all you need is the coords because they're always t3h same rofl…
just use:


function DepositeW/eTheHeckYouWant!!!!: Boolean;
var
T: Integer;
begin
if (BankScreen) then
begin
Mouse(390, 305, 15, 10, True);//change the coords to w/e
Wait(200 + Random(300));
T := GetSystemTime;
while (InvFull) and (GetSystemTime - T < 2000) do
Wait(100);
Result := InvEmpty;
end;
end;

Rich

2009-04-30 20:24:19

Lol. :) I'm happy with my DTMs though…Sort of…Damn!!!! I could have done it so much easier!

footballjds

2009-04-30 20:25:25

its okay ;)
i remember i did that once b4 they had something to turn of the music.. ;)
i used a dtm to find the music thingy when really its static coords ROFL!!!

Rich

2009-04-30 20:31:16

If this was implemented in SRL, would you use it?

Floor66

2009-04-30 21:03:39

I'd try and make is as short as possible (no DTMs, soz). maybe MouseBox?

footballjds

2009-04-30 21:47:34

From: R1ch
If this was implemented in SRL, would you use it?


rofl, not really any use for it imo ;)

and id use either mousebox(prolly not) or Mouse with enough rand to make it do same thing as box ;)
mouseBox is/was made especially for using varibles with it like box.x, box.y, box.xx, box.yy… when something is static i like using plain old Mouse better.. but its w/e u want :D