SRL Archive - SRL Archives

* function OpenBankNPC: Boolean;


Home

2009-09-28 02:31:18

Hello i didn't saw any NPC bank openers so i created one, tested in several worlds and Towns. Please test and tell me what you think.

Thanks.


{*******************************************************************************
function OpenBankNPC: Boolean;
By: Home
Description: Opens the bank by using Banker.
*******************************************************************************}
function OpenBankNPC: Boolean;
var
bx, by, Speed, ColFace, ColGrey, ColBlue: Integer;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColFace := 7774419; // Face Color
ColGrey := 6381925; // Grey Color [ Clothes ]
ColBlue := 2429979; // Blue Color [ Clothes ]
if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey], [5, 5, 5], ['anke', 'to B', 'Banker', 'nker'], 2, 2)) then begin
Mouse(bx, by, 0, 0, False);
WaitOption('ank B', 300);
FFlag(0);
Wait(2000 + Random(500));
if (Length(Players) > 0) then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
end;
ColorToleranceSpeed(Speed);
end;


~Home

Neehosoft

2009-09-28 06:56:15

This could fix the problem with draynor banking.
Mind if i use in my script?

TRiLeZ

2009-09-28 08:01:02

From: Neehosoft
This could fix the problem with draynor banking.
Mind if i use in my script?


Hes wanting to add this to the include; it would be public and everyone would be able to use this.

So what do you think? Remember to keep the description of the funtion with the function.

Neehosoft

2009-09-28 08:03:01

From: TRiLeZ
Hes wanting to add this to the include; it would be public and everyone would be able to use this.

So what do you think? Remember to keep the description of the funtion with the function.


:( You made me cry

TRiLeZ

2009-09-28 08:04:07

From: Neehosoft
:( You made me cry


:( I didnt mean to make you cry.
How did I even make you cry?

Neehosoft

2009-09-28 08:08:08

From: TRiLeZ
:( I didnt mean to make you cry.
How did I even make you cry?


You make me feel stupid

Baked0420

2009-09-28 08:20:51

lol I was going to post that he wants it in the include also, then I felt like I shouldn't say anything, and just let Home answer, because I don't know if he wants people using it without it being in the include, but my guess would be he wouldn't care if you credit him. I would still wait for him to answer though.

BobboHobbo

2009-09-28 10:37:18

Ahh, nice Home! Maybe we could have this and make a MixOpenBank procedure which either uses OpenBankNPC or the original OpenBank.

GJ.

Home

2009-09-28 11:37:39

You can use it in scripts and so on :) And btw Bobbohobbo, i got this idea because i saw your thread and i tested your script and banking was slow :)

And thanks for comments people.

~Home

marpis

2009-09-28 16:40:58

Works great in Edgeville :) Using this in my MiniYews script

Home

2009-09-28 19:22:40

From: marpis
Works great in Edgeville :) Using this in my MiniYews script


Good to hear that someone find a use for this :) Well i use this in most banks :) Works very well and pretty fast.

~Home

Baked0420

2009-09-28 19:53:02

your a tricky one, for a second there, I thought this:

if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey], [5, 5, 5], ['anke', 'to B', 'Banker', 'nker'], 2, 2)) then begin

didn't have a begin in it, most people put begin on the next line :p

I thought there was a bug because you right click then go on without a begin, but there is one. Maybe put it on the next line to look like most other procedures/functions and to not be so confusing lol. I like your idea though, I think this should get committed.

Home

2009-09-29 03:20:26

From: Baked0420
your a tricky one, for a second there, I thought this:

if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey], [5, 5, 5], ['anke', 'to B', 'Banker', 'nker'], 2, 2)) then begin

didn't have a begin in it, most people put begin on the next line :p

I thought there was a bug because you right click then go on without a begin, but there is one. Maybe put it on the next line to look like most other procedures/functions and to not be so confusing lol. I like your idea though, I think this should get committed.


He, he sorry :) My "Standards" kinda are not so official, but isn't the most importan thig that Function / Procedure works :)

~Home

Awkwardsaw

2009-09-29 04:47:09

From: Home
He, he sorry :) My "Standards" kinda are not so official, but isn't the most importan thig that Function / Procedure works :)

~Home


i liek using teh if then begin too :)

and nice function

Neehosoft

2009-09-29 07:43:35

From: Home
Good to hear that someone find a use for this :) Well i use this in most banks :) Works very well and pretty fast.

~Home


I use it for my Firemaker in varrock, and for my willow cutter, and i will use for my flax picker and spinner

Heavenzeyez1

2009-09-29 23:40:31

Thanks, rep++ dude.
Works like a charm in Draynor. :)
I'll add it to my script!
~Eerik~

rogeruk

2009-09-30 02:13:18

{*******************************************************************************
function OpenBankNPC: Boolean;
By: Home
Description: Opens the bank by using Banker.
*******************************************************************************}

Function OpenBankNPC: Boolean;
Var
bx, by, Speed, ColFace, ColGrey, ColBlue: Integer;
Begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColFace := 7774419; // Face Color
ColGrey := 6381925; // Grey Color [ Clothes ]
ColBlue := 2429979; // Blue Color [ Clothes ]
If (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey],
[5, 5, 5], ['anke', 'to B', 'Banker', 'nker'], 2, 2)) Then
Begin
Mouse(bx, by, 0, 0, False);
WaitOption('ank B', 300);
FFlag(0);
Wait(2000 + Random(500));
If (Length(Players) > 0) Then If (Players[CurrentPlayer].Pin <> '') Then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) Or (PinScreen);
End;
ColorToleranceSpeed(Speed);
End;

Used my standards wand on that ;).

Looks great! Rep+

Home

2009-09-30 13:27:30

From: rogeruk
{*******************************************************************************
function OpenBankNPC: Boolean;
By: Home
Description: Opens the bank by using Banker.
*******************************************************************************}

Function OpenBankNPC: Boolean;
Var
bx, by, Speed, ColFace, ColGrey, ColBlue: Integer;
Begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColFace := 7774419; // Face Color
ColGrey := 6381925; // Grey Color [ Clothes ]
ColBlue := 2429979; // Blue Color [ Clothes ]
If (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey],
[5, 5, 5], ['anke', 'to B', 'Banker', 'nker'], 2, 2)) Then
Begin
Mouse(bx, by, 0, 0, False);
WaitOption('ank B', 300);
FFlag(0);
Wait(2000 + Random(500));
If (Length(Players) > 0) Then If (Players[CurrentPlayer].Pin <> '') Then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) Or (PinScreen);
End;
ColorToleranceSpeed(Speed);
End;

Used my standards wand on that ;).

Looks great! Rep+



He, he :) My standards are not kinda official :D
But thanks :)

~Home

rogeruk

2009-10-03 03:51:09

Problem with it working at Al Kharid. Any chance of you looking at it?

Tried changing colors but no good just moves mouse around the floor.

BobboHobbo

2009-10-03 03:59:24

Yeah, I couldnt get it to go perfectly to at Draynor, tried changing colours still goes around the floor before it goes to the banker.

Home

2009-10-03 04:44:31

Try adding before OpenBankNPC to Angle down.

~Home

P.S For me it works :S

rogeruk

2009-10-03 04:50:25

You mean
SetAngle(True);
?

Home

2009-10-03 05:06:00

From: rogeruk
You mean
SetAngle(True);
?


No ;) Set angle false.

If not openbankNPC then begin
Set angle(False)
OpenBankNPC;
SetAngle(True)
end
else
…. You know :)


~Home

rogeruk

2009-10-03 05:07:51

Yea didnt know which way you meant :P.

Heavenzeyez1

2009-10-03 16:48:32

From: BobboHobbo
Yeah, I couldnt get it to go perfectly to at Draynor, tried changing colours still goes around the floor before it goes to the banker.


Works perfectly for me in draynor?

Eerik.

rogeruk

2009-10-03 16:56:26

Watched my script for a bit and sometimes char was still moving while trying to look for bank so it didnt work.

Rich

2009-10-03 19:00:33

From: BobboHobbo
Yeah, I couldnt get it to go perfectly to at Draynor, tried changing colours still goes around the floor before it goes to the banker.


Is that in your Draynor Chopper? I get the same problem when using your script.

Sir R. M8gic1an

2009-10-04 14:44:28

Added :) GJ

~RM

Sandstorm

2009-10-04 17:46:30

Cool function. I think it's been so long since they used the committed tag they forgot an M :o.

~Sandstorm

Rich

2009-10-04 19:07:57

From: Rasta Magician
Added :) GJ

~RM


But it doesn't work fully in Draynor…Did you change it to work then?

marpis

2009-10-06 19:20:43

Edited it so that it waits until Bank/Pin screen appears. Also now it doesn't wait 2sec in vain if the banker wasn't found (misclick)

Uses WaitFunc so this would require BankScreenOrPinScreen: Boolean; to be commited as well.

Works perfectly in Catherby btw ;) Awesome job Home!

function BankScreenOrPinScreen: Boolean;
begin
Result := BankScreen or PinScreen;
end;
{*******************************************************************************
function OpenBankNPC: Boolean;
By: Home, edited by marpis
Description: Opens the bank by using Banker.
*******************************************************************************}
function OpenBankNPC2: Boolean;
var
bx, by, Speed, ColFace, ColGrey, ColBlue: Integer;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColFace := 7774419; // Face Color
ColGrey := 6381925; // Grey Color [ Clothes ]
ColBlue := 2429979; // Blue Color [ Clothes ]
if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey], [5, 5, 5], ['anke', 'to B', 'Banker', 'nker'], 2, 2)) then
begin
Mouse(bx, by, 0, 0, False);
if WaitOption('ank B', 350 + Random(50)) then
begin
FFlag(0);
Result := WaitFunc(@BankScreenOrPinScreen, 100, 10000 + Random(2000));
if Result then
if (Length(Players) > 0) then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
end;
end;
ColorToleranceSpeed(Speed);
end;