SRL Archive - SRL Suggestions

function OpenBankNPC :Boolean;


Home

2011-12-12 10:44:19

Hey as many of you know OpenBankNPC was not that good.
It's has been on my to-do list for too long, so I created this.

Pros:
~ Faster than old one.
~ Filters moving NPC's (Which moves a lot)
~ Handles GE Bankers
~ Should be more accurate.


function OpenBankNPCEx :Boolean;
var
NPCBox :TBox;
Colors, NPCArray :TPointArray;
ATPA: T2DPointArray;
MSNPC, NPCPoint :TPoint;
TempCTS, C, HiNPC, II, I :Integer;
begin
Result := False;
Result := (BankScreen) or (PinScreen);
If Result then Exit;

NPCArray := GetMinimapDots('NPC');
HiNPC := High(NPCArray);

If Length(NPCArray) = 0 then Exit;
SortTPAFrom(NPCArray, Point(MMCX, MMCY));
for I := 0 to HiNPC do
begin
NPCPoint := MMToMS(NPCArray[I])
If NPCPoint = Point(-1, -1) then Continue;
NPCBox := IntToBox(NPCPoint.X - 40, NPCPoint.Y - 40, NPCPoint.X + 40, NPCPoint.Y + 40)
If PixelShift(NPCBox, 200) > 500 then Continue;

TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 1.52);
FindColorsTolerance(Colors, 6067652, NPCBox.X1, NPCBox.Y1, NPCBox.X2, NPCBox.Y2, 13);
ATPA := TPAToATPAEx(Colors, 15, 20);
SortATPASize(ATPA, True);

for II := 0 to High(ATPA) do
begin
MSNPC := MiddleTPA(ATPA[II]);
MMouse(MSNPC.X, MSNPC.Y, 3, 3);
If WaitUpTextMulti(['ooth', 'anker'], 200) then
begin
Mouse(MSNPC.X, MSNPC.Y, 1, 1, False);
If WaitOptionMulti(['ank B', 'quick'], 300) then
MarkTime(c);
Repeat
Wait(RandomRange(50, 100));
Until (BankScreen) or (PinScreen) or (TimeFromMark(C) > 4500);
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
If Result then
begin
ColorToleranceSpeed(TempCTS);
Exit;
end
else
ColorToleranceSpeed(TempCTS);
end;
end;
end;
end;


~Home

'Toxin

2011-12-12 10:51:58

Awesome, thanks Home! Should be a lot easier to do banking with NPC's as oppose to bankbooths.

Home

2011-12-12 10:56:41

From: XxX Toxin XxX
Awesome, thanks Home! Should be a lot easier to do banking with NPC's as oppose to bankbooths.


It will actually use Both. :P

And there was already and function to bank with NPC's. But it was not very good. (At least I think so :P)

~Home

'Toxin

2011-12-12 10:57:41

From: Home
It will actually use Both. :P

And there was already and function to bank with NPC's. But it was not very good. (At least I think so :P)

~Home


Ah, okay well good to know. Nonetheless, looks good.

putonajonny

2011-12-12 15:28:55

This will be great, I will get testing :)

Coh3n

2011-12-12 17:30:08

How many different banks have you tested with? I'm not sure that all bankers are the same?

Home

2011-12-12 23:49:47

From: Coh3n
How many different banks have you tested with? I'm not sure that all bankers are the same?


It will use Face Color. More testing would be great though :)
So people do some testing :)

EDIT: Tested with all F2P banks and few P2P


~Home

Coh3n

2011-12-13 00:40:02

Worked well for me also. Committed to SRL5. :)

Narcle

2011-12-15 15:33:10

Was testing this with SRL4 but 15 minutes in…


Error: Exception: Access violation at line 28

Line 28:
BMP[I] := BitmapFromClient(B[i].x1,B[i].y1,B[i].x2,B[i].y2);
PixelShiftMulti in animation.scar.

I'll run it some more… but if I got this once already it'll happen again.

Home

2011-12-16 07:28:17

That's very odd Narcle. Please do some testing and give me more results.

~Home

Wyn

2011-12-16 09:55:09

From: Narcle
Was testing this with SRL4 but 15 minutes in…


Error: Exception: Access violation at line 28

Line 28:
BMP[I] := BitmapFromClient(B[i].x1,B[i].y1,B[i].x2,B[i].y2);
PixelShiftMulti in animation.scar.

I'll run it some more… but if I got this once already it'll happen again.


I threw this in a script of mine and had it running for 6 hours…Didn't come across anything.

Brandon

2011-12-16 10:12:43

Working for me as well.. Threw it in SRL 5 and I get the error: "Access Violation" And it highlights SmartGetColor from the GetColor function in the Smart include.

Works perfectly in SRL 4 though.

Edit:
NVM about srl 5.. I can't get any scripts to work.. all access violation at that same line..
Seems to be SPS? When I don't have it, I don't get the error.. when I have SPS, it instantly gives me the error as soon as it hits any line with SPS_*

Narcle

2011-12-16 10:36:47

Yeah… it doesn't like that for some reason.

I got it again after 51 minutes. I didn't get a screenshot of what happened. Setting up for more debug now testing again..

Narcle

2011-12-17 22:39:10

Double post :p

Fixed it up and committed to SRL4.
Enjoy.

:)

I Am Legend

2011-12-17 22:43:48

Edgeville does not work properly