SRL Archive - OSR Help

Help with Banking


Thief

2013-04-21 09:24:30

I'm trying make a procedure for banking iron and gems. However the script is only banking the iron and one gem, leaving the rest of the gems in the inventory (there are different kinds of gems, but the GemDTM has a 255 tolerance).

Here's what I've got. I'm sure I must need some kind of repeat…. until function, but I don't really know how to use it :(


Procedure DepositOres;
var
x, y, IronOreDTM, i:Integer;

begin
IronOreDTM := DTMFromString('mwQAAAHic42RgYMhlYmAoAuIqIC4H4iwgjoPiJCDOAGIxRgYGLiAWAGJpIFYGYllGiDhIjBOITeXFGbQkhBgygi0Z9GVEGNICLRjCXQ0YrPQUGEy1ZBnsjZQZ+IH2EcKMRGA4AABEwgqU');
if FindDTM(IronOreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 400);
end;
end;

Procedure DepositGems;
var
x, y, GemsDTM, i:integer;

begin
GemsDTM := DTMFromString('mvQEAAHictc5BCoNADIXhOOBOLQhTFUFob9aKBUVEKa13cNUbt/9gFiIup4EvgUcCsSIyGJERPVo0uOO2UeOBzqz7E154q1mny57IApEEEWJ1QoozClS44Lrj8hI5rN6428+y8K3x6ksPPQv+4LB+nDsOZw==');
if FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('Deposit', 1000);
end;
end;

King

2013-04-21 09:50:34

From: pure_thief
I'm trying make a procedure for banking iron and gems. However the script is only banking the iron and one gem, leaving the rest of the gems in the inventory (there are different kinds of gems, but the GemDTM has a 255 tolerance).

Here's what I've got. I'm sure I must need some kind of repeat…. until function, but I don't really know how to use it :(




Fixed code

Procedure DepositOres;
var
x, y, IronOreDTM, i:Integer;

begin
IronOreDTM := DTMFromString('mwQAAAHic42RgYMhlYmAoAuIqIC4H4iwgjoPiJCDOAGIxRgYGLiAWAGJpIFYGYllGiDhIjBOITeXFGbQkhBgygi0Z9GVEGNICLRjCXQ0YrPQUGEy1ZBnsjZQZ+IH2EcKMRGA4AABEwgqU');
if FindDTM(IronOreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 400);
end;
end;

Procedure DepositGems;
var
x, y, GemsDTM, i:integer;

begin
GemsDTM := DTMFromString('mvQEAAHictc5BCoNADIXhOOBOLQhTFUFob9aKBUVEKa13cNUbt/9gFiIup4EvgUcCsSIyGJERPVo0uOO2UeOBzqz7E154q1mny57IApEEEWJ1QoozClS44Lrj8hI5rN6428+y8K3x6ksPPQv+4LB+nDsOZw==');
if FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 1000); // Changed this to 'All' As well, now it chooses the all option for you
end;
end;

You can also use a function like this

procedure DepositLoot;
begin
if BankScreen then
Deposit(1, 23, true); // Deposits the slots 1-23 using the all feature!
end;

However the use of DTMs is good practice for more complex situations and I like it!

Also for a DTM making, read this tut

This should deposit all the gems now(:

Thief

2013-04-21 11:08:48

Awesome, thanks! Such a fast reply too :D. I'll try it out tomorrow and see how it goes.

Rich

2013-04-21 12:50:25

If there's nothing else in the inventory other than what you want to deposit, there is also the DepositAll function which uses the button on the bank screen to empty your inventory.

Thief

2013-04-22 05:54:10

My noob account I'm testing the script on can't wield the rune pick, so I didn't want him to bank it :D
Now I've just got to sort out the walking for this script :D

Sjoe

2013-04-22 06:10:03

From: King
Fixed code


Procedure DepositGems;
var
x, y, GemsDTM, i:integer;

begin
GemsDTM := DTMFromString('mvQEAAHictc5BCoNADIXhOOBOLQhTFUFob9aKBUVEKa13cNUbt/9gFiIup4EvgUcCsSIyGJERPVo0uOO2UeOBzqz7E154q1mny57IApEEEWJ1QoozClS44Lrj8hI5rN6428+y8K3x6ksPPQv+4LB+nDsOZw==');

if FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 1000); // Changed this to 'All' As well, now it chooses the all option for you
Wait(500 + Random(250));
end;
end;

However the use of DTMs is good practice for more complex situations and I like it!

This should deposit all the gems now(:


Only deposits 1 kind :p


Procedure DepositGems;
*var
* x, y, GemsDTM, i:integer;




begin
* GemsDTM := DTMFromString('mvQEAAHictc5BCoNADIXhOOBOLQhTFUFob9aKBUVEKa13cNUbt/9gFiIup4EvgUcCsSIyGJERPVo0uOO2UeOBzqz7E154q1mny57IApEEEWJ1QoozClS44Lrj8hI5rN6428+y8K3x6ksPPQv+4LB+nDsOZw==');
Marktime(count)
repeat
if FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 1000); // Changed this to 'All' As well, now it chooses the all option for you
end;
end;
If TimeFromMark(count) > 10000 then Break; // To prevent a possible infinite loop, just in case.
until( not FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2))

OP:
To simplify Use Deposit(2, 28, True); (Runepick on inventory slot 1)

Thief

2013-04-22 07:43:11

From: Sjoe
Only deposits 1 kind :p


Procedure DepositGems;
*var
* x, y, GemsDTM, i:integer;




begin
* GemsDTM := DTMFromString('mvQEAAHictc5BCoNADIXhOOBOLQhTFUFob9aKBUVEKa13cNUbt/9gFiIup4EvgUcCsSIyGJERPVo0uOO2UeOBzqz7E154q1mny57IApEEEWJ1QoozClS44Lrj8hI5rN6428+y8K3x6ksPPQv+4LB+nDsOZw==');
Marktime(count)
repeat
if FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 1000); // Changed this to 'All' As well, now it chooses the all option for you
end;
end;
If TimeFromMark(count) > 10000 then Break; // To prevent a possible infinite loop, just in case.
until( not FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2))

OP:
To simplify Use Deposit(2, 28, True); (Runepick on inventory slot 1)


Awesome, thanks! Yeah I tried that first code and it only banked one diamond out of all the gems then finished. I resorted to that Deposit(2, 28, True) code. Thanks for the fix, I'm sure it'll be useful!

King

2013-04-22 11:06:54

From: Sjoe
Only deposits 1 kind :p


Procedure DepositGems;
*var
* x, y, GemsDTM, i:integer;




begin
* GemsDTM := DTMFromString('mvQEAAHictc5BCoNADIXhOOBOLQhTFUFob9aKBUVEKa13cNUbt/9gFiIup4EvgUcCsSIyGJERPVo0uOO2UeOBzqz7E154q1mny57IApEEEWJ1QoozClS44Lrj8hI5rN6428+y8K3x6ksPPQv+4LB+nDsOZw==');
Marktime(count)
repeat
if FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
WaitOption('All', 1000); // Changed this to 'All' As well, now it chooses the all option for you
end;
end;
If TimeFromMark(count) > 10000 then Break; // To prevent a possible infinite loop, just in case.
until( not FindDtm(GemsDtm, x, y, MIX1, MIY1, MIX2, MIY2))

OP:
To simplify Use Deposit(2, 28, True); (Runepick on inventory slot 1)


Ohhhh, he wants multiple types of gems >.< Didn't read right, thought me meant all of one gem.

Thief

2013-04-23 09:32:39

I noticed too that when you only have one gem in your inventory, the deposit all option doesn't come up ;)

King

2013-04-23 12:07:59

From: pure_thief
I noticed too that when you only have one gem in your inventory, the deposit all option doesn't come up ;)


Simpler and better to use deposit 1- blah blah lol