euphemism

Untitled

Jan 15th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.81 KB | None | 0 0
  1.                                                                      
  2.                                                                      
  3.                                                                      
  4.                                              
  5. function OpenChest: Boolean;
  6. var
  7.   AreaBox: TBox;
  8.   TPA:  TPointArray;
  9.   ATPA: T2DPointArray;
  10.   GCTS, i, H, x, y, Timer: Integer;
  11. begin
  12.  
  13.   Result := (LoggedIn) and (BankScreen or PinScreen);
  14.  
  15.   if (Result) then
  16.     Exit;
  17.  
  18.   GCTS := GetColorToleranceSpeed;
  19.   SetColorToleranceSpeed(2);
  20.   SetColorspeed2Modifiers(0.70, 0.36);
  21.  
  22.   FindColorsSpiralTolerance(MSCX, MSCY, TPA, 11645370, MSX1, MSY1, MSX2, MSY2, 3); //going to assume this is the white border of the chest
  23.  
  24.   SetColorspeed2Modifiers(0.2, 0.2);
  25.   SetColorToleranceSpeed(GCTS);
  26.  
  27.  
  28.   SplitTPAWrap(TPA, 5, ATPA);  //if you picked the colors correctly, it should find a solid area of the white, so lower the radius here.
  29.  
  30.   if (Length(TPA) = 0) Then
  31.     Exit;
  32.  
  33.   GCTS := GetColorToleranceSpeed;           //Color stuff for the brown of the chest
  34.   SetColorToleranceSpeed(2);
  35.   SetColorSpeed2Modifiers({BrownColorHue}, {BrownColorSat});
  36.  
  37.   H:= High(ATPA);
  38.  
  39.   for I := 0 To H Do
  40.   begin
  41.  
  42.     AreaBox := GetTPABounds(ATPA[i]);
  43.     findcolorstolerance(TPA, {BrownColor}, AreaBox.x1, AreaBox.y1, AreaBox.x2, AreaBox.y2, {BrownColorTol}); //find the brown color within each white group
  44.  
  45.  
  46.     if (not (Length(TPA) > 150)) then
  47.       Continue;
  48.  
  49.     MMouse(((AreaBox.x2 + AreaBox.x1) / 2), ((AreaBox.y2 + AreaBox.y1) / 2), 4, 4);
  50.  
  51.     if WaitUpTextMulti(['chest', 'hest', 'es'], 2000) then
  52.     begin
  53.  
  54.       Wait(100 + Random(200));
  55.  
  56.       GetMousePos(X, Y);
  57.       Mouse(x, y, 0, 0, True);
  58.  
  59.       Wait(randomRange(1000, 1500));
  60.       Timer := GetTimeRunning + 2500;
  61.  
  62.       while(not((BankScreen) or (PinScreen))) do
  63.       begin
  64.  
  65.         Wait(25);
  66.  
  67.         if(GetTimeRunning > Timer)then
  68.           Break;
  69.       end;
  70.  
  71.       if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
  72.         InPin(Players[CurrentPlayer].Pin);
  73.  
  74.       Result := (BankScreen) or (PinScreen);
  75.  
  76.       if (Result) then
  77.       begin
  78.  
  79.         SetColorSpeed2Modifiers({BrownColorHue}, {BrownColorSat});
  80.         SetColorToleranceSpeed(GCTS);
  81.         Exit;
  82.       end;
  83.     end else
  84.     begin
  85.  
  86.       Mouse(x, y, 0, 0, False);
  87.  
  88.       if WaitOption('chest', 2000) then
  89.       begin
  90.  
  91.         Mouse(x, y, 0, 0, True);
  92.  
  93.         Wait(randomRange(1000, 1500));
  94.         Timer := GetTimeRunning + 2500;
  95.  
  96.         while(not((BankScreen) or (PinScreen))) do
  97.         begin
  98.  
  99.           Wait(25);
  100.  
  101.           If(GetTimeRunning > Timer)then
  102.             Break;
  103.         end;
  104.  
  105.  
  106.           SetColorSpeed2Modifiers(0.2, 0.2);
  107.           SetColorToleranceSpeed(GCTS);
  108.           Exit;
  109.         end;
  110.       end;
  111.     end;
  112.   end;
  113. end;
Advertisement
Add Comment
Please, Sign In to add comment