SRL Archive - OSR Help

Need help with failsafe


Roflme

2012-05-31 04:43:39

I'm using a herblore script and just want to make a failsafe. It uses the SW chest, and sometimes it'll move me away from the chest and then I'll be stuck there.

Is it possible for me to add this failsafe? I'm trying to make it detect the chest, and if not I'm going to try to have it click on the money symbol. It would then be close enough to find the bank (I hope).


I have two questions:

1) I found a 'FindBank' function. Is there any better function I can use for specifically detecting the SW Chest? I noticed that 'OpenBankChest(SRL_BANK_SW)' will open the SW chest specifically. Is there a function that will simply detect it?

2) Is there any better method of moving me near the bank? I was just going to use the color of the $ symbol and have it click that. But I'm just curious if there's a better way.

PS: This is the banking part of the script (just opening the bank part)
begin
repeat
SetAngle(SRL_ANGLE_HIGH);
OpenBankChest(SRL_BANK_SW);
until BankScreen or PinScreen;
end;
and this is the script: http://villavu.com/forum/showthread.php?t=75775

Sorry with the nooby questions, still learning :D

Thanks for responses. Sorry if I confused anyone.

YoHoJo

2012-05-31 04:48:00

Before banking put
MarkTime(Bank);
And then somewhere later when you wish to check put
If TimeFromMark(Bank) > 15000 Then
Logout;

That will log out if 15 seconds have passed since the Bank timer was made.

Justin

2012-05-31 04:49:18

You might also want to add a wait in there else it will keep opening the bank over and over until it finds the screen

Roflme

2012-05-31 05:02:43

From: YoHoJo
Before banking put
MarkTime(Bank);
And then somewhere later when you wish to check put
If TimeFromMark(Bank) > 15000 Then
Logout;

That will log out if 15 seconds have passed since the Bank timer was made.


Bah, I didn't even think of adding that as well. Thank you.


Does 'FindBank' automatically detect banks? Because 'FindBank('Bank Chest');' seems to compile just fine.

Like, I wrote this in like two minutes
  begin
repeat
SetAngle(SRL_ANGLE_HIGH);
Wait(100+Random(100));
MarkTime(banking);
if FindBank('Bank Chest') then
OpenBankChest(SRL_BANK_SW);
if not FindBank('Bank Chest') then
FindColor(x, y, 2413294, 574, 26, 1468, 182);
MMouse(x, y, 5, 5);
ClickMouse(x, y, mouse_Right);
Wait(100+Random(100));
OpenBankChest(SRL_BANK_SW);
until BankScreen or PinScreen;
If TimeFromMark(banking) > 20000 then
Logout;
end;

Before I test it does anyone know if it WILL be successful? As stated above I'm just trying to get it to try to find the bank, and if it's in sight to open it. And if it's not, click on the money symbol to return near the bank, and then try to open the bank again.

EDIT:
From: [J]ustin
You might also want to add a wait in there else it will keep opening the bank over and over until it finds the screen


Alright I'll add that. Keep looking over the smaller things to add :(. Thanks!