NKN
04-20-2012, 01:37 AM
This tutorial is about -finding- the bank, because, in my opinion, the SRL ones are just too slow, and you have to put which bank, this just makes it easier on you.
Contents
What we're using
How to find the bank
How to use
Conclusion
What we're using
We'll be using AutoColorAid to find the colors.
The link can be found here. (http://villavu.com/forum/showthread.php?t=26944)
Alright. This is what how you need to set it up.
Go to Client -> Find RS
http://i49.tinypic.com/2d7iry9.png
After you clicked two, click on the booths, click about three different booths, about 7 - 10 times each in different places, to get a good reading. Click "Mark Best Color" and if mostly only those are colored red, you did it! If say, the ground is lit, redo it with less points.
This is my final picture:http://i39.tinypic.com/35mii61.png
The color: That's the color you'll be needed. The first and second number I circled, we'll get to that in a minute.
How to find the bank
You got your info on the Autocolor, time to put it into code.
function FindBankTeller(var x, y : Integer) : Boolean;
var
a : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box,SearchArea : TBox;
begin
if not LoggedIn then Exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03,0.78);
SearchArea := IntToBox((MSCX - 200),(MSCY - 100),(MSCX),(MSCY + 150));
SMART_DrawBoxEx(True,SearchArea,clPurple);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,2313821,MS CX -200,MSCY - 100 ,MSCX,MSCY + 150,9);
SortTPAFrom(TPA,point(MSCX,MSCY));
ATPA := TPAtoATPAEx(TPA,15,15);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
Box := IntToBox((MP.x - 20),(MP.y - 20),(MP.x + 20),(MP.y + 20));
SMART_DrawBoxEx(False,Box,clYellow);
MMouse(MP.x,MP.y,4,4);
if(WaitUpText('ank',750))then
begin
While(InvCount > 15) do
begin
x := MP.x; y := MP.y;
Result := True
SMART_ClearCanvas;
Mouse(x,y,0,0,True);
WaitFunc(@BankScreen, 10 + Random(15), 10000);
Deposit(2,28,True);
Writeln('Depotsitied');
Ore := Ore+28
stats_IncVariable('Clay (Mined)',27);
stats_IncVariable('Total Exp Gained',140);
Antiban;
end;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2,0.2);
end;
I'm not going to go over all of it, but I'll go over the parts you need to know.
SetColorSpeed2Modifyers: The first number should be the red circled number, and the second the green.
SearchArea: is defined as a Tbox, or three points. I used MSCX and MSCY to start the box, and them again to mark the end. The first two is the first corner of the box, the second is the last. MSCX/Y is Main Screen Center, then plus or minus X/y To make a box.
SMART_DrawBoxEx: This draws the box on screen do you know what you're looking at. Set the first variable to True if you want it to clear the screen, or false to keep it there. Second variable is the name of the Tbox, third is the color (cl"ColorName").
FindSpiralTolerance: You use MSCX,MSCY as the first two, then TPA, then the color, then where it searches, this is where painting the box comes in handy, so you know where it's looking. Those four that should usually be MSX1, MSY1,ect, should be the same thing you put in the box! The tolerance is off to the right of the AutoColorAid program(ACA). It's right under Main color. The - is not a minus sign, tolerance is always positive!
WaitFunc: This waits for the BankScreen, which is @BankScreen. It waits 10 seconds, checking every 10 milliseconds, plus random 15.
The rest you should be able to gauge what it does, and how to work it!
How to use it
You call it in a function like this if(-NameOfFunction-(x,y)) then //The (x,y) has to be after the name for it to work, that's where it saves the location to.
begin
//blah blah blah, remember, the banking is done IN the color finding function, so this is AFTERWARDS
end;
Conclusion
I hoped this helped, I know I didn't go that into detail, because I just recently learned how to use this correctly, so I was trying not to give any wrong information. If anything is wrong, please leave a post so I can fix it right away. For more detail on what these do, please refer to "Kyle Undefined"'s Your First Simple Script tutorial, he uses the same thing, but for a different reason.
Cheers, NKN
Contents
What we're using
How to find the bank
How to use
Conclusion
What we're using
We'll be using AutoColorAid to find the colors.
The link can be found here. (http://villavu.com/forum/showthread.php?t=26944)
Alright. This is what how you need to set it up.
Go to Client -> Find RS
http://i49.tinypic.com/2d7iry9.png
After you clicked two, click on the booths, click about three different booths, about 7 - 10 times each in different places, to get a good reading. Click "Mark Best Color" and if mostly only those are colored red, you did it! If say, the ground is lit, redo it with less points.
This is my final picture:http://i39.tinypic.com/35mii61.png
The color: That's the color you'll be needed. The first and second number I circled, we'll get to that in a minute.
How to find the bank
You got your info on the Autocolor, time to put it into code.
function FindBankTeller(var x, y : Integer) : Boolean;
var
a : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box,SearchArea : TBox;
begin
if not LoggedIn then Exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03,0.78);
SearchArea := IntToBox((MSCX - 200),(MSCY - 100),(MSCX),(MSCY + 150));
SMART_DrawBoxEx(True,SearchArea,clPurple);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,2313821,MS CX -200,MSCY - 100 ,MSCX,MSCY + 150,9);
SortTPAFrom(TPA,point(MSCX,MSCY));
ATPA := TPAtoATPAEx(TPA,15,15);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
Box := IntToBox((MP.x - 20),(MP.y - 20),(MP.x + 20),(MP.y + 20));
SMART_DrawBoxEx(False,Box,clYellow);
MMouse(MP.x,MP.y,4,4);
if(WaitUpText('ank',750))then
begin
While(InvCount > 15) do
begin
x := MP.x; y := MP.y;
Result := True
SMART_ClearCanvas;
Mouse(x,y,0,0,True);
WaitFunc(@BankScreen, 10 + Random(15), 10000);
Deposit(2,28,True);
Writeln('Depotsitied');
Ore := Ore+28
stats_IncVariable('Clay (Mined)',27);
stats_IncVariable('Total Exp Gained',140);
Antiban;
end;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2,0.2);
end;
I'm not going to go over all of it, but I'll go over the parts you need to know.
SetColorSpeed2Modifyers: The first number should be the red circled number, and the second the green.
SearchArea: is defined as a Tbox, or three points. I used MSCX and MSCY to start the box, and them again to mark the end. The first two is the first corner of the box, the second is the last. MSCX/Y is Main Screen Center, then plus or minus X/y To make a box.
SMART_DrawBoxEx: This draws the box on screen do you know what you're looking at. Set the first variable to True if you want it to clear the screen, or false to keep it there. Second variable is the name of the Tbox, third is the color (cl"ColorName").
FindSpiralTolerance: You use MSCX,MSCY as the first two, then TPA, then the color, then where it searches, this is where painting the box comes in handy, so you know where it's looking. Those four that should usually be MSX1, MSY1,ect, should be the same thing you put in the box! The tolerance is off to the right of the AutoColorAid program(ACA). It's right under Main color. The - is not a minus sign, tolerance is always positive!
WaitFunc: This waits for the BankScreen, which is @BankScreen. It waits 10 seconds, checking every 10 milliseconds, plus random 15.
The rest you should be able to gauge what it does, and how to work it!
How to use it
You call it in a function like this if(-NameOfFunction-(x,y)) then //The (x,y) has to be after the name for it to work, that's where it saves the location to.
begin
//blah blah blah, remember, the banking is done IN the color finding function, so this is AFTERWARDS
end;
Conclusion
I hoped this helped, I know I didn't go that into detail, because I just recently learned how to use this correctly, so I was trying not to give any wrong information. If anything is wrong, please leave a post so I can fix it right away. For more detail on what these do, please refer to "Kyle Undefined"'s Your First Simple Script tutorial, he uses the same thing, but for a different reason.
Cheers, NKN