SRL Archive - Reflection Development

Deposit-All (Deposit box)


Flight

2011-03-27 07:26:11

I noticed there's not alot of work done yet to the banking system in general for deposit boxes. I required to use of them in one of my recent scripts so I made a very crude procedure for doing so. I thought maybe someone could throw in some fail safes, maybe modify it some and add it to the Bank reflection file?

{*******************************************************************************
Procedure R_DBDepositAll
By: Flight
Description: Deposits all carried items to deposit box
*******************************************************************************}
Procedure R_DBDepositAll;
Var
x,y: Integer;
begin
R_FindRandoms;
if ((Not CharacterMoving) And (R_DepositBoxScreen)) then
begin
MMouse(345,277,10,7); //Deposit inventory button
if R_WaitUpTextMulti(['Deposit','carried'],RandomRange(250,350)) then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,True);
Wait(RandomRange(200,350));
end;
end;
end;

Pretty obvious what it does and how it works, there's a lack of failsafes, and I even went stone-age and uses a static-define x/y coordinates for the 'Deposit All' button.

Floor66

2011-03-27 07:27:13

Why not just use SRL's DepositAll for such a simple task? It works with a deposit box aswell iirc.

Flight

2011-03-27 07:41:58

I don't think it does, SRL's deposit all deposits items from your inventory. I don't know if you've ever used a deposit box, but you can't access your inventory while you're in it. Instead it brings up it's own interface displaying your items, in the middle of the screen.

Gu3st...

2011-03-27 07:52:05

If srl-reflection had support for Absolute Interfaces, this could be done in a less crude way

**BANNED The Man

2011-03-27 07:53:57

From: Zyt3x
If srl-reflection had support for Absolute Interfaces, this could be done in a less crude way


this.
But it's not possible.

Gu3st...

2011-03-27 07:54:52

From: Dynamite
this.
But it's not possible.
Timer added support for Absolute Interfaces to RRL yesterday, so it is indeed possible :)

Floor66

2011-03-27 08:11:33

From: Flight
I don't think it does, SRL's deposit all deposits items from your inventory. I don't know if you've ever used a deposit box, but you can't access your inventory while you're in it. Instead it brings up it's own interface displaying your items, in the middle of the screen.


There's a button on-screen for deposit-all :)

**BANNED The Man

2011-03-27 08:22:53

From: Zyt3x
Timer added support for Absolute Interfaces to RRL yesterday, so it is indeed possible :)


He has added interface bounds.
The main point for absolute interfaces is imo to be able to withdraw from the bank. But afaik pascal doesn't support rectangle > point.

Flight

2011-03-27 08:43:42

From: Floor66
There's a button on-screen for deposit-all :)


Yeah that's what I use for depositing all, which I just use the absolute x/y coordinates of the button instead of searching for a bitmap or color. Like I said, tis very crude but it more than certain gets the job done. ;)

Floor66

2011-03-27 09:04:07

Yeah but see, the SRL proc already uses that button :p

Echo_

2011-03-27 10:05:56

Just try to add an "else" action containing a failsafe for every if statement in your procedure. Then you can just send it to the Ref team over Github :)

Gu3st...

2011-03-27 11:17:43

From: Dynamite
He has added interface bounds.
The main point for absolute interfaces is imo to be able to withdraw from the bank. But afaik pascal doesn't support rectangle > point.
Interface bounds is all you need for absolute interfaces ;)

**BANNED The Man

2011-03-27 11:20:31

From: Zyt3x
Interface bounds is all you need for absolute interfaces ;)


wat.
SRL has had bounds for months - years…
You are saying that if you have 4 co-ords of a box, you can locate any action/point on the interface?

Gu3st...

2011-03-27 11:29:02

From: Dynamite
wat.
SRL has had bounds for months - years…
You are saying that if you have 4 co-ords of a box, you can locate any action/point on the interface?
To access the absolute bounds of an interface, you need three hooks, DismissBounds(B[]), InterfaceBounds(Rect[]), and Interface.BoundsIndex(I).
Starting, you use the index retrieved from the interface to grab the corresponding index in DismissBounds.
If it's true, you do some special calculations.
-
If it's false, you grab the rectangle and use the points to give you the absolute point, which involves grabbing the rectangle for [each of] the parent interface presented by the component you wish to locate.

^ As explained by Timer.

https://github.com/Timer/RRL/blob/master/core/Interfaces.txt#L149

pyroryan

2011-03-27 12:20:54

From: Zyt3x
Timer added support for Absolute Interfaces to RRL yesterday, so it is indeed possible :)


*cough* with my help *cough*. And absolute coordinates :). I don't think absolute interfaces exists.

Bad Boy JH

2011-04-06 08:12:32

surely we can get a dirty hack way of doing it…

Yago

2011-04-06 18:45:23

I believe this is useful :). I was looking for this and wondering why its not there.