Log in

View Full Version : OpenBankGlass Question



Tim0suprem0
07-19-2007, 10:28 PM
Hi all,

in the OpenBankGlass Function {************************************************* ******************************
function OpenBankGlass(WhichBank: String; ChangeCompass, ChangeAngle: Boolean): Boolean;
By: Wizzup? and modified by Ron
Description: Opens the bank.
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
************************************************** *****************************}

function OpenBankGlass(WhichBank: string; ChangeCompass, ChangeAngle: Boolean): Boolean;
var
OBC: TPoint;
c: Integer;
begin
colortolerancespeed(2);
if ChangeAngle then HighestAngle;
if ChangeCompass then
begin
c := Random(2);
case WhichBank of
'feb', 'fwb', 'veb': if c = 0 then MakeCompass('N') else MakeCompass('S');
'akb', 'db', 'eb', 'vwb': if c = 0 then MakeCompass('E') else MakeCompass('W');
end;
end;
if FindColorTolerance(OBC.x, OBC.y, 10594993, MSX1, MSY1, MSX2, MSY2, 4) then
begin
MMouse(OBC.x, OBC.y, 4, 4);
if IsUpTextMulti('nk', 'bo', 'ot') then
begin
Mouse(OBC.x, OBC.y, 0, 0, False);
Wait(100);
ChooseOption(OBC.x, OBC.y, 'uickly');
FFlag(0);
Wait(2000 + Random(500));
if BankScreen then Result := True;
end;
end else
if FindObj(OBC.x, OBC.y, 'ank', 10594993, 19) then
begin
Mouse(OBC.x, OBC.y, 0, 0, False);
Wait(50);
ChooseOption(OBC.x, OBC.y, 'uickly');
FFlag(0);
Wait(2000 + Random(500));
if BankScreen then Result := True;
end;
colortolerancespeed(1);
end;

it has a case for which direction to turn the camera angle, and it has c:=random(2). Why is that in there? When I run openbankglass for Varrock West Bank ('vwb') and set Changecompass to True it always turns my camera West. When I went and changed the function in SRL to c:=0, then it turned it East everytime because there was no randomization. I'm confoozled, why's it c:=random(2)?? It's not a big problem, because there are several really simple solutions, but I was just curious because it was messing up my script. Thanks!

Killerdou
07-20-2007, 03:32 PM
random(2) results either a value of 0 or a value of 1, maybe its just a coincidence that it turns to the same side every time?

n3ss3s
07-20-2007, 03:52 PM
Let the pro teach ya...
The compass changing depends of the bank you've given to the procedure. :)
You should've read through the code first to realize :)

Tim0suprem0
07-20-2007, 04:06 PM
But then it makes no sense, because turning the camera angle West at Varrock west bank means none of the booths are visible... :confused: And I did read the code lol, I think I just don't understand all of it.


EDIT: And I still dont understand why it needs to be random, if only one result (c = 0) makes the camera turn the correct way.

Pyro
07-20-2007, 08:17 PM
rofl n3ss well you werent much of a pro :p

well from what i can see of it. It just means you are always having the glass in a long line horizontal accross your screen. Not vertical. So whether you are behing the glass or infront it is always a long line horizonal not vertical... and the randomness just means well you can either be infront or behind the glass

Tim0suprem0
07-21-2007, 03:39 AM
Ok thanks Pyro! That's what I thought it might be, but it still seemed illogical. Anyhoo this thread can be closed now :)