SRL Archive - SRL Suggestions

BankMouse


Fwd Motion

2012-02-09 11:56:20

I noticed there's an InvMouse, but no BankMouse. So here's this bit…


(*
BankMouse
~~~~~~~~

.. code-block:: pascal

procedure BankMouse(BankSlot :integer);

.. note::

by Fwd Motion!

Example:

.. code-block:: pascal

if BankMouse(1) then
begin
ClickMouse2(false);
WaitOption('eposit', 500);

*)
Procedure BankMouse(BankSlot :integer);
var
BankBox: TBox;
X, Y: Integer;
begin
FixBank;
BankBox := BankIndexToMSBox(BankSlot);
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BankBox)) then
MouseBox(BankBox.X1, BankBox.Y1, BankBox.X2, BankBox.Y2, mouse_move);
end;

Coh3n

2012-02-09 19:31:30

Cool, but why not have an action parameter as well? So it can move, right click, or left click.

E: And I wouldn't include FixBank() in there. Maybe the script changed the bank arrangement. We wouldn't always want to change it back.

Fwd Motion

2012-02-09 19:34:39

From: Coh3n
Cool, but why not have an action parameter as well? So it can move, right click, or left click.

E: And I wouldn't include FixBank() in there. Maybe the script changed the bank arrangement. We wouldn't always want to change it back.


I actually added an action parameter, but it didn't work at all for some reason. Like it would just move, it wouldn't click or right click. I'll work on it more in a few minutes to see what I can do.

And that's very true, I didn't think about the fact that it could mess up the script itself!

Coh3n

2012-02-09 19:38:21

From: Fwd Motion
I actually added an action parameter, but it didn't work at all for some reason. Like it would just move, it wouldn't click or right click. I'll work on it more in a few minutes to see what I can do.

And that's very true, I didn't think about the fact that it could mess up the script itself!
How'd you use the action parameter?

Fwd Motion

2012-02-09 19:41:01

Procedure BankMouse(BankSlot, Action :integer);
var
BankBox: TBox;
X, Y: Integer;
begin
FixBank;
BankBox := BankIndexToMSBox(BankSlot);
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BankBox)) then
MouseBox(BankBox.X1, BankBox.Y1, BankBox.X2, BankBox.Y2, Action);
end;

fre

2012-02-09 19:46:02

Very nice,
i ll use it and give proper credits.

Coh3n

2012-02-10 01:53:21

Committed for the next version. :)

E: Except I called it MouseBankSlot.

Gu3st...

2012-02-10 02:02:24

Good job, Fwd Motion :)

Fwd Motion

2012-02-10 12:22:35

From: Zyt3x
Good job, Fwd Motion :)


Thanks! (:

I'm glad I could be a bit of help!