SRL Archive - SRL Archives

Bank procedures.


Dervish

2009-03-03 15:20:53

Hi…

Three lower right options :

{*******************************************************************************
Procedure DepositBank(Option: String);
By : Dr D. Dervish
Description: Will deposit the items using the three deposit methods
in the down-right corner of the Bank Screen
The valid options are :
inventory
equipped
summoned
*******************************************************************************}
Procedure DepositBank(Option: String);
var
x,y: Integer;

Begin
If (Not(BankScreen)) then
Exit;

Case Option of
'inventory' : Begin
MMouse(381,296,28,18);
If (IsUpText('arried')) then
Begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
End;
End;
'equipped' : Begin
MMouse(421,296,28,18);
If (IsUpText('worn')) then
Begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
End;
End;

'summoned' : Begin
MMouse(441,296,28,18);
If (IsUpText('beast')) then
Begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
End;
End;
End;
End;

Searching :


{*******************************************************************************
procedure SearchBank(Item: string);
by: ZephyrsFury (mini fix by Dr D. Dervish for bank update).
Description: Searches for Item in your bank.
*******************************************************************************}

procedure SearchBank(Item: string);
var
T, II: Integer;
begin
if (not(BankScreen)) then Exit;
for II := 0 to 2 do
begin
FixBankTab;
Mouse(72,296,28,18,true);
T := GetSystemTime;
while (BankScreen) and (not(FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing))) do
begin
Wait(500 + Random(500));
if (GetSystemTime - T > 5000) then Break;
end;
Wait(500 + Random(500));
if (FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing)) then
begin
TypeSend(Item);
Exit;
end;
end;
end;

Note withdrawal :

{*******************************************************************************
procedure NotedMode(Mode: boolean);
by: Dr D. Dervish.
Description: Changes the Mode to items if Mode boolean is set to false.
Changes the Mode to notes if Mode boolean is set to true .
*******************************************************************************}
Procedure NotedMode(Mode: Boolean);
var
x,y : Integer;

Begin
If (not(BankScreen)) then
Exit;

MMouse(243,296,28,18);
Wait(750+random(250));

If (IsUpText('note')) then
Case Mode of

True : Begin
GetMousePos(x,y);
Mouse(x,y,0,0,true)
End;

False : Begin
Writeln('Withdrawal mode is already set to items.');
Exit;
End;
End;

If (IsUpText('items')) then
Case Mode of

True : Begin
Writeln('Withdrawal mode is already set to notes.');
Exit;
End;

False : Begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
End;

End;
End;

Hope you like it.

Tell me if you find any errors.

infested999

2009-03-03 15:23:46

Nice! This feature only existed for about 3 hours and already a script for it :)

TViYH

2009-03-03 15:23:59

It's equipment, not equipement.

Sorry to be a grammar nazi, but it has to be fixed :S

Dervish

2009-03-03 15:27:24

Thank you both ^^.

Lol TViYH : I wrote "equipped" in the description and used "equipement" in the script, thanks to you I found that out xD.

Fixed :).

Iroki

2009-03-03 15:54:52

{
0 inventory
1 equipped
2 summoned
}
function DepositBank(Option: integer): boolean;

var
P: TPoint;
begin
if not BankScreen then Exit;

if not InRange(Option, 0, 2) then
begin
srl_Warn('DepositBank', 'Unknown option ', warn_AllVersions);
Exit;
end;

P.x := 397 + (37 * Option) - RandomRange(-10, 10);
P.y := 309 - RandomRange(-10, 10);

MMouse(P.x, P.y, 0, 0);

if not IsUpText('posit') then Exit;

GetMousePos(P.x, P.y);
ClickMouse(P.x, P.y, True);
Wait(RandomRange(700, 1200));
Result := True;
end;

its what i made

Dervish

2009-03-03 15:57:19

From: Iroki AKA manfromczech
{
0 inventory
1 equipped
2 summoned
}
function DepositBank(Option: integer): boolean;

var
P: TPoint;
begin
if not BankScreen then Exit;

if not InRange(Option, 0, 2) then
begin
srl_Warn('DepositBank', 'Unknown option ', warn_AllVersions);
Exit;
end;

P.x := 397 + (37 * Option) - RandomRange(-10, 10);
P.y := 309 - RandomRange(-10, 10);

MMouse(P.x, P.y, 0, 0);

if not IsUpText('posit') then Exit;

GetMousePos(P.x, P.y);
ClickMouse(P.x, P.y, True);
Wait(RandomRange(700, 1200));
Result := True;
end;

its what i made


Does it work better than mine ?

Mine worked well for me… It is simpler than yours but works flawlessly (I didn't say yours didn't ;)).

Sir R. M8gic1an

2009-03-03 16:45:59

/me finds the flaw


DepositBank('eQuIpPeD'); // = fail

also iroki's is more efficient for this.

on the second one i'm not sure how the not will react in the while. it's quite tricky really.


while (BankScreen) and (not(FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing))) do


//i suggest

while BankScreen do
begin
if FindTextTPA then break;
//....
end;


for the last one, isn't there some kind of color you can check for the mode, instead of movign the mouse and checking text?

good work.

~RM

Nava2

2009-03-03 19:01:34

You need waits if you are going to keep the UpTexts there… :)

Dervish

2009-03-04 01:13:22

From: Rasta Magician
/me finds the flaw


DepositBank('eQuIpPeD'); // = fail

also iroki's is more efficient for this.

on the second one i'm not sure how the not will react in the while. it's quite tricky really.


while (BankScreen) and (not(FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing))) do


//i suggest

while BankScreen do
begin
if FindTextTPA then break;
//....
end;


for the last one, isn't there some kind of color you can check for the mode, instead of movign the mouse and checking text?

good work.

~RM


I found it better to move the mouse and check the up text since this is to change the mode if necessary, not to return a boolean ;) and I don't really know how I would compare the colors…

ian.

2009-03-04 01:16:13

NO!

don't search ;D

look for the DTM, if it can't find it scroll down for like.. (you have to get the time) 750-1000.. then look again.. repeat.. then check the color right above the down arrow and if it's the color of the scroll bar, then you can't find it, and try to search :)

Sir R. M8gic1an

2009-03-04 02:29:16

From: Dr D. Dervish
I found it better to move the mouse and check the up text since this is to change the mode if necessary, not to return a boolean ;) and I don't really know how I would compare the colors…


better only to move the mouse if you have to ;)


{*******************************************************************************
procedure NotedMode(Mode: boolean);
by: Rasta Magician
Description: Changes the Bank Mode to Mode
*******************************************************************************}
Procedure NotedMode(Mode: Boolean);
begin
if not BankScreen then exit;
if not LoggedIn then exit;

if (Mode)xor(GetColor(254, 318) = 3688012) then
begin
Mouse(243,296,28,18, true);
wait(100);
end;
end;

xor works like this:
true + true = false
true + false = true
false + true = true
false + false = false

basically if one but not the other.

The color at that point changes when noted = true;

~RM

Iroki

2009-03-04 08:35:12

From: Dr D. Dervish
Does it work better than mine ?

Mine worked well for me… It is simpler than yours but works flawlessly (I didn't say yours didn't ;)).


I didnt tell that your isnt good, my is just smaller and, umm…, faster. :)
Your is good too :)

Dervish

2009-03-04 10:42:04

From: Iroki AKA manfromczech
I didnt tell that your isnt good, my is just smaller and, umm…, faster. :)
Your is good too :)


Yours is alot more complex (and probably better)… You're a far better scripter than I am Iroki. :(

Iroki

2009-03-04 11:40:28

From: Dr D. Dervish
Yours is alot more complex (and probably better)… You're a far better scripter than I am Iroki. :(


Umm, you are as good scripter as I :) but you maybe dont know some things.

Dervish

2009-03-04 11:42:38

From: Iroki AKA manfromczech
Umm, you are as good scripter as I :) but you maybe dont know some things.


Knowledge is power ;).

noidea

2009-03-04 20:32:36

From: Iroki AKA manfromczech
{
0 inventory
1 equipped
2 summoned
}
function DepositBank(Option: integer): boolean;

var
P: TPoint;
begin
if not BankScreen then Exit;

if not InRange(Option, 0, 2) then
begin
srl_Warn('DepositBank', 'Unknown option ', warn_AllVersions);
Exit;
end;

P.x := 397 + (37 * Option) - RandomRange(-10, 10);
P.y := 309 - RandomRange(-10, 10);

MMouse(P.x, P.y, 0, 0);

if not IsUpText('posit') then Exit;

GetMousePos(P.x, P.y);
ClickMouse(P.x, P.y, True);
Wait(RandomRange(700, 1200));
Result := True;
end;

its what i made


Iroki, clickmouse() … :confused:

Iroki

2009-03-05 02:24:12

From: noidea
Iroki, clickmouse() … :confused:


??

ian.

2009-03-05 02:26:28

you used ClickMouse in your script.. >.>

Iroki

2009-03-05 02:29:56

Yes but whats wrong with it?? i dont understand.

ian.

2009-03-05 02:35:16

Detectable I think?

Iroki

2009-03-05 02:39:20

I think that it's the same detectable as Mouse(x, y, 0, 0, True); But i'm not sure.

ian.

2009-03-05 02:57:19

Mouse doesn't use ClickMouse.. it uses Hold/ReleaseMouse ;)

ClickMouse is different I believe..

Dervish

2009-03-05 03:00:49

No, clickmouse clicks down and releases instantly, Mouse holds down a random time and releases (like humans do), watch out with clickmouse it is increadibly bannable.

ian.

2009-03-05 03:01:46

From: Dr D. Dervish
No, clickmouse clicks down and releases instantly, Mouse holds down a random time and releases (like humans do), watch out with clickmouse it is increadibly bannable.


that's what I said I think?

(not trying to be an ass.. just want to make sure that I've been explaining it right :p)

Dervish

2009-03-05 03:40:49

I said that to Iroki, but you went first ;).

Iroki

2009-03-05 09:12:32

Thanks :P