Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 3.91 KB | None | 0 0
  1. program StewBuyer;
  2. {$DEFINE SMART}
  3. {$i srl\srl.scar}
  4. {$i reflection\reflection.simba}
  5.  
  6. const
  7.  
  8. {---SMART Setup Constants---}
  9.   WORLD = 32;
  10.   MEMBERS = false;
  11.   SIGNED = true;
  12. {---------------------------}
  13.  
  14. var
  15.   Path: TTileArray;
  16.   StewTime: Integer;
  17.  
  18. const
  19.   Bartender = 737;
  20.   Coins = 995;
  21.  
  22. procedure Setup;
  23. begin
  24.   Smart_Members := MEMBERS;
  25.   Smart_Server := WORLD;
  26.   Smart_Signed := SIGNED;
  27.  
  28.   Path:= [Tile(2726, 3492), Tile(2721, 3486),
  29.           Tile(2709, 3484), Tile(2695, 3486),
  30.           Tile(2690, 3495)];
  31.  
  32.   SetupSRL;
  33.   SetupReflectionEx(true);
  34. end;
  35.  
  36. function ReverseTiles(TPA: TTileArray): TTileArray;
  37. var
  38.   x: Integer;
  39. begin
  40.   SetArrayLength(Result, Length(TPA));
  41.   for x:=0 to High(TPA) do
  42.     Result[x]:= TPA[High(TPA)-x];
  43. end;
  44.  
  45. procedure BankStuff;
  46. begin
  47.   if R_OpenBankBooth('seers') then
  48.   begin
  49.     R_DepositAllButID(Coins);
  50.     CloseBank;
  51.   end;
  52. end;
  53.  
  54. procedure WalkToPub(ToPub: Boolean);
  55. var
  56.   ThePath: TTileArray;
  57. begin
  58.   if ToPub then
  59.     ThePath:= Path
  60.   else
  61.     ThePath:= ReverseTiles(Path);
  62.  
  63.   WalkPath(ThePath);
  64. end;
  65.  
  66. procedure GoToBartender;
  67. var
  68.   BartenderPos: TNPC;
  69. begin
  70.   FindNPC(Bartender, BartenderPos);
  71.   if (not(TileOnMS(BartenderPos.Tile, 10))) then
  72.     if TileOnMM(BartenderPos.Tile) then
  73.       WalkToTile(BartenderPos.Tile, 1, 0);
  74. end;
  75.  
  76. procedure TalkToBartender;
  77. var
  78.   BartenderPos: TNPC;
  79.   MSPos: TPoint;
  80.   TempBitmap, Trashx, Trashy: Integer;
  81. begin
  82.   if (TimeFromMark(StewTime)>30000) then Exit;
  83.   GoToBartender;
  84.   FindNPC(Bartender, BartenderPos);
  85.   if TileOnMS(BartenderPos.Tile, 10) then
  86.   begin
  87.     MSPos:= TileToMS(BartenderPos.Tile, 10);
  88.     Mouse(MSPos.x, MSPos.y, 0, 0, False);
  89.     Wait(200+Random(300));
  90.     TempBitmap:= BitmapFromClient(207, 429, 277, 464);
  91.     R_ChooseOptionMulti(['alk', 'arte', 'nder']);
  92.     R_Flag;
  93.     repeat
  94.       if ((not(FindBitmapIn(TempBitmap, Trashx, Trashy, MCX1, MCY1, MCX2, MCY2)))or ClickContinue(False, False)) then
  95.         break;
  96.       if (TimeFromMark(StewTime)>30000) then Exit;
  97.       Wait(500+Random(500));
  98.       Writeln('1');
  99.     until(false);
  100.     FreeBitmap(TempBitmap);
  101.     TempBitmap:= BitmapFromClient(207, 429, 277, 464);
  102.     ClickToContinue;
  103.     repeat
  104.       if ((not(FindBitmapIn(TempBitmap, Trashx, Trashy, MCX1, MCY1, MCX2, MCY2))) or ClickToContinue) then
  105.         break;
  106.       if (TimeFromMark(StewTime)>30000) then Exit;
  107.       Wait(500+Random(500));
  108.       Writeln('2');
  109.     until(false);
  110.     FreeBitmap(TempBitmap);
  111.   end;
  112. end;
  113.  
  114. procedure ClickTheText(Which: Integer);
  115. var
  116.   TempBitmap, Trashx, Trashy, Tempx, Tempy: Integer;
  117. begin
  118.   if (TimeFromMark(StewTime)>30000) then Exit;
  119.   Wait(500+Random(500));
  120.   TempBitmap:= BitmapFromClient(207, 429, 277, 464);
  121.   case Which of
  122.     2, 3, 5, 6: ClickToContinue;
  123.     1: begin
  124.          if FindTextTPAEx(clBlack, 0, MCX1, MCY1, MCX2, MCY2, Tempx, Tempy, 'hat do you', CharsNPC, Nothing) then
  125.            Mouse(Tempx, Tempy, 80, 5, True)
  126.          else
  127.            ClickTheText(Which);
  128.        end;
  129.     4: begin
  130.          if FindTextTPAEx(clBlack, 0, MCX1, MCY1, MCX2, MCY2, Tempx, Tempy, 'I have some', CharsNPC, Nothing) then
  131.            Mouse(Tempx, Tempy, 80, 5, True)
  132.          else
  133.            ClickTheText(Which);
  134.        end;
  135.   end;
  136.   repeat
  137.     if ((not(FindBitmapIn(TempBitmap, Trashx, Trashy, MCX1, MCY1, MCX2, MCY2))) and (not(PleaseWait))) then
  138.       break;
  139.       if (TimeFromMark(StewTime)>30000) then Exit;
  140.     Wait(500+Random(500));
  141.     Writeln('3');
  142.   until(false);
  143.     FreeBitmap(TempBitmap);
  144. end;
  145.  
  146. procedure DoBartender;
  147. var
  148.   i: Integer;
  149. begin
  150.   repeat
  151.     MarkTime(StewTime);
  152.     TalkToBartender;
  153.     for i:=1 to 6 do
  154.       ClickTheText(i);
  155.     R_FindRandoms;
  156.   until(InvFull);
  157. end;
  158.  
  159. begin
  160.   Setup;
  161.   repeat
  162.     R_FindRandoms;
  163.     WalkToPub(true);
  164.     R_FindRandoms;
  165.     DoBartender;
  166.     R_FindRandoms;
  167.     WalkToPub(false);
  168.     R_FindRandoms;
  169.     BankStuff;
  170.   until(false)
  171. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement