Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OpenChest: Boolean;
- var
- AreaBox: TBox;
- TPA: TPointArray;
- ATPA: T2DPointArray;
- GCTS, i, H, x, y, Timer: Integer;
- begin
- Result := (LoggedIn) and (BankScreen or PinScreen);
- if (Result) then
- Exit;
- GCTS := GetColorToleranceSpeed;
- SetColorToleranceSpeed(2);
- SetColorspeed2Modifiers(0.70, 0.36);
- FindColorsSpiralTolerance(MSCX, MSCY, TPA, 11645370, MSX1, MSY1, MSX2, MSY2, 3); //going to assume this is the white border of the chest
- SetColorspeed2Modifiers(0.2, 0.2);
- SetColorToleranceSpeed(GCTS);
- SplitTPAWrap(TPA, 5, ATPA); //if you picked the colors correctly, it should find a solid area of the white, so lower the radius here.
- if (Length(TPA) = 0) Then
- Exit;
- GCTS := GetColorToleranceSpeed; //Color stuff for the brown of the chest
- SetColorToleranceSpeed(2);
- SetColorSpeed2Modifiers({BrownColorHue}, {BrownColorSat});
- H:= High(ATPA);
- for I := 0 To H Do
- begin
- AreaBox := GetTPABounds(ATPA[i]);
- findcolorstolerance(TPA, {BrownColor}, AreaBox.x1, AreaBox.y1, AreaBox.x2, AreaBox.y2, {BrownColorTol}); //find the brown color within each white group
- if (not (Length(TPA) > 150)) then
- Continue;
- MMouse(((AreaBox.x2 + AreaBox.x1) / 2), ((AreaBox.y2 + AreaBox.y1) / 2), 4, 4);
- if WaitUpTextMulti(['chest', 'hest', 'es'], 2000) then
- begin
- Wait(100 + Random(200));
- GetMousePos(X, Y);
- Mouse(x, y, 0, 0, True);
- Wait(randomRange(1000, 1500));
- Timer := GetTimeRunning + 2500;
- while(not((BankScreen) or (PinScreen))) do
- begin
- Wait(25);
- if(GetTimeRunning > Timer)then
- Break;
- end;
- if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
- InPin(Players[CurrentPlayer].Pin);
- Result := (BankScreen) or (PinScreen);
- if (Result) then
- begin
- SetColorSpeed2Modifiers({BrownColorHue}, {BrownColorSat});
- SetColorToleranceSpeed(GCTS);
- Exit;
- end;
- end else
- begin
- Mouse(x, y, 0, 0, False);
- if WaitOption('chest', 2000) then
- begin
- Mouse(x, y, 0, 0, True);
- Wait(randomRange(1000, 1500));
- Timer := GetTimeRunning + 2500;
- while(not((BankScreen) or (PinScreen))) do
- begin
- Wait(25);
- If(GetTimeRunning > Timer)then
- Break;
- end;
- SetColorSpeed2Modifiers(0.2, 0.2);
- SetColorToleranceSpeed(GCTS);
- Exit;
- end;
- end;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment