Janilabo

Untitled

Aug 15th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.27 KB | None | 0 0
  1. program Banker;
  2.  
  3. {$i RSCS/RSCS.simba}
  4.  
  5. function SearchForNPC2(var p: TPoint; j: integer): Boolean;
  6. var
  7.   TPA: TPointArray;
  8. begin
  9.   Result := FindColorsSpiralTolerance(256, 171, TPA, j, 0, 0, 511, 343, 0);
  10.   if not Result then
  11.     Exit;
  12.   p := TPA[Random(Length(TPA))];
  13.   SetLength(TPA, 0);
  14. end;
  15.  
  16. function TalkToBanker: Boolean;
  17. var
  18.   tm: Integer;
  19.   banker_p: TPoint;
  20. begin
  21.   tm := GetSystemTime;
  22.   repeat
  23.     if SearchForNPC2(banker_p, Banker) then
  24.     begin
  25.       MoveMouse(banker_p.X, banker_p.Y);
  26.       Wait(10 + Random(20));
  27.       if (Pos('banker', Lowercase(RSCE_UpText)) <= 0) then
  28.         Exit;
  29.       ClickMouse(banker_p.X, banker_p.Y, Mouse_right);
  30.       Wait(100 + Random(20));
  31.       if (Pos('banker', Lowercase(RSCE_RightClickText)) > 0) then
  32.       begin
  33.         Wait(1000);
  34.         MoveMouse(banker_p.X, (banker_p.Y + 15));
  35.         ClickMouse(banker_p.X, banker_p.Y, Mouse_left);
  36.         Wait(3000 + Random(20));
  37.       end;
  38.     end;
  39.     if ((GetSystemTime - tm) >= 30000) then
  40.       Exit;
  41.     Wait(10);
  42.     Result := ChoiceIsOpen;
  43.     if Result then
  44.       ChooseChoice(1);
  45.   until Result;
  46. end;
  47.  
  48. begin
  49.   ActivateClient;
  50.   Wait(1500);
  51.   if TalkToBanker then
  52.     WriteLn('WOOHOO')
  53.   else
  54.     WriteLn('We failed. :(');
  55. end.
Advertisement
Add Comment
Please, Sign In to add comment