Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 45.82 KB | None | 0 0
  1. program vAgility;
  2. {$DEFINE SMART}
  3. {$i Aerolib/Aerolib.simba}
  4. {$i Reflection/Reflection.simba}
  5.  
  6. const
  7.  
  8. ////////////////////////////////////////////////////////////////////////////////
  9.  
  10.   Username = '';
  11.   Password = '';
  12.   Course = 'Falador';  //Draynor, Varrock, Falador, Seers
  13.   EATAT = 10;           //Hp to eat at
  14.   FOODTYPE = 'Tuna';   //Any type of food
  15.   cBREAK_IN = 60;      //How long between breaks (minutes)
  16.   cBREAK_FOR = 15;     //How long to break for
  17.   cR_BREAK_IN = 15;    //Random +/- to add to break intervals
  18.   cR_BREAK_FOR = 10;   //Random +/- to add to break time
  19.  
  20. {////////////////////////////////////////////////////////////////////////////////
  21.  
  22. v1.2
  23. -Added Varrock course.
  24. -Added breaks.
  25. -Tweaked the Draynor course to increase antiban and randomness.
  26. -Hopefully fixed the "Error: You passed wrong values to a finder function: xs > xe (0,-3). at line 115" bug.
  27.  
  28. }////////////////////////////////////////////////////////////////////////////////
  29.  
  30.   ScriptVersion = '1.2';
  31.   UseAutoChecker = true;
  32.  
  33. var
  34.   x, y, lapCount, markCount, cH, cW: Integer;
  35.   Rope: TReflectObject;
  36.   MyPlayer: TReflectLocalPlayer;
  37.   pt, position: TPoint;
  38.  
  39. procedure AutoUpdateScript;
  40. var NewFile:integer;
  41.     OnlineVersion, NewScript, NewFileName:string;
  42. begin
  43.   if UseAutoChecker then
  44.   begin
  45.     writeln('Checking for script updates...');
  46.     OnlineVersion := GetPage('http://pastebin.com/raw/4rH3mKsy');
  47.     if (trim(OnlineVersion) > ScriptVersion) then
  48.     begin
  49.       writeLn('Script update available!');
  50.       writeLn('Updating script to v' + OnlineVersion);
  51.       NewScript := GetPage('http://pastebin.com/raw/fuzFwaHq');
  52.       NewFileName := ScriptPath+ 'vAgility.simba';
  53.       NewFile := Rewritefile(NewFileName, true);
  54.       try
  55.         WriteFileString(NewFile, NewScript);
  56.       except
  57.         begin
  58.           writeLn('Fatal error writing to '+NewFileName+'!!');
  59.           terminatescript;
  60.         end;
  61.       end;
  62.       CloseFile(NewFile);
  63.       writeLn('New script downloaded to '+NewFileName+'. Please restart Simba.');
  64.       TerminateScript;
  65.     end else
  66.       writeLn('You have the latest version of the script!');
  67.     end;
  68. end;
  69.  
  70. function Login: Boolean;
  71. begin
  72.   MyPlayer.Username := USERNAME;
  73.   MyPlayer.Password := PASSWORD;
  74.   MyPlayer.Active := True;
  75.   MyPlayer.Create;
  76.   MyPlayer.Login;
  77. end;
  78.  
  79. procedure HandleLogin;
  80. begin
  81.   if (not isLoggedIn()) then
  82.     Login();
  83.   if (isLoggedIn()) then
  84.   begin
  85.     exit;
  86.   end;
  87. end;
  88.  
  89.  
  90. function R_TileOnMS(Tile: TPoint; var OutputPoint: TPoint; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
  91. var
  92.   tempB: TBox;
  93. begin
  94.   OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
  95.   tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
  96.   result := PointInBox(OutputPoint, tempB);
  97. end;
  98.  
  99. procedure randomMouseInput(pnt: Tpoint; ranx, rany: integer);
  100. begin
  101.   case random(3) of
  102.     0: humanMMouse(pnt, ranx, rany);
  103.     1: missMouse(pnt, ranx, rany);
  104.     2: mouse(pnt, ranx, rany, mouse_move);
  105.   end;
  106. end;
  107.  
  108. function R_InteractTile(tile: Tpoint; action: string; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
  109. var
  110.   RSTile: TPoint;
  111. begin
  112.   if R_TileOnMS(Tile, RSTile, x, y, z) then
  113.   begin
  114.     randomMouseInput(rsTile, 3, 3);
  115.     wait(500);
  116.     if (Reflect.Text.IsUpText(action)) then
  117.     begin
  118.       FastClick(mouse_left);
  119.       result := didClick(true, 1000);
  120.     end
  121.     else
  122.     begin
  123.       if TReflectionText.OptionExists(action) then
  124.       begin
  125.         FastClick(mouse_right);
  126.         result := Reflect.Text.ChooseOption(action);
  127.       end;
  128.       if not result then
  129.         randomMouseInput(Point(MSCX, MSCY), 500, 500);
  130.     end;
  131.   end;
  132. end;
  133.  
  134. procedure dismissAllRandoms;
  135. var
  136.   i, j, me_indice: integer;
  137.   _npcs: TReflectNPCArray;
  138.   randoms: tstringarray;
  139. begin
  140.   randoms := ['molly', 'niles', 'miles', 'giles', 'sandwich lady', 'drunken dwarf', 'genie', 'highwayman', 'dr jekyll', 'cap' 'n hand', 'security guard', 'rick turpentine', 'mysterious old man', 'frog', 'null', 'mime', 'sergeant damien', 'freaky forester', 'postie pete', 'tilt', 'flippa', 'leo', 'pillory guard', 'evil bob'];
  141.   _npcs.GetAll;
  142.   me_indice := TReflectLocalPlayer.GetPlayerIndex;
  143.   for i := 0 to high(_npcs) do
  144.   begin
  145.     if (_npcs[i].getInteractingIndex = me_indice) then
  146.     begin
  147.       for j := 0 to high(randoms) do
  148.       begin
  149.         if (pos(randoms[j], lowercase(_npcs[i].getName)) > 0) then
  150.         begin
  151.           if R_InteractTile(_npcs[i].getTile, 'Dismiss', 0, 0, 50) then
  152.           begin
  153.             sleep(2500 + random(1000));
  154.             writeln('Dismissed random: ' + _npcs[i].getname + '  Time Running: ' + TimeRunning);
  155.           end;
  156.         end;
  157.       end;
  158.     end;
  159.   end;
  160. end;
  161.  
  162. procedure Draw(text: string);
  163. var
  164.   xpGained, xpHour, markHour: integer;
  165.   cName: string;
  166. begin
  167.   if (Course = 'Draynor') then
  168.   begin
  169.     xpGained := (120 * lapCount);
  170.     cName := 'Draynor';
  171.   end
  172.   else if (Course = 'Falador') then
  173.   begin
  174.     xpGained := (440 * lapCount);
  175.     cName := 'Falador';
  176.   end
  177.   else if (Course = 'Seers') then
  178.   begin
  179.     xpGained := (570 * lapCount);
  180.     cName := 'Seers';
  181.   end
  182.   else if (Course = 'Varrock') then
  183.   begin
  184.     xpGained := (238 * lapCount);
  185.     cName := 'Varrock';
  186.   end
  187.   xpHour := Round((xpGained) / (GetTimeRunning / 3600000.0));
  188.   markHour := Round((markCount) / (GetTimeRunning / 3600000.0));
  189.   OS_Smart.__Graphics.Clear;
  190.   OS_Smart.__Graphics.DrawClippedText('vAgility: ' + cName, 'upchars07', point(300, 353), 16711680);
  191.   OS_Smart.__Graphics.DrawClippedText('Exp gained: ' + toStr(xpGained) + ' (' + (toStr(xpHour)) + ' p/hr)', 'upchars07', point(300, 370), 16711680);
  192.   OS_Smart.__Graphics.DrawClippedText('Marks of Grace: ' + toStr(markCount) + ' (' + (toStr(markHour)) + ' p/hr)', 'upchars07', point(300, 385), 16711680);
  193.   OS_Smart.__Graphics.DrawClippedText('Total Runtime ' + MsToTime(GetTimeRunning, 3), 'upchars07', point(300, 400), 16711680);
  194.   OS_Smart.__Graphics.DrawClippedText('Status: ' + text, 'upchars07', point(300, 415), 16711680);
  195. end;
  196.  
  197. procedure eatFood;
  198. var
  199.   Food: TReflectInvItem;
  200.   Point: TPoint;
  201. begin
  202.   Draw('Eating ' + FOODTYPE);
  203.   reflect.Gametab.Open(55);
  204.   if food.Find(FOODTYPE) then
  205.   begin
  206.     Point := Food.GetMSPoint;
  207.     reflect.mouse.move(Point, randomrange(2, 4), randomrange(2, 4));
  208.     FastClick(MOUSE_LEFT);
  209.     wait(randomrange(1000, 2000));
  210.   end
  211. end;
  212.  
  213. function waitMove(c: Integer): boolean;
  214. var
  215.   d: integer;
  216. begin
  217.    (d = (c / 5));
  218.   fflag(0);
  219.   wait(c + random(d));
  220.   while myplayer.IsAnimating do
  221.     wait(c + random(d));
  222. end;
  223.  
  224. function findObject(COL, TOL, PIXELS: Integer; HUE, SAT: Extended): Boolean;
  225. var
  226.   WhatEver: TColEx;
  227.   TPA: TPointArray;
  228.   ATPA: T2DPointArray;
  229.   I: Integer;
  230.   box: TBox;
  231.   x, y: Integer;
  232. begin
  233.   WhatEver.Create(Col, Tol, Hue, Sat);
  234.   if not WhatEver.FindAllIn(Area_MS, TPA) then
  235.     Exit(False);
  236.   ATPA := ClusterTPA(TPA, 10);
  237.   SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
  238.   if (length(ATPA) <= 0) then
  239.   begin
  240.     result := False;
  241.     exit;
  242.   end;
  243.   for I := 0 to high(ATPA) do
  244.   begin
  245.     if (length(ATPA[I]) >= PIXELS) then
  246.     begin
  247.       box := intToBox(ATPA[I].getBounds().X1, ATPA[I].getBounds().Y1, ATPA[I].getBounds().X2, ATPA[I].getBounds().Y2);
  248.       if (box.x1 < 0) then
  249.         box.x1 := 0;
  250.       if (box.y1 < 0) then
  251.         box.y1 := 0;
  252.       position := MiddleTPA(ATPA[I]);
  253.       result := True;
  254.       exit;
  255.     end;
  256.   end;
  257.   result := False;
  258. end;
  259.  
  260. function lootMark(): Boolean;
  261. var
  262.   i, id: Integer;
  263.   strArr: TStringArray;
  264.   gItems: TReflectGroundItemArray;
  265. begin
  266.   if (Course = 'Draynor') then
  267.   begin
  268.     gItems.GetAll(10);
  269.   end
  270.   else if (Course = 'Falador') then
  271.   begin
  272.     gItems.GetAll(4);
  273.   end
  274.   else if (Course = 'Seers') then
  275.   begin
  276.     gItems.GetAll(15);
  277.   end
  278.   else if (Course = 'Varrock') then
  279.   begin
  280.     gItems.GetAll(15);
  281.   end
  282.   if length(gItems) = 0 then
  283.     Exit;
  284.   setArrayLength(strArr, 1);
  285.   strArr := ['mark of grace'];
  286.   for i := 0 to high(gItems) do
  287.     if inStrArrEx(gItems[i].GetName, strArr, id) then
  288.     begin
  289.       Reflect.Compass.MakePitch(3 + Random(3));
  290.       if R_interactTile(gItems[i].GetTile, 'Take ' + gItems[i].GetName) then
  291.       begin
  292.         if (findObject(1417655, 3, 20, 0.06, 0.16)) then
  293.         begin
  294.           Draw('Found Mark');
  295.           case random(10) of
  296.             0..8:
  297.               begin
  298.                 randomMouseInput(position, 3, 3);
  299.                 if waituptext('Mark of grace', randomrange(50, 300)) then
  300.                   fastClick(mouse_left);
  301.                 waitMove(900);
  302.                 inc(markCount);
  303.                 exit(true);
  304.               end;
  305.             9..10:
  306.               begin
  307.                 randomMouseInput(position, 3, 3);
  308.                 if waituptext('Mark of grace', randomrange(50, 300)) then
  309.                   fastClick(mouse_Right);
  310.                 chooseoptionmulti(['Take', 'Mark of grace']);
  311.                 waitMove(900);
  312.                 inc(markCount);
  313.                 exit(true);
  314.               end;
  315.           end;
  316.           if (didYellowClick()) then
  317.           begin
  318.             sleep(random(150, 300));
  319.           end;
  320.         end
  321.         else
  322.           inc(markCount);
  323.       end
  324.     end
  325. end;
  326.  
  327. procedure thewallD();
  328. var
  329.   obj_Wall: TMSObject;
  330.   Pnt: TPoint;
  331.   T: Timer;
  332. begin
  333.   lootMark();
  334.   dismissAllRandoms();
  335.   if R_InteractTile(Point(3102, 3279), 'Climb Rough wall', 3, 3, 2) then
  336.   begin
  337.     if DidRedClick then
  338.     begin
  339.       draw('Climbing Rough Wall');
  340.       T.start;
  341.       repeat
  342.         wait(150);
  343.       until (reflect.Tiles.DistanceFromTile(Point(3102, 3279)) < 1) or (T.timeElapsed > 10000);
  344.     end
  345.   end
  346.   else if not R_InteractTile(Point(3102, 3279), 'Climb Rough wall', 3, 3, 3) then
  347.   begin
  348.     reflect.Compass.MakePitch(5);
  349.     setCompass(inttostr(randomrange(265, 285)));
  350.   end
  351. end;
  352.  
  353. procedure rope1D;
  354. var
  355.   T: Timer;
  356. begin
  357.   lootMark();
  358.   dismissAllRandoms();
  359.   if R_InteractTile(Point(3098, 3277), 'Cross Tightrope', 0, 0, 10) then
  360.   begin
  361.     if DidRedClick then
  362.     begin
  363.       draw('Crossing Rope 1');
  364.       wait(randomrange(500, 3000));
  365.       setCompass(inttostr(randomrange(180, 225)));
  366.       T.start;
  367.       repeat
  368.         wait(150);
  369.       until (reflect.Tiles.DistanceFromTile(Point(3090, 3276)) < 1) or (T.timeElapsed > 10000);
  370.     end
  371.   end
  372. end;
  373.  
  374. procedure rope2D;
  375. var
  376.   T: Timer;
  377. begin
  378.   lootMark();
  379.   dismissAllRandoms();
  380.   if R_InteractTile(Point(3092, 3276), 'Cross Tightrope', 0, 0, 10) then
  381.   begin
  382.     if DidRedClick then
  383.     begin
  384.       draw('Crossing Rope 2');
  385.       T.start;
  386.       repeat
  387.         wait(150);
  388.       until (reflect.Tiles.DistanceFromTile(Point(3092, 3266)) < 1) or (T.timeElapsed > 10000);
  389.     end
  390.   end
  391.   lootMark();
  392. end;
  393.  
  394. procedure nwallD;
  395. var
  396.   T: Timer;
  397. begin
  398.   lootMark();
  399.   dismissAllRandoms();
  400.   if R_InteractTile(Point(3089, 3264), 'Balance Narrow wall', 3, 3, 3) then
  401.   begin
  402.     if DidRedClick then
  403.     begin
  404.       setCompass(inttostr(randomrange(125, 150)));
  405.       wait(randomrange(500, 3000));
  406.       draw('Crossing Narrow Wall');
  407.       T.start;
  408.       repeat
  409.         wait(150);
  410.       until (reflect.Tiles.DistanceFromTile(Point(3088, 3261)) < 1) or (T.timeElapsed > 10000);
  411.     end
  412.   end
  413. end;
  414.  
  415. procedure jwallD;
  416. var
  417.   gap1: TReflectObject;
  418.   T: Timer;
  419.   pnt: tpoint;
  420. begin
  421.   lootMark();
  422.   dismissAllRandoms();
  423.   if gap1.Find(objGame, 10084, 10) then
  424.   begin
  425.     pnt := gap1.GetMSPoint;
  426.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  427.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  428.     if (waitUptextMulti(['Jump-up', 'Wall'], 250)) then
  429.     begin
  430.       fastClick(Mouse_left);
  431.       if DidRedClick then
  432.       begin
  433.         draw('Climbing up wall');
  434.         T.start;
  435.         repeat
  436.           wait(150);
  437.         until (reflect.Tiles.DistanceFromTile(Point(3088, 3255)) < 1) or (T.timeElapsed > 5000);
  438.       end
  439.     end
  440.     else if not (waitUptextMulti(['Jump-up', 'Wall'], 250)) then
  441.     begin
  442.       setCompass('random');
  443.     end;
  444.   end
  445. end;
  446.  
  447. procedure gapD;
  448. var
  449.   T: Timer;
  450. begin
  451.   lootMark();
  452.   dismissAllRandoms();
  453.   reflect.Tiles.RotateCameraToTile(Point(3095, 3255));
  454.   if R_InteractTile(Point(3095, 3255), 'Jump Gap', 3, 3, 3) then
  455.   begin
  456.     if DidRedClick then
  457.     begin
  458.       draw('Jumping Gap');
  459.       T.start;
  460.       repeat
  461.         wait(150);
  462.       until (reflect.Tiles.DistanceFromTile(Point(3096, 3256)) < 1) or (T.timeElapsed > 10000);
  463.     end
  464.   end
  465.   else if not R_InteractTile(Point(3095, 3255), 'Jump Gap', 3, 3, 3) then
  466.   begin
  467.     reflect.Compass.MakePitch(2);
  468.     setCompass(inttostr(randomrange(125, 150)));
  469.   end
  470. end;
  471.  
  472. procedure crateD;
  473. var
  474.   T: Timer;
  475. begin
  476.   lootMark();
  477.   dismissAllRandoms();
  478.   if R_InteractTile(Point(3101, 3261), 'Climb-down Crate', 3, 3, 3) then
  479.   begin
  480.     if DidRedClick then
  481.     begin
  482.       draw('Climbing Down Crate');
  483.       T.start;
  484.       repeat
  485.         wait(150);
  486.       until (reflect.Tiles.DistanceFromTile(Point(3103, 3261)) < 1) or (T.timeElapsed > 10000);
  487.     end
  488.   end
  489.   else if not R_InteractTile(Point(3102, 3261), 'Climb-down Crate', 3, 3, 3) then
  490.   begin
  491.     myplayer.blindwalkMM(Point(3101, 3261), 2);
  492.     waitMove(50);
  493.   end
  494.   setCompass(inttostr(randomrange(265, 285)));
  495.   if (getRunEnergy >= (1 + random(99))) and not isUsingRun then
  496.     toggleRunning(true);
  497.   wait(randomrange(1400, 1900));
  498.   inc(lapcount);
  499. end;
  500.  
  501. procedure walkToWallD;
  502. var
  503.   T: Timer;
  504. begin
  505.   draw('Walking to Wall');
  506.   myplayer.blindwalkMM(Point(3104, 3279), 1);
  507.   while not myplayer.ismoving do
  508.   begin
  509.     T.start;
  510.     if T.timeelapsed > 2500 then
  511.       Break;
  512.     Wait(150);
  513.   end;
  514.   breakhandler();
  515. end;
  516.  
  517. procedure theWallF;
  518. var
  519.   T: Timer;
  520. begin
  521.   lootMark();
  522.   dismissAllRandoms();
  523.   Reflect.Compass.MakePitch(4 + Random(2));
  524.   setCompass(inttostr(randomrange(350, 360)));
  525.   if R_InteractTile(Point(3036, 3342), 'Climb Rough wall', 3, 3, 3) then
  526.   begin
  527.     if DidRedClick then
  528.     begin
  529.       draw('Climbing wall');
  530.       T.start;
  531.       repeat
  532.         wait(150);
  533.       until (reflect.Tiles.DistanceFromTile(Point(3036, 3342)) < 1) or (T.timeElapsed > 10000);
  534.     end
  535.   end
  536. end;
  537.  
  538. procedure rope1F;
  539. var
  540.   T: Timer;
  541. begin
  542.   lootMark();
  543.   dismissAllRandoms();
  544.   if R_InteractTile(Point(3040, 3343), 'Cross Tightrope', 0, 0, 10) then
  545.   begin
  546.     if DidRedClick then
  547.     begin
  548.       draw('Crossing Rope 1');
  549.       T.start;
  550.       repeat
  551.         wait(150);
  552.       until (reflect.Tiles.DistanceFromTile(Point(3047, 3344)) < 1) or (T.timeElapsed > 10000);
  553.     end
  554.   end
  555.   else if not R_InteractTile(Point(3040, 3343), 'Cross Tightrope', 3, 3, 3) then
  556.   begin
  557.     reflect.Compass.Make('random');
  558.   end
  559. end;
  560.  
  561. procedure holdsF;
  562. var
  563.   T: Timer;
  564. begin
  565.   lootMark();
  566.   dismissAllRandoms();
  567.   if R_InteractTile(Point(3050, 3351), 'Cross Hand holds', 3, 8, 3) then
  568.   begin
  569.     if DidRedClick then
  570.     begin
  571.       draw('Crossing Hand Holds');
  572.       T.start;
  573.       repeat
  574.         wait(150);
  575.       until (reflect.Tiles.DistanceFromTile(Point(3050, 3357)) < 1) or (T.timeElapsed > 10000);
  576.     end
  577.   end
  578.   else if not R_InteractTile(Point(3050, 3351), 'Cross Hand holds', 3, 8, 3) then
  579.   begin
  580.     myplayer.blindwalkMM(Point(3050, 3349), 1);
  581.     waitMove(50);
  582.     reflect.Compass.Make('random');
  583.   end
  584. end;
  585.  
  586. procedure gap1F;
  587. var
  588.   T: Timer;
  589. begin
  590.   lootMark();
  591.   dismissAllRandoms();
  592.   reflect.Tiles.RotateCameraToTile(Point(3048, 3360));
  593.   if R_InteractTile(Point(3048, 3360), 'Jump Gap', 3, 5, 3) then
  594.   begin
  595.     if DidRedClick then
  596.     begin
  597.       draw('Jumping Gap 1');
  598.       T.start;
  599.       repeat
  600.         wait(150);
  601.       until (reflect.Tiles.DistanceFromTile(Point(3048, 3361)) < 1) or (T.timeElapsed > 10000);
  602.     end
  603.   end
  604. end;
  605.  
  606. procedure gap2F;
  607. var
  608.   T: Timer;
  609. begin
  610.   lootMark();
  611.   dismissAllRandoms();
  612.   setCompass(inttostr(randomrange(305, 325)));
  613.   if R_InteractTile(Point(3041, 3362), 'Jump Gap', 3, 8, 3) then
  614.   begin
  615.     if DidRedClick then
  616.     begin
  617.       draw('Jumping Gap 1');
  618.       T.start;
  619.       repeat
  620.         wait(150);
  621.       until (reflect.Tiles.DistanceFromTile(Point(3041, 3361)) < 1) or (T.timeElapsed > 10000);
  622.     end
  623.   end
  624.   else if not R_InteractTile(Point(3041, 3362), 'Cross Tightrope', 3, 3, 3) then
  625.   begin
  626.     Reflect.Compass.MakePitch(2 + Random(4));
  627.   end
  628. end;
  629.  
  630. procedure rope2F;
  631. var
  632.   T: Timer;
  633. begin
  634.   lootMark();
  635.   dismissAllRandoms();
  636.   if R_InteractTile(Point(3034, 3362), 'Cross Tightrope', 3, 3, 3) then
  637.   begin
  638.     if DidRedClick then
  639.     begin
  640.       draw('Crossing Rope 2');
  641.       T.start;
  642.       repeat
  643.         wait(150);
  644.       until (reflect.Tiles.DistanceFromTile(Point(3028, 3354)) < 1) or (T.timeElapsed > 10000);
  645.     end
  646.   end
  647. end;
  648.  
  649. procedure rope3F;
  650. var
  651.   T: Timer;
  652. begin
  653.   reflect.Compass.MakePitch(5);
  654.   reflect.Tiles.RotateCameraToTile(Point(3025, 3353));
  655.   lootMark();
  656.   dismissAllRandoms();
  657.   if R_InteractTile(Point(3025, 3353), 'Cross Tightrope', 3, 3, 3) then
  658.   begin
  659.     if DidRedClick then
  660.     begin
  661.       draw('Crossing Rope 3');
  662.       T.start;
  663.       repeat
  664.         wait(150);
  665.       until (reflect.Tiles.DistanceFromTile(Point(3020, 3353)) < 1) or (T.timeElapsed > 10000);
  666.     end
  667.   end
  668.   else if not R_InteractTile(Point(3025, 3353), 'Cross Tightrope', 3, 3, 3) then
  669.   begin
  670.     reflect.Tiles.RotateCameraToTile(Point(3025, 3353));
  671.   end
  672. end;
  673.  
  674. procedure gap3F;
  675. var
  676.   T: Timer;
  677. begin
  678.   lootMark();
  679.   dismissAllRandoms();
  680.   if R_InteractTile(Point(3017, 3353), 'Jump Gap', 3, 3, 3) then
  681.   begin
  682.     if DidRedClick then
  683.     begin
  684.       draw('Crossing Gap 3');
  685.       T.start;
  686.       repeat
  687.         wait(150);
  688.       until (reflect.Tiles.DistanceFromTile(Point(3018, 3349)) < 1) or (T.timeElapsed > 10000);
  689.     end
  690.   end
  691.   else if not R_InteractTile(Point(3017, 3353), 'Jump Gap', 3, 3, 3) then
  692.   begin
  693.     reflect.Compass.Make('random');
  694.   end
  695. end;
  696.  
  697. procedure ledge1F;
  698. var
  699.   T: Timer;
  700. begin
  701.   lootMark();
  702.   dismissAllRandoms();
  703.   if R_InteractTile(Point(3016, 3346), 'Jump Ledge', 3, 3, 3) then
  704.   begin
  705.     if DidRedClick then
  706.     begin
  707.       draw('Jumping Ledge 1');
  708.       T.start;
  709.       repeat
  710.         wait(150);
  711.       until (reflect.Tiles.DistanceFromTile(Point(3014, 3346)) < 1) or (T.timeElapsed > 10000);
  712.     end
  713.   end
  714.   else if not R_InteractTile(Point(3016, 3346), 'Jump Ledge', 3, 3, 3) then
  715.   begin
  716.     reflect.Tiles.RotateCameraToTile(Point(3016, 3346));
  717.   end
  718. end;
  719.  
  720. procedure ledge2F;
  721. var
  722.   T: Timer;
  723. begin
  724.   lootMark();
  725.   dismissAllRandoms();
  726.   if R_InteractTile(Point(3012, 3343), 'Jump Ledge', 3, 3, 3) then
  727.   begin
  728.     if DidRedClick then
  729.     begin
  730.       setCompass(inttostr(randomrange(135, 180)));
  731.       draw('Jumping Ledge 2');
  732.       T.start;
  733.       repeat
  734.         wait(150);
  735.       until (reflect.Tiles.DistanceFromTile(Point(3013, 3342)) < 1) or (T.timeElapsed > 10000);
  736.     end
  737.     Reflect.Compass.MakePitch(3 + Random(4));
  738.   end
  739. end;
  740.  
  741. procedure ledge3F;
  742. var
  743.   T: Timer;
  744. begin
  745.   lootMark();
  746.   dismissAllRandoms();
  747.   if R_InteractTile(Point(3012, 3335), 'Jump Ledge', 3, 3, 3) then
  748.   begin
  749.     if DidRedClick then
  750.     begin
  751.       draw('Jumping Ledge 3');
  752.       T.start;
  753.       repeat
  754.         wait(150);
  755.       until (reflect.Tiles.DistanceFromTile(Point(3013, 3333)) < 1) or (T.timeElapsed > 10000);
  756.     end
  757.   end
  758.   else if not R_InteractTile(Point(3012, 3335), 'Jump Ledge', 3, 3, 3) then
  759.   begin
  760.     reflect.Tiles.RotateCameraToTile(Point(3012, 3335));
  761.     lootMark();
  762.   end
  763. end;
  764.  
  765. procedure ledge4F;
  766. var
  767.   T: Timer;
  768. begin
  769.   lootMark();
  770.   dismissAllRandoms();
  771.   if R_InteractTile(Point(3018, 3333), 'Jump Ledge', 3, 3, 3) then
  772.   begin
  773.     if DidRedClick then
  774.     begin
  775.       setCompass(inttostr(randomrange(350, 360)));
  776.       draw('Jumping Ledge 4');
  777.       T.start;
  778.       repeat
  779.         wait(150);
  780.       until (reflect.Tiles.DistanceFromTile(Point(3019, 3333)) < 1) or (T.timeElapsed > 10000);
  781.     end
  782.   end
  783.   else if not R_InteractTile(Point(3018, 3333), 'Jump Ledge', 3, 3, 3) then
  784.   begin
  785.     reflect.Compass.Make('random');
  786.     lootMark();
  787.   end
  788. end;
  789.  
  790. procedure edge1F;
  791. var
  792.   T: Timer;
  793. begin
  794.   lootMark();
  795.   dismissAllRandoms();
  796.   if R_InteractTile(Point(3023, 3334), 'Jump Edge', 3, 3, 3) then
  797.   begin
  798.     if DidRedClick then
  799.     begin
  800.       reflect.Tiles.RotateCameraToTile(Point(3018, 3333));
  801.       draw('Jumping Off Edge 1');
  802.       T.start;
  803.       repeat
  804.         wait(150);
  805.       until (reflect.Tiles.DistanceFromTile(Point(3027, 3333)) < 1) or (T.timeElapsed > 10000);
  806.     end
  807.   end
  808.   else if not R_InteractTile(Point(3023, 3334), 'Jump Edge', 3, 3, 3) then
  809.   begin
  810.     reflect.Tiles.RotateCameraToTile(Point(3023, 3334));
  811.   end
  812.   wait(randomrange(1400, 1900));
  813.   if (getRunEnergy >= (1 + random(99))) and not isUsingRun then
  814.     toggleRunning(true);
  815.   inc(lapcount);
  816. end;
  817.  
  818. procedure walkToWallF;
  819. var
  820.   T: Timer;
  821. begin
  822.   draw('Walking to Wall');
  823.   myplayer.blindwalkMM(Point(3036, 3340));
  824.   while not myplayer.ismoving do
  825.   begin
  826.     T.start;
  827.     if T.timeelapsed > 2500 then
  828.       Break;
  829.     Wait(150);
  830.   end;
  831.   breakhandler();
  832. end;
  833.  
  834. procedure theWallS;
  835. var
  836.   T: Timer;
  837. begin
  838.   lootMark();
  839.   dismissAllRandoms();
  840.   Reflect.Compass.MakePitch(4 + Random(2));
  841.   setCompass(inttostr(randomrange(350, 360)));
  842.   if R_InteractTile(Point(2729, 3489), 'Climb-up Wall', 3, 3, 3) then
  843.   begin
  844.     if DidRedClick then
  845.     begin
  846.       draw('Climbing wall');
  847.       T.start;
  848.       repeat
  849.         wait(150);
  850.       until (reflect.Tiles.DistanceFromTile(Point(2729, 3491)) < 1) or (T.timeElapsed > 10000);
  851.     end
  852.   end
  853.   else if not R_InteractTile(Point(2729, 3489), 'Climb-up Wall', 3, 3, 3) then
  854.   begin
  855.     Reflect.Compass.MakePitch(4 + Random(2));
  856.     reflect.Tiles.RotateCameraToTile(Point(2729, 3489));
  857.   end
  858. end;
  859.  
  860. procedure walkToWallS;
  861. var
  862.   T: Timer;
  863. begin
  864.   draw('Walking to Wall');
  865.   if MyPlayer.GetHealth < EATAT then
  866.     eatFood;
  867.   myplayer.blindwalkMM(Point(2729, 3488));
  868.   while not myplayer.ismoving do
  869.   begin
  870.     T.start;
  871.     if T.timeelapsed > 2500 then
  872.       Break;
  873.     Wait(150);
  874.   end;
  875.   breakhandler();
  876. end;
  877.  
  878. procedure gap1S;
  879. var
  880.   gap1: TReflectObject;
  881.   T: Timer;
  882.   pnt: tpoint;
  883. begin
  884.   lootMark();
  885.   dismissAllRandoms();
  886.   setCompass(inttostr(randomrange(310, 340)));
  887.   Reflect.Compass.MakePitch(2 + Random(1));
  888.   if gap1.Find(objGame, 11374, 20) then
  889.   begin
  890.     pnt := gap1.GetMSPoint;
  891.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  892.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  893.     if (waitUptextMulti(['Jump', 'Gap'], 250)) then
  894.     begin
  895.       fastClick(Mouse_left);
  896.       if DidRedClick then
  897.       begin
  898.         draw('Jumping Gap 1');
  899.         wait(randomrange(500, 4000));
  900.         setCompass(inttostr(randomrange(210, 230)));
  901.         T.start;
  902.         repeat
  903.           wait(150);
  904.         until (reflect.Tiles.DistanceFromTile(Point(2713, 3494)) < 1) or (T.timeElapsed > 5000);
  905.       end
  906.     end
  907.   end
  908.   else if not (waitUptextMulti(['Jump', 'Gap'], 250)) then
  909.   begin
  910.   end;
  911. end;
  912.  
  913. procedure rope1S;
  914. var
  915.   T: Timer;
  916. begin
  917.   lootMark();
  918.   dismissAllRandoms();
  919.   if R_InteractTile(Point(2710, 3489), 'Cross Tightrope', 3, 3, 3) then
  920.   begin
  921.     if DidRedClick then
  922.     begin
  923.       draw('Crossing Rope 1');
  924.       T.start;
  925.       repeat
  926.         wait(150);
  927.       until (reflect.Tiles.DistanceFromTile(Point(2710, 3480)) < 1) or (T.timeElapsed > 5000);
  928.     end
  929.   end
  930.   else if not R_InteractTile(Point(2710, 3489), 'Cross Tightrope', 3, 3, 3) then
  931.   begin
  932.     reflect.Tiles.RotateCameraToTile(Point(2710, 3489));
  933.   end
  934. end;
  935.  
  936. procedure gap2S;
  937. var
  938.   gap1: TReflectObject;
  939.   T: Timer;
  940.   pnt: tpoint;
  941. begin
  942.   lootMark();
  943.   dismissAllRandoms();
  944.   if gap1.Find(objGame, 11375, 20) then
  945.   begin
  946.     pnt := gap1.GetMSPoint;
  947.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  948.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  949.     if (waitUptextMulti(['Jump', 'Gap'], 250)) then
  950.     begin
  951.       fastClick(Mouse_left);
  952.       if DidRedClick then
  953.       begin
  954.         draw('Jumping Gap 2');
  955.         T.start;
  956.         repeat
  957.           wait(150);
  958.         until (reflect.tiles.getplane = 3) or (T.timeElapsed > 5000);
  959.       end
  960.     end
  961.     else if not (waitUptextMulti(['Jump', 'Gap'], 250)) then
  962.     begin
  963.       setCompass(inttostr(randomrange(210, 230)));
  964.       Reflect.Compass.MakePitch(1 + Random(2));
  965.     end
  966.   end
  967. end
  968.  
  969. procedure gap3S;
  970. var
  971.   gap1: TReflectObject;
  972.   T: Timer;
  973.   pnt: tpoint;
  974. begin
  975.   lootMark();
  976.   dismissAllRandoms();
  977.   setCompass(inttostr(randomrange(210, 230)));
  978.   if gap1.Find(objGame, 11376, 20) then
  979.   begin
  980.     pnt := gap1.GetMSPoint;
  981.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  982.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  983.     if (waitUptextMulti(['Jump', 'Gap'], 250)) then
  984.     begin
  985.       fastClick(Mouse_left);
  986.       if DidRedClick then
  987.       begin
  988.         draw('Jumping Gap 3');
  989.         T.start;
  990.         repeat
  991.           wait(150);
  992.         until (reflect.tiles.getplane = 2) or (T.timeElapsed > 5000);
  993.       end
  994.     end
  995.     else if not (waitUptextMulti(['Jump', 'Gap'], 250)) then
  996.     begin
  997.       setCompass(inttostr(randomrange(210, 230)));
  998.       Reflect.Compass.MakePitch(1 + Random(2));
  999.     end
  1000.   end
  1001. end
  1002.  
  1003. procedure edgeS;
  1004. var
  1005.   edge: TReflectObject;
  1006.   T: Timer;
  1007.   pnt: tpoint;
  1008. begin
  1009.   lootMark();
  1010.   dismissAllRandoms();
  1011.   if edge.Find(objGame, 11377, 20) then
  1012.   begin
  1013.     pnt := edge.GetMSPoint;
  1014.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1015.       Reflect.Mouse.Move(edge.GetMSPoint, 3, 3);
  1016.     if (waitUptextMulti(['Jump', 'Edge'], 250)) then
  1017.     begin
  1018.       fastClick(Mouse_left);
  1019.       begin
  1020.         if DidRedClick then
  1021.         begin
  1022.           draw('Jumping Off Edge');
  1023.           case random(10) of
  1024.             0..7: setCompass(inttostr(randomrange(340, 360)));
  1025.             8..10: setCompass(inttostr(randomrange(1, 30)));
  1026.           end
  1027.           T.start;
  1028.           repeat
  1029.             wait(150);
  1030.           until (reflect.tiles.getplane = 0) or (T.timeElapsed > 10000);
  1031.         end
  1032.       end
  1033.     end
  1034.     else if not (waitUptextMulti(['Jump', 'Edge'], 250)) then
  1035.     begin
  1036.       setCompass(inttostr(randomrange(135, 160)));
  1037.       Reflect.Compass.MakePitch(3 + Random(2));
  1038.     end;
  1039.     wait(randomrange(1400, 1900));
  1040.     if (getRunEnergy >= (1 + random(99))) and not isUsingRun then
  1041.       toggleRunning(true);
  1042.     inc(lapcount);
  1043.   end
  1044. end
  1045.  
  1046. procedure thewallV();
  1047. var
  1048.   obj_Wall: TMSObject;
  1049.   Pnt: TPoint;
  1050.   T: Timer;
  1051. begin
  1052.   lootMark();
  1053.   dismissAllRandoms();
  1054.  // Reflect.Compass.MakePitch(2 + Random(2));
  1055.   if R_InteractTile(Point(3220, 3414), 'Climb Rough wall', 3, 3, 2) then
  1056.   begin
  1057.     if DidRedClick then
  1058.     begin
  1059.       draw('Climbing Rough Wall');
  1060.       T.start;
  1061.       repeat
  1062.         wait(150);
  1063.       until (reflect.Tiles.DistanceFromTile(Point(3219, 3414)) < 1) or (T.timeElapsed > 5000);
  1064.     end
  1065.   end
  1066.   else if not R_InteractTile(Point(3220, 3414), 'Climb Rough wall', 3, 3, 3) then
  1067.   begin
  1068.     Reflect.Compass.MakePitch(5 + Random(2));
  1069.     setCompass(inttostr(randomrange(260, 290)));
  1070.   end
  1071. end;
  1072.  
  1073. procedure clotheslineV;
  1074. var
  1075.   gap1: TReflectObject;
  1076.   T: Timer;
  1077.   pnt: tpoint;
  1078. begin
  1079.   lootMark();
  1080.   dismissAllRandoms();
  1081.   if gap1.Find(objGame, 10587, 20) then
  1082.   begin
  1083.     pnt := gap1.GetMSPoint;
  1084.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1085.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1086.     if (waitUptextMulti(['Cross', 'Clothes line'], 250)) then
  1087.     begin
  1088.       fastClick(Mouse_left);
  1089.       if DidRedClick then
  1090.       begin
  1091.         draw('Jumping Gap 3');
  1092.         wait(randomrange(500, 1700));
  1093.         Reflect.Compass.MakePitch(1 + Random(3));
  1094.         T.start;
  1095.         repeat
  1096.           wait(150);
  1097.         until (reflect.Tiles.DistanceFromTile(Point(3208, 3414)) < 1) or (T.timeElapsed > 5000);
  1098.       end
  1099.     end
  1100.     else if not (waitUptextMulti(['Cross', 'Clothes line'], 250)) then
  1101.     begin
  1102.       setCompass(inttostr(randomrange(250, 290)));
  1103.       Reflect.Compass.MakePitch(4 + Random(2));
  1104.     end
  1105.   end
  1106. end
  1107.  
  1108. procedure gap1V;
  1109. var
  1110.   gap1: TReflectObject;
  1111.   T: Timer;
  1112.   pnt: tpoint;
  1113. begin
  1114.   lootMark();
  1115.   dismissAllRandoms();
  1116.   if gap1.Find(objGame, 10642, 20) then
  1117.   begin
  1118.     pnt := gap1.GetMSPoint;
  1119.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1120.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1121.     if (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1122.     begin
  1123.       fastClick(Mouse_left);
  1124.       if DidRedClick then
  1125.       begin
  1126.         draw('Jumping Gap 1');
  1127.         T.start;
  1128.         repeat
  1129.           wait(150);
  1130.         until (reflect.Tiles.DistanceFromTile(Point(3197, 3416)) < 1) or (T.timeElapsed > 5000);
  1131.       end
  1132.     end
  1133.     else if not (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1134.     begin
  1135.       setCompass(inttostr(randomrange(250, 290)));
  1136.       Reflect.Compass.MakePitch(4 + Random(2));
  1137.     end
  1138.   end
  1139. end
  1140.  
  1141. procedure wall1V;
  1142. var
  1143.   gap1: TReflectObject;
  1144.   T: Timer;
  1145.   pnt: tpoint;
  1146. begin
  1147.   lootMark();
  1148.   dismissAllRandoms();
  1149.   if gap1.Find(objGame, 10777, 20) then
  1150.   begin
  1151.     pnt := gap1.GetMSPoint;
  1152.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1153.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1154.     if (waitUptextMulti(['Balance', 'Wall'], 250)) then
  1155.     begin
  1156.       fastClick(Mouse_left);
  1157.       if DidRedClick then
  1158.       begin
  1159.         draw('Balancing on wall');
  1160.         wait(randomrange(500, 3000));
  1161.         setCompass(inttostr(randomrange(95, 230)));
  1162.         T.start;
  1163.         repeat
  1164.           wait(150);
  1165.         until (reflect.Tiles.DistanceFromTile(Point(3197, 3416)) < 1) or (T.timeElapsed > 5000);
  1166.       end
  1167.     end
  1168.     else if not (waitUptextMulti(['Balance', 'Wall'], 250)) then
  1169.     begin
  1170.       setCompass(inttostr(randomrange(250, 290)));
  1171.       Reflect.Compass.MakePitch(4 + Random(2));
  1172.     end
  1173.   end
  1174. end
  1175.  
  1176. function At5V: boolean;
  1177. var
  1178.   CorrectBox := inttobox (3182, 3382, 3208, 3403);
  1179.   MyCurrentTile: tpoint;
  1180. begin
  1181.   MyCurrentTile := treflectiontiles.getglobaltile();
  1182.   result := pointinbox(MyCurrentTile, CorrectBox);
  1183. end;
  1184.  
  1185. procedure gap2V;
  1186. var
  1187.   gap1: TReflectObject;
  1188.   T: Timer;
  1189.   pnt: tpoint;
  1190. begin
  1191.   lootMark();
  1192.   dismissAllRandoms();
  1193.   if gap1.Find(objGame, 10778, 20) then
  1194.   begin
  1195.     pnt := gap1.GetMSPoint;
  1196.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1197.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1198.     if (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1199.     begin
  1200.       fastClick(Mouse_left);
  1201.       if DidRedClick then
  1202.       begin
  1203.         draw('Jumping gap 2');
  1204.         wait(randomrange(500, 3000));
  1205.         setCompass(inttostr(randomrange(60, 130)));
  1206.         Reflect.Compass.MakePitch(1);
  1207.         T.start;
  1208.         repeat
  1209.           wait(150);
  1210.         until (At5V) or (T.timeElapsed > 5000);
  1211.       end
  1212.     end
  1213.     else if not (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1214.     begin
  1215.       setCompass(inttostr(randomrange(95, 230)));
  1216.       Reflect.Compass.MakePitch(4 + Random(2));
  1217.     end
  1218.   end
  1219. end
  1220.  
  1221. function At6V: boolean;
  1222. var
  1223.   CorrectBox := inttobox (3218, 3393, 3232, 3403);
  1224.   MyCurrentTile: tpoint;
  1225. begin
  1226.   MyCurrentTile := treflectiontiles.getglobaltile();
  1227.   result := pointinbox(MyCurrentTile, CorrectBox);
  1228. end;
  1229.  
  1230. procedure gap3V;
  1231. var
  1232.   gap1: TReflectObject;
  1233.   T: Timer;
  1234.   pnt: tpoint;
  1235. begin
  1236.   lootMark();
  1237.   dismissAllRandoms();
  1238.   if gap1.Find(objGame, 10779, 50) then
  1239.   begin
  1240.     pnt := gap1.GetMSPoint;
  1241.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1242.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1243.     if (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1244.     begin
  1245.       fastClick(Mouse_left);
  1246.       if DidRedClick then
  1247.       begin
  1248.         draw('Jumping gap 3');
  1249.         T.start;
  1250.         repeat
  1251.           wait(150);
  1252.         until (At6V) or (T.timeElapsed > 5000);
  1253.       end
  1254.     end
  1255.     else if not (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1256.     begin
  1257.       draw('Walking to gap');
  1258.       myplayer.blindwalkMM(Point(3208, 3399), 3);
  1259.       setCompass(inttostr(randomrange(60, 130)));
  1260.       Reflect.Compass.MakePitch(3 + Random(3));
  1261.     end
  1262.   end
  1263. end
  1264.  
  1265. function At7V: boolean;
  1266. var
  1267.   CorrectBox := inttobox (3236, 3403, 3240, 3408);
  1268.   MyCurrentTile: tpoint;
  1269. begin
  1270.   MyCurrentTile := treflectiontiles.getglobaltile();
  1271.   result := pointinbox(MyCurrentTile, CorrectBox);
  1272. end;
  1273.  
  1274. procedure gap4V;
  1275. var
  1276.   gap1: TReflectObject;
  1277.   T: Timer;
  1278.   pnt: tpoint;
  1279. begin
  1280.   lootMark();
  1281.   dismissAllRandoms();
  1282.   myplayer.blindwalkMM(Point(3230, 3402), 3);
  1283.   if gap1.Find(objGame, 10780, 20) then
  1284.   begin
  1285.     pnt := gap1.GetMSPoint;
  1286.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1287.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1288.     if (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1289.     begin
  1290.       fastClick(Mouse_left);
  1291.       if DidRedClick then
  1292.       begin
  1293.         draw('Leaping gap');
  1294.         Reflect.Compass.MakePitch(2 + Random(2));
  1295.         T.start;
  1296.         repeat
  1297.           wait(150);
  1298.         until (At7V) or (T.timeElapsed > 5000);
  1299.       end
  1300.     end
  1301.     else if not (waitUptextMulti(['Leap', 'Gap'], 250)) then
  1302.     begin
  1303.       draw('Walking to gap');
  1304.       setCompass(inttostr(randomrange(80, 110)));
  1305.       Reflect.Compass.MakePitch(2 + Random(4));
  1306.     end
  1307.   end
  1308. end
  1309.  
  1310. function At8V: boolean;
  1311. var
  1312.   CorrectBox := inttobox (3236, 3410, 3240, 3415);
  1313.   MyCurrentTile: tpoint;
  1314. begin
  1315.   MyCurrentTile := treflectiontiles.getglobaltile();
  1316.   result := pointinbox(MyCurrentTile, CorrectBox);
  1317. end;
  1318.  
  1319. procedure ledgeV;
  1320. var
  1321.   gap1: TReflectObject;
  1322.   T: Timer;
  1323.   pnt: tpoint;
  1324. begin
  1325.   lootMark();
  1326.   dismissAllRandoms();
  1327.   if gap1.Find(objGame, 10781, 20) then
  1328.   begin
  1329.     pnt := gap1.GetMSPoint;
  1330.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1331.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1332.     if (waitUptextMulti(['Hurdle', 'Ledge'], 250)) then
  1333.     begin
  1334.       fastClick(Mouse_left);
  1335.       if DidRedClick then
  1336.       begin
  1337.         draw('Climbing up');
  1338.         wait(randomrange(500, 3000));
  1339.         Reflect.Compass.MakePitch(6 + Random(2));
  1340.         setCompass(inttostr(randomrange(280, 350)));
  1341.         T.start;
  1342.         repeat
  1343.           wait(150);
  1344.         until (At8V) or (T.timeElapsed > 5000);
  1345.       end
  1346.     end
  1347.     else if not (waitUptextMulti(['Hurdle', 'Ledge'], 250)) then
  1348.     begin
  1349.       setCompass(inttostr(randomrange(315, 359)));
  1350.       Reflect.Compass.MakePitch(5 + Random(2));
  1351.     end
  1352.   end
  1353.   if (getRunEnergy >= (1 + random(99))) and not isUsingRun then
  1354.     toggleRunning(true);
  1355.   wait(randomrange(1400, 1900));
  1356.   inc(lapcount);
  1357. end
  1358.  
  1359. procedure edgeV;
  1360. var
  1361.   gap1: TReflectObject;
  1362.   T: Timer;
  1363.   pnt: tpoint;
  1364. begin
  1365.   lootMark();
  1366.   dismissAllRandoms();
  1367.   if gap1.Find(objGame, 10817, 20) then
  1368.   begin
  1369.     pnt := gap1.GetMSPoint;
  1370.     if (pnt.x > 0) and (pnt.y > 0) and (pnt.x < cW) and (pnt.y < cH) then
  1371.       Reflect.Mouse.Move(gap1.GetMSPoint, 3, 3);
  1372.     if (waitUptextMulti(['Jump-off', 'Edge'], 250)) then
  1373.     begin
  1374.       fastClick(Mouse_left);
  1375.       if DidRedClick then
  1376.       begin
  1377.         draw('Climbing down');
  1378.         T.start;
  1379.         repeat
  1380.           wait(150);
  1381.         until (reflect.Tiles.getplane = 0) or (T.timeElapsed > 5000);
  1382.       end
  1383.     end
  1384.     else if not (waitUptextMulti(['Jump-off', 'Edge'], 250)) then
  1385.     begin
  1386.       setCompass(inttostr(randomrange(280, 350)));
  1387.       Reflect.Compass.MakePitch(6 + Random(2));
  1388.     end
  1389.   end
  1390. end
  1391.  
  1392. procedure walkToWallV;
  1393. var
  1394.   T: Timer;
  1395. begin
  1396.   draw('Walking to Wall');
  1397.   if MyPlayer.GetHealth < EATAT then
  1398.     eatFood;
  1399.   myplayer.blindwalkMM(Point(3222, 3414), 1);
  1400.   while not myplayer.ismoving do
  1401.   begin
  1402.     T.start;
  1403.     if T.timeelapsed > 2500 then
  1404.       Break;
  1405.     Wait(150);
  1406.   end;
  1407.   breakhandler();
  1408. end;
  1409.  
  1410. function At1V: boolean;
  1411. var
  1412.   CorrectBox := inttobox (3214, 3410, 3219, 3419);
  1413.   MyCurrentTile: tpoint;
  1414. begin
  1415.   MyCurrentTile := treflectiontiles.getglobaltile();
  1416.   result := pointinbox(MyCurrentTile, CorrectBox);
  1417. end;
  1418.  
  1419. function At2V: boolean;
  1420. var
  1421.   CorrectBox := inttobox (3201, 3413, 3208, 3417);
  1422.   MyCurrentTile: tpoint;
  1423. begin
  1424.   MyCurrentTile := treflectiontiles.getglobaltile();
  1425.   result := pointinbox(MyCurrentTile, CorrectBox);
  1426. end;
  1427.  
  1428. function At3V: boolean;
  1429. var
  1430.   CorrectBox := inttobox (3194, 3416, 3197, 3416);
  1431.   MyCurrentTile: tpoint;
  1432. begin
  1433.   MyCurrentTile := treflectiontiles.getglobaltile();
  1434.   result := pointinbox(MyCurrentTile, CorrectBox);
  1435. end;
  1436.  
  1437. function At4V: boolean;
  1438. var
  1439.   CorrectBox := inttobox (3192, 3402, 3198, 3406);
  1440.   MyCurrentTile: tpoint;
  1441. begin
  1442.   MyCurrentTile := treflectiontiles.getglobaltile();
  1443.   result := pointinbox(MyCurrentTile, CorrectBox);
  1444. end;
  1445.  
  1446. function At1D: boolean;
  1447. var
  1448.   CorrectBox := inttobox (3097, 3277, 3102, 3281);
  1449.   MyCurrentTile: tpoint;
  1450. begin
  1451.   MyCurrentTile := treflectiontiles.getglobaltile();
  1452.   result := pointinbox(MyCurrentTile, CorrectBox);
  1453. end;
  1454.  
  1455. function At2D: boolean;
  1456. var
  1457.   CorrectBox := inttobox (3088, 3273, 3091, 3276);
  1458.   MyCurrentTile: tpoint;
  1459. begin
  1460.   MyCurrentTile := treflectiontiles.getglobaltile();
  1461.   result := pointinbox(MyCurrentTile, CorrectBox);
  1462. end;
  1463.  
  1464. function At3D: boolean;
  1465. var
  1466.   CorrectBox := inttobox (3089, 3265, 3094, 3267);
  1467.   MyCurrentTile: tpoint;
  1468. begin
  1469.   MyCurrentTile := treflectiontiles.getglobaltile();
  1470.   result := pointinbox(MyCurrentTile, CorrectBox);
  1471. end;
  1472.  
  1473. function At4D: boolean;
  1474. var
  1475.   CorrectBox := inttobox (3088, 3257, 3088, 3261);
  1476.   MyCurrentTile: tpoint;
  1477. begin
  1478.   MyCurrentTile := treflectiontiles.getglobaltile();
  1479.   result := pointinbox(MyCurrentTile, CorrectBox);
  1480. end;
  1481.  
  1482. function At5D: boolean;
  1483. var
  1484.   CorrectBox := inttobox (3087, 3254, 3094, 3255);
  1485.   MyCurrentTile: tpoint;
  1486. begin
  1487.   MyCurrentTile := treflectiontiles.getglobaltile();
  1488.   result := pointinbox(MyCurrentTile, CorrectBox);
  1489. end;
  1490.  
  1491. function At6D: boolean;
  1492. var
  1493.   CorrectBox := inttobox (3096, 3256, 3101, 3261);
  1494.   MyCurrentTile: tpoint;
  1495. begin
  1496.   MyCurrentTile := treflectiontiles.getglobaltile();
  1497.   result := pointinbox(MyCurrentTile, CorrectBox);
  1498. end;
  1499.  
  1500. function At1F: boolean;
  1501. var
  1502.   CorrectBox := inttobox (3036, 3342, 3040, 3343);
  1503.   MyCurrentTile: tpoint;
  1504. begin
  1505.   MyCurrentTile := treflectiontiles.getglobaltile();
  1506.   result := pointinbox(MyCurrentTile, CorrectBox);
  1507. end;
  1508.  
  1509. function At2F: boolean;
  1510. var
  1511.   CorrectBox := inttobox (3045, 3341, 3051, 3349);
  1512.   MyCurrentTile: tpoint;
  1513. begin
  1514.   MyCurrentTile := treflectiontiles.getglobaltile();
  1515.   result := pointinbox(MyCurrentTile, CorrectBox);
  1516. end;
  1517.  
  1518. function At3F: boolean;
  1519. var
  1520.   CorrectBox := inttobox (3048, 3357, 3050, 3358);
  1521.   MyCurrentTile: tpoint;
  1522. begin
  1523.   MyCurrentTile := treflectiontiles.getglobaltile();
  1524.   result := pointinbox(MyCurrentTile, CorrectBox);
  1525. end;
  1526.  
  1527. function At4F: boolean;
  1528. var
  1529.   CorrectBox := inttobox (3045, 3361, 3048, 3367);
  1530.   MyCurrentTile: tpoint;
  1531. begin
  1532.   MyCurrentTile := treflectiontiles.getglobaltile();
  1533.   result := pointinbox(MyCurrentTile, CorrectBox);
  1534. end;
  1535.  
  1536. function At5F: boolean;
  1537. var
  1538.   CorrectBox := inttobox (3034, 3361, 3041, 3364);
  1539.   MyCurrentTile: tpoint;
  1540. begin
  1541.   MyCurrentTile := treflectiontiles.getglobaltile();
  1542.   result := pointinbox(MyCurrentTile, CorrectBox);
  1543. end;
  1544.  
  1545. function At6F: boolean;
  1546. var
  1547.   CorrectBox := inttobox (3026, 3352, 3029, 3355);
  1548.   MyCurrentTile: tpoint;
  1549. begin
  1550.   MyCurrentTile := treflectiontiles.getglobaltile();
  1551.   result := pointinbox(MyCurrentTile, CorrectBox);
  1552. end;
  1553.  
  1554. function At7F: boolean;
  1555. var
  1556.   CorrectBox := inttobox (3009, 3353, 3021, 3358);
  1557.   MyCurrentTile: tpoint;
  1558. begin
  1559.   MyCurrentTile := treflectiontiles.getglobaltile();
  1560.   result := pointinbox(MyCurrentTile, CorrectBox);
  1561. end;
  1562.  
  1563. function At8F: boolean;
  1564. var
  1565.   CorrectBox := inttobox (3016, 3343, 3022, 3349);
  1566.   MyCurrentTile: tpoint;
  1567. begin
  1568.   MyCurrentTile := treflectiontiles.getglobaltile();
  1569.   result := pointinbox(MyCurrentTile, CorrectBox);
  1570. end;
  1571.  
  1572. function At9F: boolean;
  1573. var
  1574.   CorrectBox := inttobox (3011, 3344, 3014, 3346);
  1575.   MyCurrentTile: tpoint;
  1576. begin
  1577.   MyCurrentTile := treflectiontiles.getglobaltile();
  1578.   result := pointinbox(MyCurrentTile, CorrectBox);
  1579. end;
  1580.  
  1581. function At10F: boolean;
  1582. var
  1583.   CorrectBox := inttobox (3009, 3335, 3013, 3342);
  1584.   MyCurrentTile: tpoint;
  1585. begin
  1586.   MyCurrentTile := treflectiontiles.getglobaltile();
  1587.   result := pointinbox(MyCurrentTile, CorrectBox);
  1588. end;
  1589.  
  1590. function At11F: boolean;
  1591. var
  1592.   CorrectBox := inttobox (3012, 3331, 3017, 3334);
  1593.   MyCurrentTile: tpoint;
  1594. begin
  1595.   MyCurrentTile := treflectiontiles.getglobaltile();
  1596.   result := pointinbox(MyCurrentTile, CorrectBox);
  1597. end;
  1598.  
  1599. function At12F: boolean;
  1600. var
  1601.   CorrectBox := inttobox (3019, 3332, 3024, 3335);
  1602.   MyCurrentTile: tpoint;
  1603. begin
  1604.   MyCurrentTile := treflectiontiles.getglobaltile();
  1605.   result := pointinbox(MyCurrentTile, CorrectBox);
  1606. end;
  1607.  
  1608. function At1S: boolean;
  1609. var
  1610.   CorrectBox := inttobox (2721, 2730, 3490, 3497);
  1611.   MyCurrentTile: tpoint;
  1612. begin
  1613.   MyCurrentTile := treflectiontiles.getglobaltile();
  1614.   result := pointinbox(MyCurrentTile, CorrectBox);
  1615. end;
  1616.  
  1617. function At2S: boolean;
  1618. var
  1619.   CorrectBox := inttobox (2705, 3488, 2713, 3495);
  1620.   MyCurrentTile: tpoint;
  1621. begin
  1622.   MyCurrentTile := treflectiontiles.getglobaltile();
  1623.   result := pointinbox(MyCurrentTile, CorrectBox);
  1624. end;
  1625.  
  1626. function At3S: boolean;
  1627. var
  1628.   CorrectBox := inttobox (2710, 3477, 2715, 3481);
  1629.   MyCurrentTile: tpoint;
  1630. begin
  1631.   MyCurrentTile := treflectiontiles.getglobaltile();
  1632.   result := pointinbox(MyCurrentTile, CorrectBox);
  1633. end;
  1634.  
  1635. function At4S: boolean;
  1636. var
  1637.   CorrectBox := inttobox (2700, 3470, 2715, 3475);
  1638.   MyCurrentTile: tpoint;
  1639. begin
  1640.   MyCurrentTile := treflectiontiles.getglobaltile();
  1641.   result := pointinbox(MyCurrentTile, CorrectBox);
  1642. end;
  1643.  
  1644. function At5S: boolean;
  1645. var
  1646.   CorrectBox := inttobox (2698, 3460, 2702, 3465);
  1647.   MyCurrentTile: tpoint;
  1648. begin
  1649.   MyCurrentTile := treflectiontiles.getglobaltile();
  1650.   result := pointinbox(MyCurrentTile, CorrectBox);
  1651. end;
  1652.  
  1653. function At6S: boolean;
  1654. var
  1655.   CorrectBox := inttobox (3019, 3332, 3024, 3335);
  1656.   MyCurrentTile: tpoint;
  1657. begin
  1658.   MyCurrentTile := treflectiontiles.getglobaltile();
  1659.   result := pointinbox(MyCurrentTile, CorrectBox);
  1660. end;
  1661.  
  1662. function getStateV(): Integer;
  1663. begin
  1664.   if not isLoggedIn() then
  1665.     exit(1);
  1666.   if lootMark() then
  1667.     exit(2);
  1668.   if (reflect.Tiles.NearTile(Point(3221, 3414), 5)) and (reflect.Tiles.getplane = 0) then
  1669.     exit(3);
  1670.   if At1V then
  1671.     exit(4);
  1672.   if At2V then
  1673.     exit(5);
  1674.   if At3V then
  1675.     exit(6);
  1676.   if At4V then
  1677.     exit(7);
  1678.   if At5V then
  1679.     exit(8);
  1680.   if At6V then
  1681.     exit(9);
  1682.   if At7V then
  1683.     exit(10);
  1684.   if At8V then
  1685.     exit(11);
  1686.   if reflect.Tiles.getplane = 0 then
  1687.     exit(12);
  1688. end;
  1689.  
  1690. procedure executeStateV(State: Integer);
  1691. begin
  1692.   case (State) of
  1693.     1: HandleLogin();
  1694.     2: lootMark();
  1695.     3: theWallV();
  1696.     4: clotheslineV();
  1697.     5: gap1V();
  1698.     6: wall1V();
  1699.     7: gap2V();
  1700.     8: gap3V();
  1701.     9: gap4V();
  1702.     10: ledgeV();
  1703.     11: edgeV();
  1704.     12: walkToWallV();
  1705.   end;
  1706.   wait(randomrange(75, 175));
  1707. end;
  1708.  
  1709. function getStateS(): Integer;
  1710. begin
  1711.   if not isLoggedIn() then
  1712.     exit(1);
  1713.   if lootMark() then
  1714.     exit(2);
  1715.   if (reflect.Tiles.NearTile(Point(2729, 3488), 10)) and (reflect.Tiles.getplane = 0) then
  1716.     exit(3);
  1717.   if At1S then
  1718.     exit(4);
  1719.   if At2S then
  1720.     exit(5);
  1721.   if At3S then
  1722.     exit(6);
  1723.   if At4S then
  1724.     exit(7);
  1725.   if At5S then
  1726.     exit(8);
  1727.   if reflect.Tiles.getplane = 0 then
  1728.     exit(9);
  1729. end;
  1730.  
  1731. procedure executeStateS(State: Integer);
  1732. begin
  1733.   case (State) of
  1734.     1: HandleLogin();
  1735.     2: lootMark();
  1736.     3: theWallS();
  1737.     4: gap1S();
  1738.     5: rope1S();
  1739.     6: gap2S();
  1740.     7: gap3S();
  1741.     8: edgeS();
  1742.     9: walkToWallS();
  1743.   end;
  1744.   wait(randomrange(75, 175));
  1745. end;
  1746.  
  1747. function getStateF(): Integer;
  1748. begin
  1749.   if not isLoggedIn() then
  1750.     exit(1);
  1751.   if lootMark() then
  1752.     exit(2);
  1753.   if (reflect.Tiles.NearTile(Point(3036, 3341), 3)) and (reflect.Tiles.getplane = 0) then
  1754.     exit(3);
  1755.   if At1F then
  1756.     exit(4);
  1757.   if At2F then
  1758.     exit(5);
  1759.   if At3F then
  1760.     exit(6);
  1761.   if At4F then
  1762.     exit(7);
  1763.   if At5F then
  1764.     exit(8);
  1765.   if At6F then
  1766.     exit(9);
  1767.   if At7F then
  1768.     exit(10);
  1769.   if At8F then
  1770.     exit(11);
  1771.   if At9F then
  1772.     exit(12);
  1773.   if At10F then
  1774.     exit(13);
  1775.   if At11F then
  1776.     exit(14);
  1777.   if At12F then
  1778.     exit(15);
  1779.   if reflect.Tiles.getplane = 0 then
  1780.     exit(16);
  1781. end;
  1782.  
  1783. procedure executeStateF(State: Integer);
  1784. begin
  1785.   case (State) of
  1786.     1: HandleLogin();
  1787.     2: lootMark();
  1788.     3: thewallF();
  1789.     4: rope1F();
  1790.     5: holdsF();
  1791.     6: gap1F();
  1792.     7: gap2F();
  1793.     8: rope2F();
  1794.     9: rope3F();
  1795.     10: gap3F();
  1796.     11: ledge1F();
  1797.     12: ledge2F();
  1798.     13: ledge3F();
  1799.     14: ledge4F();
  1800.     15: edge1F();
  1801.     16: walkToWallF();
  1802.   end;
  1803.   wait(randomrange(75, 175));
  1804. end;
  1805.  
  1806. function getStateD(): Integer;
  1807. begin
  1808.   if not isLoggedIn() then
  1809.     exit(1);
  1810.   if lootMark() then
  1811.     exit(2);
  1812.   if (reflect.Tiles.NearTile(Point(3104, 3279), 3)) and (reflect.Tiles.getplane = 0) then
  1813.     exit(3);
  1814.   if At1D then
  1815.     exit(4);
  1816.   if At2D then
  1817.     exit(5);
  1818.   if At3D then
  1819.     exit(6);
  1820.   if At4D then
  1821.     exit(7);
  1822.   if At5D then
  1823.     exit(8);
  1824.   if At6D then
  1825.     exit(9);
  1826.   if reflect.Tiles.getplane = 0 then
  1827.     exit(10);
  1828. end;
  1829.  
  1830. procedure executeStateD(State: Integer);
  1831. begin
  1832.   case (State) of
  1833.     1: HandleLogin();
  1834.     2: lootMark();
  1835.     3: thewallD();
  1836.     4: rope1D();
  1837.     5: rope2D();
  1838.     6: nwallD();
  1839.     7: jwallD();
  1840.     8: gapD();
  1841.     9: crateD();
  1842.     10: walkToWallD();
  1843.   end;
  1844.   wait(randomrange(75, 175));
  1845. end;
  1846.  
  1847. begin
  1848.   AutoUpdateScript;
  1849.   initAL();
  1850.   Reflect.Setup();
  1851.   myplayer.Create;
  1852.   cH := (reflect.Smart.Height - 5);
  1853.   cW := (reflect.Smart.Width - 5);
  1854.   setupBreak(cBREAK_IN, cBREAK_FOR, cR_BREAK_IN, cR_BREAK_FOR);
  1855.   Reflect.Compass.MakePitch(4 + Random(2));
  1856.   repeat
  1857.     if (Course = 'Draynor') then
  1858.     begin
  1859.       executeStateD(getStateD());
  1860.     end
  1861.     else if (Course = 'Falador') then
  1862.     begin
  1863.       executeStateF(getStateF());
  1864.     end
  1865.     else if (Course = 'Seers') then
  1866.     begin
  1867.       executeStateS(getStateS());
  1868.     end
  1869.     else if (Course = 'Varrock') then
  1870.     begin
  1871.       executeStateV(getStateV());
  1872.     end
  1873.   until (false);
  1874. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement