daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Sep 23rd, 2016 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program EvasivArceuusFavour;
  2.  
  3. {$DEFINE SMART}
  4. {$i AeroLib/AeroLib.Simba}
  5. {$i Reflection/Reflection.simba}
  6.  
  7. var
  8.   reflectPlayer: TReflectLocalPlayer;
  9.   villia,horphis,sam,grackle,biblia: TPoint;
  10.   mode,onTask,gotBook,gotLoc:boolean;
  11.   startingfavour,currentState,bl,booksRetrieved,i:integer;
  12.   currentSearch:String;
  13.   AllShelves: TReflectObjectArray;
  14.   Shelf: TReflectObject;
  15.   xpbook: TReflectInvItem;
  16. const
  17.   LIB_DIST = 60;
  18. {
  19.  1: Journey of Souls
  20.  2: Ideology of Darkness
  21.  3: Rada's Census
  22.  4: Rada's journey
  23.  5: Twill Accord
  24.  6: Transvergence Theory
  25.  7: Byrne's coronation speech - Speach of King Byrne
  26.  8: Tristessa's tragedy- The Tragedy of Tristessa
  27.  9: Ricktor's diary - Diary of Steklan Ricktor
  28.  10:Treachery of Royalty - Treachery of Royalty
  29.  11:Killing of a King - Killing of a King
  30.  12:Dark manuscript
  31. }
  32. procedure declarePoints();
  33. begin
  34.   villia := Point(1626,3815);
  35.   horphis := Point(1639,3815);
  36.   sam := Point(1638,3801);
  37.   grackle := Point(1626,3801);
  38.   biblia := Point(1633,3824);
  39. end;
  40.  
  41. procedure login();
  42. begin
  43.   reflectPlayer.Username := 'andrecourau1993@gmail.com';
  44.   reflectPlayer.Password := 'lebaguette333';
  45.   reflectPlayer.Active := True;
  46.   Me.Member := True;
  47.   reflectPlayer.Create;
  48.   reflectPlayer.Login;
  49. end;
  50.  
  51. function TileInsideZone(tile : TTile; xMax, yMax, xMin, yMin : Integer) : boolean;
  52. var
  53.   x,y:Integer;
  54.   ret : boolean;
  55. begin
  56.   x := tile.X;
  57.   y := tile.Y;
  58.   exit ( (x <= xMax) and (x>=xMin) and (y<=yMax) and (y>=yMin) );
  59. end;
  60.  
  61. function DistFromPlayer(tile : TTile) : single;
  62. Var
  63.   playerTile: TTile;
  64. begin
  65.   playerTile := reflectPlayer.GetTile;
  66.   exit (Sqrt(power(playerTile.X - tile.X, 2) + power(playerTile.Y - tile.Y, 2)));
  67. end;
  68.  
  69. procedure RemoveFromArray(var objects : Array of TReflectObject; index : Integer);
  70. var
  71.   i: Integer;
  72. begin
  73.   for i := index + 1 to Length(objects) - 1 do
  74.     objects[i - 1] := objects[i];
  75.   SetLength(AllShelves, Length(AllShelves)-1);
  76. end;
  77.  
  78. procedure SortGameObjectByDist(var objects : Array of TReflectObject; size : Integer);
  79. Var
  80.     i, j: Integer;
  81.   temp : TReflectObject;
  82. Begin
  83.     For i := size-1 DownTo 1 do
  84.         For j := 1 to i do
  85.             If (DistFromPlayer(objects[j-1].GetTile) > DistFromPlayer(objects[j].GetTile)) Then
  86.             Begin
  87.                 temp := objects[j-1];
  88.                 objects[j-1] := objects[j];
  89.                 objects[j] := temp;
  90.             End;
  91. End;
  92.  
  93. function searchShelves(bookName : String; xMax, yMax, xMin, yMin : Integer) : boolean;
  94. var
  95.   i: Integer;
  96.   tile: TTile;
  97.   shelf : TReflectObject;
  98.   book : TReflectInvItem;
  99.   safety: boolean;
  100. begin
  101.   WriteLn('Starting book search for: ', bookName);
  102.   //Check if inside room
  103.   if(not TileInsideZone(reflectPlayer.GetTile, xMax, yMax, xMin, yMin)) then
  104.   begin
  105.     WriteLn('Player not inside correct room, exiting');
  106.     exit(false);
  107.   end;
  108.  
  109.   //Move pitch
  110.   Reflect.Compass.MakePitch(7);
  111.  
  112.   //Search
  113.   AllShelves.Get(objGame, 'Bookshelf', LIB_DIST);
  114.   WriteLn('Shelves found: ', Length(AllShelves));
  115.  
  116.   //Clamp search
  117.   i:=0;
  118.   while(i<Length(AllShelves)) do
  119.   begin
  120.     if(not(TileInsideZone(AllShelves[i].GetTile,xMax, yMax, xMin, yMin))) then
  121.     begin
  122.       RemoveFromArray(AllShelves,i);
  123.     end else
  124.     begin
  125.       inc(i);
  126.     end;
  127.   end;
  128.   WriteLn('Shelves after clamp: ', Length(AllShelves));
  129.  
  130.   //Start searching
  131.   while(Length(AllShelves)>0) do
  132.   begin
  133.     //Get next
  134.     shelf := AllShelves[0];
  135.     tile := shelf.GetTile;
  136.  
  137.     //If far go to shelf
  138.     if(Reflect.Tiles.DistanceFromTile(tile) > 1) then
  139.     begin
  140.       repeat
  141.         reflectPlayer.BlindWalkMM (tile,0);
  142.         wait(1000);
  143.         while(reflectPlayer.IsMoving) do
  144.           wait(250);
  145.       until (Reflect.Tiles.DistanceFromTile(tile) <= 1);
  146.     end;
  147.  
  148.     //Rotate to
  149.     Reflect.Tiles.RotateCameraToTile(tile);
  150.  
  151.     //Click shelf
  152.     repeat
  153.       Reflect.Mouse.Move(shelf.getMSPoint,5,5);
  154.       wait(1000);
  155.       if(Reflect.Text.IsUpText('Stairs')) then
  156.         begin
  157.           Reflect.Mouse.Click(Mouse_Right);
  158.           chooseOption('Search');
  159.           safety:=true;
  160.         end;
  161.     until((Reflect.Text.IsUpText('Bookshelf')) or safety);
  162.  
  163.     if(not safety) then
  164.       Reflect.Mouse.Click(Mouse_Left);
  165.     safety:=false;
  166.     wait(1000);
  167.     repeat
  168.       wait(200);
  169.     until((not reflectPlayer.IsAnimating) and (not reflectPlayer.IsMoving));
  170.  
  171.     //Check for book
  172.     if(book.Find(bookName)) then
  173.       begin
  174.         WriteLn('Book Found!');
  175.           if(mode) then
  176.             begin
  177.               startingfavour:=startingfavour+30;
  178.             end else
  179.               begin
  180.                 startingfavour:=startingfavour+15;
  181.               end;
  182.         gotBook:=true;
  183.         Reflect.Compass.Make('n');
  184.         exit (true);
  185.         break;
  186.       end;
  187.  
  188.     //Remove and resort
  189.     RemoveFromArray(AllShelves,0);
  190.     SortGameObjectByDist(AllShelves, Length(AllShelves));
  191.     WriteLn('Books left: ', Length(AllShelves));
  192.  
  193.   end;
  194.   //Loop ended
  195.   WriteLn('Book not found, very sad');
  196.   exit(false);
  197.  
  198. end;
  199.  
  200. procedure getBookName();
  201. var
  202.   book:integer;
  203.  
  204. begin
  205.   if(Reflect.Chat.NpcChooseOption('Journey of Souls') = true ) then
  206.     currentSearch:='Soul journey';
  207.  
  208.   if(Reflect.Chat.NpcChooseOption('Ideology of Darkness') = true ) then
  209.     currentSearch:='Ideology of darkness';
  210.  
  211.   if(Reflect.Chat.NpcChooseOption('census') = true ) then
  212.     currentSearch:='Rada''s census';
  213.  
  214.   if(Reflect.Chat.NpcChooseOption('Journey of Rada') = true ) then
  215.     currentSearch:='Rada''s journey';
  216.  
  217.   if(Reflect.Chat.NpcChooseOption('Twill') = true ) then
  218.     currentSearch:='Twill accord';
  219.  
  220.   if(Reflect.Chat.NpcChooseOption('Transvergence') = true ) then
  221.     currentSearch:='Transvergence theory';
  222.  
  223.   if(Reflect.Chat.NpcChooseOption('Byrne') = true ) then
  224.     currentSearch:='Byrne''s coronation speech';
  225.  
  226.   if(Reflect.Chat.NpcChooseOption('Tristessa') = true ) then
  227.     currentSearch:='Tristessa''s tragedy';
  228.  
  229.   if(Reflect.Chat.NpcChooseOption('Steklan') = true ) then
  230.     currentSearch:='Ricktor''s diary(7)';
  231.  
  232.   if(Reflect.Chat.NpcChooseOption('Treachery ') = true ) then
  233.     currentSearch:='Treachery of royalty';
  234.  
  235.   if(Reflect.Chat.NpcChooseOption('Killing') = true ) then
  236.     currentSearch:='Killing of a king';
  237.  
  238.   if(Reflect.Chat.NpcChooseOption('hodidius') = true ) then
  239.     currentSearch:='Hosidius letter';
  240.  
  241.   if(Reflect.Chat.NpcChooseOption('Wintertodt') = true ) then
  242.     currentSearch:='Wintertodt parable';
  243.  
  244.   if(Reflect.Chat.NpcChooseOption('extract') = true ) then
  245.     currentSearch:='Eathram & rada extract';
  246.  
  247.   if(Reflect.Chat.NpcChooseOption('transportation') = true ) then
  248.     currentSearch:='Transportation incantations';
  249.   WriteLn(currentSearch);
  250. end;
  251.  
  252. procedure walker(tpa:TPointArray);
  253. var
  254.   i:integer;
  255.  
  256. begin
  257.   for i:=0 to length(tpa)-1 do
  258.     begin
  259.       repeat
  260.         reflectPlayer.BlindWalkMM(tpa[i],1);
  261.         sleep(1000+random(83));
  262.       until(Reflect.Tiles.DistanceFromTile(tpa[i])< 2);
  263.     end;
  264. end;
  265.  
  266. procedure atGrackle();
  267. var
  268.   path:TPointArray;
  269.  
  270. begin
  271.   path:=[villia];
  272.   walker(path);
  273. end;
  274.  
  275.  
  276.  
  277. procedure climbStairs();
  278. var
  279.   stairs:TReflectObject;
  280.  
  281. begin
  282.   if (stairs.Find(objGame,'Stairs',4)) then
  283.     begin
  284.       repeat
  285.         Reflect.Mouse.Move(stairs.getMSPoint,3,8);
  286.         sleep(300+random(33));
  287.       until(Reflect.Text.IsUpText('Climb'));
  288.       Reflect.Mouse.Click(Mouse_Left);
  289.       sleep(2000+random(200));
  290.     end;
  291. end;
  292.  
  293. procedure toTopNW();
  294. var
  295.   path1:TPointArray;
  296. begin
  297.   path1:=[Point(1623,3824),Point(1615,3825)];
  298.   walker(path1);
  299. end;
  300.  
  301. procedure toMiddleNW();
  302. var
  303.   path1,path2:TPointArray;
  304. begin
  305.   path1:=[Point(1623,3824),Point(1608,3819)];
  306.   path2:=[Point(1619,3820)];
  307.   walker(path1);
  308.   climbstairs;
  309.   walker(path2);
  310. end;
  311.  
  312. procedure toBottomNW();
  313. var
  314.   path1,path2,path3:TPointArray;
  315. begin
  316.   path1:=[Point(1623,3824),Point(1608,3819)];
  317.   path2:=[Point(1610,3827)];
  318.   path3:=[Point(1620,3824)];
  319.   walker(path1);
  320.   climbstairs;
  321.   walker(path2);
  322.   climbstairs;
  323.   walker(path3);
  324. end;
  325.  
  326. procedure toTopS();
  327. var
  328.   path1:TPointArray;
  329. begin
  330.   path1:=[Point(1623,3824),Point(1615,3815),Point(1614,3799),Point(1618,3798)];
  331.   walker(path1);
  332. end;
  333.  
  334. procedure toMiddleS();
  335. var
  336.   path1,path2:TPointArray;
  337. begin
  338.   path1:=[Point(1623,3824),Point(1615,3815),Point(1614,3799),Point(1621,3798)];
  339.   path2:=[Point(1616,3788)];
  340.   walker(path1);
  341.   climbstairs;
  342.   walker(path2);
  343. end;
  344.  
  345. procedure toBottomS();
  346. var
  347.   path1,path2,path3:TPointArray;
  348. begin
  349.   path1:=[Point(1623,3824),Point(1615,3815),Point(1614,3799),Point(1621,3798),Point(1621,3798)];
  350.   path2:=[Point(1610,3795)];
  351.   path3:=[Point(1620,3791)];
  352.   walker(path1);
  353.   climbstairs;
  354.   walker(path2);
  355.   climbstairs;
  356.   walker(path3);
  357. end;
  358.  
  359. procedure toTopNE();
  360. var
  361.   path1:TPointArray;
  362. begin
  363.   path1:=[Point(1642,3825),Point(1653,3820)];
  364.   walker(path1);
  365. end;
  366.  
  367. procedure toMiddleNE();
  368. var
  369.   path1,path2,path3:TPointArray;
  370. begin
  371.   path1:=[Point(1642,3825),Point(1650,3828)];
  372.   path2:=[Point(1652,3825)];
  373.   walker(path1);
  374.   climbstairs;
  375.   walker(path2);
  376. end;
  377.  
  378. procedure toBottomNE();
  379. var
  380.   path1,path2,path3:TPointArray;
  381. begin
  382.   path1:=[Point(1642,3825),Point(1650,3828)];
  383.   path2:=[Point(1642,3821)];
  384.   path3:=[Point(1648,3826)];
  385.   walker(path1);
  386.   climbstairs;
  387.   walker(path2);
  388.   climbstairs;
  389.   walker(path3);
  390. end;
  391.  
  392. procedure toTopCenter();
  393. var
  394.   path1:TPointArray;
  395. begin
  396.   path1:=[Point(1638,3801)];
  397.   walker(path1);
  398. end;
  399.  
  400. procedure toMiddleCenter();
  401. var
  402.   path1,path2:TPointArray;
  403.   stair:TTile;
  404. begin
  405.   stair:=Point(1639,3804);
  406.   path1:=[Point(1639,3803)];
  407.   path2:=[Point(1639,3810)];
  408.   walker(path1);
  409.   Reflect.Mouse.Move(Reflect.Tiles.TileToMS(stair,0,0,0),3,3);
  410.   sleep(100+random(100));
  411.   Reflect.Mouse.Click(Mouse_Left);
  412.   sleep(1500+random(100));
  413.   walker(path2);
  414. end;
  415.  
  416. procedure MiddleNEtoStart();
  417. var
  418.   path1,path2,path3,path4:TPointArray;
  419.  
  420. begin
  421.   path1:=[Point(1642,3822)];
  422.  
  423.   walker(path1);
  424.   climbstairs;
  425.  
  426.   if(mode)then
  427.     begin
  428.     walker([horphis]);
  429.   end else
  430.     begin
  431.       walker([horphis]);
  432.       walker([villia]);
  433.     end;
  434. end;
  435.  
  436. procedure TopNEtoStart();
  437. var
  438.   path1,path2,path3,path4:TPointArray;
  439.  
  440. begin
  441.   path1:=[Point(1644,3828)];
  442.   walker(path1);
  443.   climbstairs;
  444.   MiddleNEtoStart;
  445. end;
  446.  
  447. procedure BottomNEtoStart();
  448. begin
  449.   if(mode)then
  450.     begin
  451.     walker([horphis]);
  452.   end else
  453.     begin
  454.       walker([horphis]);
  455.       walker([villia]);
  456.     end;
  457. end;
  458.  
  459. procedure TopNWtoStart();
  460. var
  461.   path1,path2:TPointArray;
  462.  
  463. begin
  464.   path1:=[Point(1608,3818)];
  465.   path2:=[Point(1610,3826)];
  466.   walker(path1);
  467.   climbstairs;
  468.   walker(path2);
  469.   climbstairs;
  470.   if(mode) then
  471.     begin
  472.       walker([horphis]);
  473.   end else
  474.     walker([villia]);
  475. end;
  476.  
  477. procedure MiddleNWtoStart();
  478. var
  479.   path1:TPointArray;
  480.  
  481. begin
  482.   path1:=[Point(1610,3826)];
  483.   walker(path1);
  484.   climbstairs;
  485.   if(mode) then
  486.     begin
  487.       walker([horphis]);
  488.   end else
  489.     walker([villia]);
  490. end;
  491.  
  492. procedure BottomNWtoStart();
  493.  
  494. begin
  495.   if(mode) then
  496.     begin
  497.       walker([horphis]);
  498.   end else
  499.     walker([villia]);
  500. end;
  501.  
  502. procedure TopStoStart();
  503. var
  504.   path1,path2,path3:TPointArray;
  505.  
  506. begin
  507.   path1:=[Point(1621,3798)];
  508.   path2:=[Point(1610,3795)];
  509.   path3:=[Point(1626,3803)];
  510.   walker(path1);
  511.   climbstairs;
  512.   walker(path2);
  513.   climbstairs;
  514.   walker(path3);
  515.   if(mode) then
  516.     begin
  517.       walker([horphis]);
  518.   end else
  519.     walker([villia]);
  520. end;
  521.  
  522. procedure MiddleStoStart();
  523. var
  524.   path1,path2:TPointArray;
  525.  
  526. begin
  527.  
  528.   path1:=[Point(1610,3795)];
  529.   path2:=[Point(1626,3803)];
  530.  
  531.   walker(path1);
  532.   climbstairs;
  533.   walker(path2);
  534.   if(mode) then
  535.     begin
  536.       walker([horphis]);
  537.   end else
  538.     walker([villia]);
  539. end;
  540.  
  541. procedure BottomStoStart();
  542. var
  543.   path1,path2:TPointArray;
  544.  
  545. begin
  546.   path1:=[Point(1626,3803)];
  547.   walker(path1);
  548.   if(mode) then
  549.     begin
  550.       walker([horphis]);
  551.   end else
  552.     walker([villia]);
  553. end;
  554.  
  555. procedure TopCenterToStart();
  556. var
  557.   path1:TPointArray;
  558.  
  559. begin
  560.  
  561.   path1:=[Point(1646,3825)];
  562.   walker([biblia]);
  563.   if(mode)then
  564.     begin
  565.       walker(path1);
  566.       TopNEtoStart;
  567.     end;
  568. end;
  569.  
  570. procedure MiddleCenterToStart();
  571.  
  572. var
  573.   path1:TPointArray;
  574. begin
  575.   path1:=[Point(1639,3810)];
  576.   walker(path1);
  577.   climbstairs;
  578.   TopCenterToStart;
  579. end;
  580.  
  581. procedure moveToStart();
  582.  
  583. begin
  584.   case (bl) of
  585.     1: TopStoStart();
  586.     2: TopNEtoStart();
  587.     3: TopNWtoStart();
  588.     4: TopCenterToStart();
  589.     5: MiddleStoStart();
  590.     6: MiddleNEtoStart();
  591.     7: MiddleNWtoStart();
  592.     8: MiddleCenterToStart();
  593.     9: BottomStoStart();
  594.     10:BottomNEtoStart();
  595.     11:BottomNWtoStart();
  596.   end;
  597. end;
  598.  
  599. procedure moveToBook();
  600. var
  601.   xMax,yMax,xMin,yMin:integer;
  602.   done:boolean;
  603. begin
  604.   case (bl) of
  605.     1: toTopS();
  606.     2: toTopNE();
  607.     3: toTopNW();
  608.     4: toTopCenter();
  609.     5: toMiddleS();
  610.     6: toMiddleNE();
  611.     7: toMiddleNW();
  612.     8: toMiddleCenter();
  613.     9: toBottomS();
  614.     10:toBottomNE();
  615.     11:toBottomNW();
  616.   end;
  617.   sleep(1000+random(200));
  618.   if(mode=true) then
  619.     currentSearch:='Dark manuscript';
  620.   if((bl=1) or (bl = 5) or (bl = 9)) then
  621.     begin
  622.       xMax:=1627;
  623.       yMax:=3803;
  624.       xMin:=1606;
  625.       yMin:=3783;
  626.     end;
  627.  
  628.   if((bl=4) or (bl = 8)) then
  629.     begin
  630.       xMax:=1642;
  631.       yMax:=3816;
  632.       xMin:=1624;
  633.       yMin:=3799;
  634.     end;
  635.  
  636.   if((bl=3) or (bl = 7) or (bl = 11)) then
  637.     begin
  638.       xMax:=1628;
  639.       yMax:=3832;
  640.       xMin:=1606;
  641.       yMin:=3813;
  642.     end;
  643.  
  644.   if((bl=2) or (bl = 6) or (bl = 10)) then
  645.     begin
  646.       xMax:=1659;
  647.       yMax:=3832;
  648.       xMin:=1638;
  649.       yMin:=3813;
  650.     end;
  651.   repeat
  652.     done := searchShelves(currentSearch,xMax,yMax,xMin,yMin);
  653.   until(done);
  654.   movetostart;
  655. end;
  656.  
  657. procedure getBookLocation();
  658. begin
  659. if((Reflect.Chat.NpcChooseOption('top') = true) and (Reflect.Chat.NpcChooseOption('south') = true)) then
  660.     bl:=1;
  661. if((Reflect.Chat.NpcChooseOption('top') = true) and (Reflect.Chat.NpcChooseOption('north-eastern') = true)) then
  662.     bl:=2;
  663. if((Reflect.Chat.NpcChooseOption('top') = true) and (Reflect.Chat.NpcChooseOption('north-western') = true)) then
  664.     bl:=3;
  665. if((Reflect.Chat.NpcChooseOption('top') = true) and (Reflect.Chat.NpcChooseOption('central') = true)) then
  666.     bl:=4;
  667. if((Reflect.Chat.NpcChooseOption('middle') = true) and (Reflect.Chat.NpcChooseOption('south') = true)) then
  668.     bl:=5;
  669. if((Reflect.Chat.NpcChooseOption('middle') = true) and (Reflect.Chat.NpcChooseOption('north-eastern') = true)) then
  670.     bl:=6;
  671. if((Reflect.Chat.NpcChooseOption('middle') = true) and (Reflect.Chat.NpcChooseOption('north-western') = true)) then
  672.     bl:=7;
  673. if((Reflect.Chat.NpcChooseOption('middle') = true) and (Reflect.Chat.NpcChooseOption('central') = true)) then
  674.     bl:=8;
  675. if((Reflect.Chat.NpcChooseOption('bottom') = true) and (Reflect.Chat.NpcChooseOption('south') = true)) then
  676.     bl:=9;
  677. if((Reflect.Chat.NpcChooseOption('bottom') = true) and (Reflect.Chat.NpcChooseOption('north-eastern') = true)) then
  678.     bl:=10;
  679. if((Reflect.Chat.NpcChooseOption('bottom') = true) and (Reflect.Chat.NpcChooseOption('north-western') = true)) then
  680.     bl:=11;
  681. WriteLn('Book Location: ', bl);
  682.     moveToBook;
  683. end;
  684.  
  685. procedure talkToBiblia();
  686. var
  687.   biblia: TReflectNpc;
  688.   msp:integer;
  689.  
  690. begin
  691.   repeat
  692.       if(xpbook.Find('Book of arcane knowledge')) then
  693.       begin
  694.         Reflect.Mouse.Move(xpbook.GetMSPoint,3,8);
  695.         if(Reflect.Text.IsUpText('knowledge'))then
  696.           begin
  697.             Reflect.Mouse.Click(Mouse_left);
  698.             sleep(1500+random(150));
  699.             Reflect.Chat.NpcChooseOption('Magic');
  700.           end;
  701.       end;
  702.   repeat
  703.     sleep(500+random(50));
  704.   until(biblia.Find('Biblia'));
  705.   if(biblia.Find('Biblia')) then
  706.     begin
  707.       repeat
  708.         reflectPlayer.BlindWalkMM(biblia.GetTile,2);
  709.       until(Reflect.Tiles.DistanceFromTile(biblia.GetTile)<3);
  710.       msp:=Reflect.MouseSpeed;
  711.       Reflect.MouseSpeed:=30;
  712.       repeat
  713.       sleep(150+random(100));
  714.       Reflect.Mouse.Move(biblia.getMSPoint,3,8);
  715.       until(Reflect.Text.IsUpText('Biblia'));
  716.       Reflect.Mouse.Click(MOUSE_RIGHT);
  717.       Reflect.MouseSpeed:=msp;
  718.       chooseOption('Talk');
  719.       if(not didRedClick)then
  720.         talkToBiblia;
  721.       repeat
  722.       sleep(100+random(20));
  723.       until(Reflect.Chat.NpcChooseOption('I have much tidying'))
  724.       if(mode=false) then
  725.         begin
  726.           if(Reflect.Chat.NpcChooseOption('I have much tidying') = true ) then
  727.             begin
  728.               Reflect.Chat.NpcClickToContinue;
  729.               repeat
  730.                 sleep(200+random(30));
  731.               until(Reflect.Chat.NpcChooseOption('looking for a book') = true);
  732.               Reflect.Chat.NpcChooseOption('looking for a book');
  733.               sleep(1200+random(100));
  734.               Reflect.Chat.NpcClickToContinue;
  735.               sleep(2000+random(100));
  736.               gotLoc:=true;
  737.               getBookLocation;
  738.             end else
  739.               talkToBiblia;
  740.         end else
  741.           begin
  742.             sleep(500+random(100));
  743.             Reflect.Chat.NpcClickToContinue;
  744.             sleep(1200+random(100));
  745.             if(Reflect.Chat.NpcChooseOption('seen') = true ) then
  746.               begin
  747.                 if(Reflect.Chat.NpcChooseOption('book'))then
  748.                   TopNEtoStart;
  749.                 Reflect.Chat.NpcChooseOption('Have');
  750.                 sleep(500+random(200));
  751.                 Reflect.Chat.NpcClickToContinue;
  752.                 sleep(800+random(100));
  753.                 gotLoc:=true;
  754.                 getBookLocation;
  755.               end;
  756.           end;
  757.     end;
  758.     until(gotLoc);
  759. end;
  760.  
  761. procedure toBiblia();
  762. var
  763.   biblia: TReflectNpc;
  764.   stairs,stairs1:TReflectObject;
  765.   path1,path2,path3:TPointArray;
  766.  
  767. begin
  768.   path1:=[Point(1618,3826)];
  769.   path2:=[Point(1615,3818)];
  770.   path3:=[Point(1623,3824),Point(1633,3825)];
  771.  
  772.   walker(path1);
  773.   stairs.Find(objGame,'Stairs',3);
  774.   climbstairs;
  775.   walker(path2);
  776.   stairs1.Find(objGame,'Stairs',4);
  777.   climbstairs;
  778.   walker(path3);
  779.   talkToBiblia;
  780. end;
  781.  
  782. procedure horphisToBiblia();
  783. var
  784.   path1,path2,path3:TPointArray;
  785.   biblia: TReflectNpc;
  786.  
  787. begin
  788.   path1:=[Point(1644,3818)];
  789.   path2:=[Point(1643,3829)];
  790.   path3:=[Point(1633,3824)];
  791.   walker(path1);
  792.   climbstairs;
  793.   walker(path2);
  794.   climbstairs;
  795.   walker(path3);
  796.   talkToBiblia;
  797. end;
  798.  
  799. procedure talkToHorphis();
  800. var
  801.   horphis: TReflectNpc;
  802. begin
  803. if(horphis.Find('Horphis')) then
  804.   begin
  805.     repeat
  806.       Reflect.Mouse.Move(horphis.GetMSPoint,3,5);
  807.       sleep(100+random(100));
  808.     until(Reflect.Text.IsUpText('Horphis'));
  809.     Reflect.Mouse.Click(Mouse_Left);
  810.     sleep(100+random(50));
  811.     gotBook:=false;
  812.     horphisToBiblia;
  813.   end;
  814. end;
  815.  
  816. procedure talkToGrackle();
  817.  
  818. var
  819.   grackle,biblia: TReflectNpc;
  820.   stairs,stairs1:TReflectObject;
  821.   path:TPointArray;
  822.  
  823. begin
  824.   path:=[villia];
  825.   if(grackle.Find('Professor Gracklebone')) then
  826.     begin
  827.       repeat
  828.         Reflect.Mouse.Move(grackle.getMSPoint,3,8);
  829.       until(Reflect.Text.IsUpText('Talk'));
  830.       Reflect.Mouse.Click(MOUSE_RIGHT);
  831.       chooseOption('Help');
  832.       sleep(1000+random(100));
  833.       if((Reflect.Chat.NpcChooseOption('Thank') = true) or (Reflect.Chat.NpcChooseOption('I believe you are curr') = true) ) then
  834.         begin
  835.           walker(path);
  836.           exit;
  837.         end;
  838.       getBookName;
  839.       sleep(500+random(100));
  840.       toBiblia;
  841.     end;
  842. end;
  843.  
  844. procedure talkToVillia();
  845. var
  846.   villia,biblia: TReflectNpc;
  847.   stairs,stairs1:TReflectObject;
  848.   path:TPointArray;
  849. begin
  850.   path:=[grackle];
  851.   if(villia.Find('Villia')) then
  852.     begin
  853.       repeat
  854.         Reflect.Mouse.Move(villia.getMSPoint,3,8);
  855.       until(Reflect.Text.IsUpText('Talk'));
  856.       Reflect.Mouse.Click(MOUSE_RIGHT);
  857.       chooseOption('Help');
  858.       sleep(1000+random(100));
  859.       if((Reflect.Chat.NpcChooseOption('Thank') = true) or (Reflect.Chat.NpcChooseOption('I believe you are curr') = true) ) then
  860.         begin
  861.           walker(path);
  862.           exit;
  863.         end;
  864.       getBookName;
  865.       sleep(500+random(100));
  866.       toBiblia;
  867.     end;
  868. end;
  869.  
  870. function getState(): Integer;
  871. var
  872.   horphis: TReflectNpc;
  873. begin
  874.   if((Reflect.Tiles.DistanceFromTile(villia)< 6) and not onTask and not mode and (Reflect.Tiles.GetTileHeight(reflectPlayer.GetTile)<1600)) then
  875.     exit(1);
  876.   if((Reflect.Tiles.DistanceFromTile(grackle)< 6) and not onTask and not mode and (Reflect.Tiles.GetTileHeight(reflectPlayer.GetTile)<1600)) then
  877.     exit(2);
  878.   if((Reflect.Tiles.GetPlane=2) and not(Reflect.Chat.NpcChatOpen)) then
  879.     exit(3);
  880.   if(mode and (horphis.Find('Horphis')) and not(gotBook))then
  881.     exit(4);
  882.   if(mode and (horphis.Find('Horphis')) and (gotBook))then
  883.     exit(5);
  884. end;
  885.  
  886. procedure executeState(State: Integer);
  887. begin
  888.   case (State) of
  889.     1: talkToVillia();
  890.     2: talkToGrackle();
  891.     3: talkToBiblia();
  892.     4: horphisToBiblia();
  893.     5: talkToHorphis();
  894.   end;
  895.   sleep(Random(100,200));
  896. end;
  897.  
  898. begin
  899.   initAL('C:\Javas\Java4\jre1.8.0_91\bin\javaw.exe');
  900.   Reflect.Setup;
  901.   login;
  902.   declarePoints;
  903.   mode:=false;;
  904.   //startingfavour is your current favour x10
  905.   startingfavour:=135;
  906.    repeat
  907.     if (startingfavour>200) then
  908.       mode:=true;
  909.     WriteLn(reflectPlayer.GetTile);
  910.     WriteLn(Reflect.Tiles.GetPlane);
  911.     currentState := getState();
  912.     WriteLn('Current mode :',mode,' Favour: ', startingfavour, ' State :', currentState);
  913.  
  914.     executeState(currentState);
  915.     sleep(1000);
  916.    until(startingfavour=600);
  917.    logoutPlayer;
  918.    terminatescript;
  919. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top