Janilabo

Untitled

Aug 24th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 5.97 KB | None | 0 0
  1. program SharkFisher;
  2.  
  3. {$i RSCS/RSCS.simba}
  4.  
  5. var
  6.   certersbmp, fishspotbmp, harpoonbmp, talktobmp, mX, mY, tm, tm2: Integer;
  7.   tempX, tempY:Integer;
  8.   pp:TPoint;
  9.  
  10. procedure LoadingBitmaps;
  11. begin
  12.   certersbmp := BitmapFromString(33, 44, 'meJzt1s0JgDAMBtDgyYPDOIZjeH' +
  13.   'D/FWqxWISSEvOHlpRc/Z5JRQLbDBq1X0clKgh6TucI86f1qOVAtCU' +
  14.   'k+uFygpL/ZaI8ZUfQwyvBaEFIpAQq88GInF/KjnDoQvFDciDyuE0J' +
  15.   'uC/1110Mc91BBBFEW8P8BtkblOl684pgb4CUibFfnt6LFoEpWuHYx' +
  16.   'NTzfYgnZJdfCLtwa0I8nOUEHP/GNQ==');
  17.  
  18.   fishspotbmp := BitmapFromString(15, 20, 'meJyrc1Coozv6/5+BeJUQRLbJTA' +
  19.   'YpxDsMqHhEof///xOvEgKoYjK1Eg/+hIGceIhJSMSbTF0EADF8/wQ=');
  20.  
  21.   harpoonbmp := BitmapFromString(47, 11, 'meJzNkMEKACAIQ/v/n150E8spZu' +
  22.   'ROMdx6DFgaPYSWMIoKQkcnHiRtKm71x2l5MzcjcT7FfpyGiZjHg18' +
  23.   'wrtkThqxXZcq/3GUsSG5a75zuGwr1AmYChNZJ0w==');
  24.  
  25.   talktobmp := BitmapFromString(38, 9, 'meJytkMEOACAIQvv/n7ZDm2uGYJa' +
  26.   '3lHyCWayRlE+5zMVSUNdI8dW20Nn7kAiXw49BeT6JNWk2O6l+KgSR' +
  27.   '6HpEaY1AG0Q44qnCNL4TYTiPqcLLJTGzvzoT0o/ATg==');
  28.  
  29.   FastReplaceColor(certersbmp, 16777215, 0);
  30.   FastReplaceColor(certersbmp, 16711422, 0);
  31.   FastReplaceColor(certersbmp, 255, 0);
  32.   FastReplaceColor(certersbmp, 65535, 0);
  33.  
  34.   FastReplaceColor(fishspotbmp, 16777215, 0);
  35.   FastReplaceColor(fishspotbmp, 16711422, 0);
  36.   FastReplaceColor(fishspotbmp, 255, 0);
  37.   FastReplaceColor(fishspotbmp, 65535, 0);
  38. end;
  39.  
  40. procedure WalkFishSpot;
  41. begin
  42.   if not InvSpotSearch(545, 30) then
  43.   begin
  44.     tm2 := GetSystemTime;
  45.     repeat
  46.       if OpenGameTab(4) then
  47.         if FindDeformedBitmapToleranceIn(fishspotbmp, X, Y, 357, 85, 505, 183, 2, 0, True, accuracy) then
  48.         begin
  49.           MoveMouse(X + (15/2), Y + (20/2));
  50.           Wait(100 + Random (50));
  51.           ClickMouse(X + (15/2), Y + (20/2), Mouse_Left);
  52.           Writeln('Walking to fishing spot..');
  53.           tm2 := GetSystemTime;
  54.           repeat
  55.             Wait(50);
  56.           until (FindColor(tempX, tempY, 16578808, 190, 200, 281, 281) or ((GetSystemTime - tm) >= 8000));
  57.         end;
  58.     until (FindColor(tempX, tempY, 16578808, 190, 200, 281, 281) or ((GetSystemTime - tm2) >= 20000));
  59.   end;
  60. end;
  61.  
  62. procedure IsSleepAdjusted(fat:Integer);
  63. begin
  64.   if (StrToIntDef(ExtractFromStr(RSCE_FatigueReader, Numbers),0)) > fat then
  65.   begin
  66.     Writeln('A mod has adjusted your fatigue.');
  67.     Writeln('Stopping the script..');
  68.     if FileExists(AppPath + 'Includes\RSCS\misc\siren.wav') then
  69.     begin
  70.       PlaySound(AppPath + 'Includes\RSCS\misc\siren.wav');
  71.       Wait(10);
  72.     end;
  73.     TerminateScript;
  74.   end;
  75. end;
  76.  
  77. procedure Fishing;
  78. begin
  79.   tm := GetSystemTime;
  80.   repeat
  81.     IsSleepAdjusted(90);
  82.     SleepCheck(81,90);
  83.     LoginCheck;
  84.     MoveMouse(215 + Random(5), 121 + Random(20));
  85.     Wait(100 + Random(15));
  86.     if FindColor(X, Y, 16578808, 190, 200, 281, 281)  then
  87.     begin
  88.       MoveMouse(X, Y);
  89.       Wait(100);
  90.       if RSCE_UpText(WHITE) = 'net / 3 more options' then
  91.       begin
  92.         ClickMouse(Object_P.X, Object_P.Y, mouse_right);
  93.         GetMousePos(mX, mY);
  94.         Wait(150 + Random(15));
  95.         if FindBitmapIn(harpoonbmp, X, Y, 0, mY, 500, 330) then
  96.         begin
  97.           MoveMouse(X + Random(10), Y + Random(3));
  98.           ClickMouse(X + Random(10), Y + Random(3), Mouse_Left);
  99.           Wait(200 + Random(50));
  100.           Writeln('Fishing.. (Fatigue:' + RSCE_FatigueReader + ')');
  101.         end;
  102.       end;
  103.     end;
  104.   until InvSpotSearch(545, 30) or ((GetSystemTime - tm) >= 60000) ;
  105. end;
  106.  
  107. procedure Certing;
  108. begin
  109.   repeat
  110.     LoginCheck;
  111.     if InvSpotSearch(545, 30) then
  112.     begin
  113.       if OpenGameTab(4) then
  114.       begin
  115.         Wait(400);
  116.         Writeln('Walking to certers..');
  117.         if FindDeformedBitmapToleranceIn(certersbmp, X, Y, 420, 78, 492, 135, 5, 0, True, accuracy) then
  118.         begin
  119.           MoveMouse(X + (33/2), Y + (44/2));
  120.           Wait(400);
  121.           ClickMouse(X + (33/2), Y + (44/2), Mouse_Left);
  122.           tm := GetSystemTime;
  123.           repeat
  124.             Wait(50);
  125.           until (SearchForNPC(pp, PADIK) or ((GetSystemTime - tm) >= 8000));
  126.           if SearchForNPC(pp, PADIK) then
  127.           begin
  128.             MoveMouse(pp.X, pp.Y);
  129.             Wait(200);
  130.             if (Pos('padik..', Lowercase(RSCE_UpText(YELLOW))) > 0) then
  131.             begin
  132.               ClickMouse(pp.X, pp.Y, Mouse_Right);
  133.               GetMousePos(mX, mY);
  134.               Wait(350 + Random(50));
  135.               if FindBitmapIn(talktobmp, X, Y, 0, mY, 500, 330) then
  136.               begin
  137.                 MoveMouse(X, Y);
  138.                 ClickMouse(X, Y, Mouse_Left);
  139.                 Writeln('Talking to Padik..');
  140.                 Wait(100 + Random(50));
  141.                 tm2 := GetSystemTime;
  142.                 repeat
  143.                   Wait(10);
  144.                 until (ChoiceIsOpen or ((GetSystemTime - tm2) >= 8000));
  145.                 if ChoiceIsOpen then
  146.                 begin
  147.                   ChooseChoice(2);
  148.                   Wait(300);
  149.                   tm2 := GetSystemTime;
  150.                   repeat
  151.                     Wait(10);
  152.                   until (ChoiceIsOpen or ((GetSystemTime - tm2) >= 4000));
  153.                   tm2 := GetSystemTime;
  154.                   repeat
  155.                     Wait(10);
  156.                   until (ChoiceIsOpen or ((GetSystemTime - tm2) >= 4000));
  157.                   ChooseChoice(4);
  158.                   Wait(300);
  159.                   repeat
  160.                     Wait(10);
  161.                   until (ChoiceIsOpen or ((GetSystemTime - tm2) >= 4000));
  162.                   ChooseChoice(5);
  163.                    Wait(300);
  164.                 end;
  165.               end;
  166.             end;
  167.           end;
  168.         end;
  169.       end;
  170.     end;
  171.   until not InvSpotSearch(545, 30);
  172. end;
  173.  
  174. procedure FreeBitmaps;
  175. begin
  176.   FreeBitmap(certersbmp);
  177.   FreeBitmap(fishspotbmp);
  178.   FreeBitmap(harpoonbmp);
  179.   FreeBitmap(talktobmp);
  180. end;
  181.  
  182. begin
  183.   SetupRSCS;
  184.   repeat
  185.     LoadingBitmaps;
  186.     WalkFishSpot;
  187.     Fishing;
  188.     Certing;
  189.     FreeBitmaps;
  190.     ClearDebug;
  191.   until(IsKeyDown(113));
  192.   UnSetupRSCS;
  193. end.
Advertisement
Add Comment
Please, Sign In to add comment