Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: Pascal  |  size: 25.62 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. program KylesEsswraithExtractor;
  2.  
  3. {$DEFINE SMART}
  4. {$i srl/srl.simba}
  5. {$I SRL/SRL/Misc/Debug.Simba}
  6.  
  7. const
  8.   {* Don't touch *}
  9.   Version = '1.5';
  10.  
  11.   {* SRL Stats *}
  12.   SRLStats_Username = '';
  13.   SRLStats_Password = '';
  14.  
  15.   {* Object Constants *}
  16.   objUndeadSoul     = 0;
  17.   objLivingSoul     = 1;
  18.   objSoulWraith     = 2;
  19.   objBloodySkulls   = 3;
  20.   objBloodPool      = 4;
  21.   objBloodWraith    = 5;
  22.   objSkulls         = 6;
  23.   objDeathWraith    = 7;
  24.   objJumper         = 8;
  25.   objShifter        = 9;
  26.   objNebula         = 10;
  27.   objWaterEssling   = 11;
  28.   objVine           = 12;
  29.   objLawHound       = 13;
  30.   objCosmicHound    = 14;
  31.   objChaosHound     = 15;
  32.   objAstralHound    = 16;
  33.   objNatureHound    = 17;
  34.   objBodyHound      = 18;
  35.   objCCloud         = 19;
  36.   objAirEss         = 20;
  37.   objWaterPool      = 21;
  38.   objFleshyGrowth   = 22;
  39.   objFireStorm      = 23;
  40.   objEarthEss       = 24;
  41.   objRockFrag       = 25;
  42.   objFireball       = 26;
  43.   objMindEssling    = 27;
  44.   objCyclone        = 28;
  45.  
  46.   (* Break settings *)
  47.   SwitchWorlds  = True;    // Switch worlds after a break?
  48.   TakeBreaks    = False;   // Take Breaks during runtime?
  49.   BreakIn       = 180;     // How long before we take a break? (minutes)
  50.   BreakFor      = 20;      // How long will we break for? (minutes)
  51.   Bir           = 13;      // Random minutes to add/subtract from how long until we break
  52.   Bfr           = 5;       // Random minutes to add/subjtract from break duraction
  53.   Floors        = 3;       // Which Floor are you on? 1,2,3? This is to make it only search on your island
  54.                            //  If it starts to bug out, set it to 0
  55.  
  56.   Debug = True;             // If things aren't working, set this to true and tell us what it says
  57.                             // Or if you want to narrow down colors to make script even better :)
  58. type
  59.   {* TObj Type *}
  60.   TObj = record
  61.     Hue, Sat : Extended;
  62.     Name: string;
  63.     UpText : TStringArray;
  64.     ObjID, Color, Tol, LvlReq, Max, Min, IXP: Integer;
  65.   end;
  66.  
  67. type
  68.   {* TObjectArray Type *}
  69.   TObjectArray = array of TObj;
  70.  
  71. var
  72.   {* Script Variables *}
  73.   StartXP, XPH, XP, TP, RCt, RCLvl, TW, CurrentXP, EssenceDTM, EX, EY,IslandColor,IslandTol: Integer;
  74.   Objects : TObjectArray;
  75.   IslandHue, IslandSat : Extended;
  76.   Higher, SafeNub : Boolean;
  77.   TB: Tbox;
  78.  
  79.   (* Break variables *)
  80.   w, x, y, z, RealBTime, CurrentBTime, BreakRounds : Integer;
  81.  
  82. procedure DeclarePlayers();
  83. begin
  84.   HowManyPlayers := 1;
  85.   NumberOfPlayers(HowManyPlayers);
  86.   CurrentPlayer := 0;
  87.  
  88.   with Players[0] do
  89.   begin
  90.     Name          := '';      // Your RuneScape Account Name
  91.     Pass          := '';      // Your RuneScape Account Password
  92.     Active        := True;    // Use in the Script. True / False.
  93.  
  94.     // This is for searching for specific Objects, add / remove as needed. Order doesn't matter
  95.     Integers      := [objUndeadSoul, objLivingSoul, objSoulWraith, objBloodySkulls, objBloodPool, objBloodWraith, objSkulls, objJumper, objShifter, objNatureHound];
  96.   end;
  97. end;
  98.  
  99. procedure SetDTM;
  100. begin
  101.   EssenceDTM := DTMFromString('mrAAAAHic42BgYHBkYmDwAGIXILYBYksodgdiXyB+DlTzCIgfQvEzIP4AxG+A+CkQW5ibMRjo64ExiG1tZcHg6uLE4O7mwmBsZMjABVSDDzMSwDAAAJ3CDvU=');
  102. end;
  103.  
  104. procedure Fr33DTM;
  105. begin
  106.   FreeDTM(EssenceDTM);
  107. end;
  108.  
  109. procedure DebugThis(s : string);
  110. begin
  111.   if(Debug)then
  112.     WriteLn(s);
  113. end;
  114.  
  115. procedure SetupObjects();
  116. begin
  117.   SetLength(Objects, 29);
  118.  
  119.   with Objects[objBloodWraith] do
  120.   begin
  121.     ObjID := objBloodWraith;
  122.     Name := 'Blood esswraith';
  123.     UpText := ['lood ess', 'ood essw', 'Siphon Blood esswraith'];
  124.     Color := 6263962;
  125.     Tol := 15;
  126.     Hue := 0.12;
  127.     Sat := 0.72;
  128.     LvlReq := 77;
  129.     Max := 250;
  130.     Min := 50;
  131.     IXP := 77;
  132.   end;
  133.  
  134.   with Objects[objDeathWraith] do
  135.   begin
  136.     ObjID := objDeathWraith;
  137.     Name := 'Death esswraith';
  138.     UpText := ['eath ess', 'iphon De', 'ath essw', 'Siphon Death esswraith'];
  139.     Color := 5278586;
  140.     Tol := 26;
  141.     Hue := 0.04;
  142.     Sat := 0.58;
  143.     LvlReq := 65;
  144.     Min := 0;
  145.     Max := 1000;
  146.     IXP := 60;
  147.   end;
  148.  
  149.   with Objects[objSoulWraith] do
  150.   begin
  151.     ObjID := objSoulWraith;
  152.     Name := 'Soul esswraith';
  153.     UpText := ['oul ess', 'iphon So', 'oul essw', 'Siphon Soul esswraith'];
  154.     Color := 6251056;
  155.     Tol := 24;
  156.     Hue := 0.25;
  157.     Sat := 1.01;
  158.     LvlReq := 90;
  159.     Min := 0;
  160.     Max := 1000;
  161.     IXP := 108;
  162.   end;
  163.  
  164.   with Objects[objLivingSoul] do
  165.   begin
  166.     ObjID := objLivingSoul;
  167.     Name := 'Living Soul';
  168.     UpText := ['Siphon Living', 'on Liv', 'iving', 'oul'];
  169.     Color := 12867973;
  170.     Tol := 9;
  171.     Hue := 0.51;
  172.     Sat := 0.99;
  173.     LvlReq := 90;
  174.     Min := 0;
  175.     Max := 1000;
  176.     IXP := 213;
  177.   end;
  178.  
  179.   with Objects[objJumper] do
  180.   begin
  181.     ObjID := objJumper;
  182.     Name := 'Jumper';
  183.     UpText := ['Siphon Jumper', 'on Jum', 'Jumper', 'mper'];
  184.     Color := 16624975;
  185.     Tol := 7;
  186.     Hue := 0.02;
  187.     Sat := 1.70;
  188.     LvlReq := 54;
  189.     Min := 10;
  190.     Max := 50;
  191.     IXP := 107;
  192.   end;
  193.  
  194.   with Objects[objBloodPool] do
  195.   begin
  196.     ObjID := objBloodPool;
  197.     Name := 'Blood Pool';
  198.     UpText := ['Siphon Blood Pool', 'on blo', 'blood', 'od poo'];
  199.     Color := 1252488;
  200.     Tol := 10;
  201.     Hue := 0.02;
  202.     Sat := 1.70;
  203.     LvlReq := 77;
  204.     Min := 80;
  205.     Max := 250;
  206.     IXP := 146;
  207.   end;
  208.  
  209.   with Objects[objNebula] do
  210.   begin
  211.     ObjID := objNebula;
  212.     Name := 'Nebula';
  213.     UpText := ['Siphon Nebula', 'on Neb', 'Nebula', 'bula'];
  214.     Color := 8988293;
  215.     Tol := 6;
  216.     Hue := 1.15;
  217.     Sat := 3.71;
  218.     LvlReq := 40;
  219.     Min := 55;
  220.     Max := 1000;
  221.     IXP := 85;
  222.   end;
  223.  
  224.   with Objects[objSkulls] do
  225.   begin
  226.     ObjID := objSkulls;
  227.     Name := 'Skulls';
  228.     UpText := ['Siphon Skulls', 'on Sku', 'Skulls', 'ulls'];
  229.     Color := 9748431;
  230.     Tol := 7;
  231.     Hue := 0.02;
  232.     Sat := 1.70;
  233.     LvlReq := 65;
  234.     Min := 3;
  235.     Max := 1000;
  236.     IXP := 120;
  237.   end;
  238.  
  239.   with Objects[objUndeadSoul] do
  240.   begin
  241.     ObjID := objUndeadSoul;
  242.     Name := 'Undead Soul';
  243.     UpText := ['ndead', 'oul', 'ndead So', 'd Soul'];
  244.     Color := 10979231;
  245.     Tol := 4;
  246.     Hue := 0.48;
  247.     Sat := 0.61;
  248.     LvlReq := 95;
  249.     Min := 0;
  250.     Max := 1000;
  251.     IXP := 255;
  252.   end;
  253.  
  254.   with Objects[objBloodySkulls] do
  255.   begin
  256.     ObjID := objBloodySkulls;
  257.     Name := 'Bloody Skulls';
  258.     UpText := ['Bloody', 'skulls', 'oody', 'kulls'];
  259.     Color := 396358;
  260.     Tol := 2;
  261.     Hue := 0.15;
  262.     Sat := 1.52;
  263.     LvlReq := 83;
  264.     Min := 5;
  265.     Max := 1000;
  266.     IXP := 176;
  267.   end;
  268.  
  269.   with Objects[objShifter] do
  270.   begin
  271.     ObjID := objShifter;
  272.     Name := 'Shifter';
  273.     UpText := ['Siphon Shifter', 'on Shi', 'Shifter', 'ifter'];
  274.     Color := 1830421;
  275.     Tol := 7;
  276.     Hue := 0.02;
  277.     Sat := 1.70;
  278.     LvlReq := 54;
  279.     Max := 900;
  280.     Min := 400;
  281.     IXP := 87;
  282.   end;
  283.  
  284.   with Objects[objWaterEssling] do
  285.   begin
  286.     ObjID := objWaterEssling;
  287.     Name := 'WaterEssling';
  288.     UpText := ['Water Essling', 'ater', 'er essl', 'ssling'];
  289.     Color := 12085388;
  290.     Tol := 17;
  291.     Hue := 1.29;
  292.     Sat := 0.99;          //messed up for now
  293.     LvlReq := 5;
  294.     Max := 0;
  295.     Min := 0;
  296.     IXP := 13;
  297.   end;
  298.  
  299.   with Objects[objVine] do
  300.   begin
  301.     ObjID := objVine;
  302.     Name := 'Vine';
  303.     UpText := ['Vine', 'phon V', 'on v'];
  304.     Color := 1200463;
  305.     Tol := 18;
  306.     Hue := 0.28;
  307.     Sat := 1.75;
  308.     LvlReq := 17;
  309.     Max := 900;
  310.     Min := 60;
  311.     IXP := 36;
  312.   end;
  313.  
  314.   with Objects[objCCloud] do
  315.   begin
  316.     ObjID := objCCloud;
  317.     Name := 'Chaotic Cloud';
  318.     UpText := ['Siphon Chaotic', 'on Chaotic', 'Chaotic', 'haotic Cloud'];
  319.     Color := 2167590;
  320.     Tol := 4;
  321.     Hue := 2.03;
  322.     Sat := 2.57;
  323.     LvlReq := 35;
  324.     Min := 20;
  325.     Max := 1000;
  326.     IXP := 62;
  327.   end;
  328.  
  329.   with Objects[objCosmicHound] do
  330.   begin
  331.     ObjID := objCosmicHound;
  332.     Name := 'Cosmic Esshound';
  333.     UpText := ['osmic', 'osmic ess', 'Cosmic', 'Siphon Cosmic', 'hound', 'ound'];
  334.     Color := 14448236;
  335.     Tol := 24;
  336.     Hue := 0.06;
  337.     Sat := 1.43;
  338.     LvlReq := 27;
  339.     Min := 250;
  340.     Max := 700;
  341.     IXP := 27;
  342.   end;
  343.  
  344.   with Objects[objChaosHound] do
  345.   begin
  346.     ObjID := objChaosHound;
  347.     Name := 'Chaos Esshound';
  348.     UpText := ['haos', 'haos ess', 'Chaos', 'Siphon Chaos', 'hound', 'ound'];
  349.     Color := 14448236;
  350.     Tol := 24;
  351.     Hue := 0.06;
  352.     Sat := 1.43;
  353.     LvlReq := 35;
  354.     Min := 250;
  355.     Max := 700;
  356.     IXP := 31;
  357.   end;
  358.  
  359.   with Objects[objAstralHound] do
  360.   begin
  361.     ObjID := objAstralHound;
  362.     Name := 'Astral Esshound';
  363.     UpText := ['stral', 'stral ess', 'Astral', 'Siphon Astral', 'hound', 'ound'];
  364.     Color := 14448236;
  365.     Tol := 24;
  366.     Hue := 0.06;
  367.     Sat := 1.43;
  368.     LvlReq := 40;
  369.     Min := 250;
  370.     Max := 700;
  371.     IXP := 36;
  372.   end;
  373.  
  374.   with Objects[objNatureHound] do
  375.   begin
  376.     ObjID := objNatureHound;
  377.     Name := 'Nature Esshound';
  378.     UpText := ['ature', 'ature ess', 'Nature', 'Siphon Nature', 'hound', 'ound'];
  379.     Color := 14448236;
  380.     Tol := 24;
  381.     Hue := 0.06;
  382.     Sat := 1.43;
  383.     LvlReq := 44;
  384.     Min := 250;
  385.     Max := 700;
  386.     IXP := 44;
  387.   end;
  388.  
  389.   with Objects[objLawHound] do
  390.   begin
  391.     ObjID := objLawHound;
  392.     Name := 'Law esshound';
  393.     UpText := ['Siphon Law', 'on Law', 'Law', 'aw ess', 'hound', 'ound'];
  394.     Color := 14448236;
  395.     Tol := 24;
  396.     Hue := 0.06;
  397.     Sat := 1.43;
  398.     LvlReq := 54;
  399.     Min := 250;
  400.     Max := 700;
  401.     IXP := 54;
  402.   end;
  403.  
  404.   with Objects[objBodyHound] do
  405.   begin
  406.     ObjID := objBodyHound;
  407.     Name := 'Body esshound';
  408.     UpText := ['Siphon Body', 'on Bod', 'Body', 'ody ess', 'hound', 'ound'];
  409.     Color := 14448236;
  410.     Tol := 24;
  411.     Hue := 0.06;
  412.     Sat := 1.43;
  413.     LvlReq := 20;
  414.     Min := 250;
  415.     Max := 700;
  416.     IXP := 24;
  417.   end;
  418.  
  419.   with Objects[objAirEss] do
  420.   begin
  421.     ObjID := objAirEss;
  422.     Name := 'Air essling';
  423.     UpText := ['ir ess', 'iphon Air', 'Siphon Air essling'];
  424.     Color := 15187588;
  425.     Tol := 20;
  426.     Hue := 0.05;
  427.     Sat := 2.04;
  428.     LvlReq := 1;
  429.     Max := 250;
  430.     Min := 50;
  431.     IXP := 10;
  432.   end;
  433.  
  434.   with Objects[objWaterPool] do
  435.   begin
  436.     ObjID := objWaterPool;
  437.     Name := 'Water Pool';
  438.     UpText := ['ter poo', 'iphon Wat', 'Siphon Water pool', 'ater pool'];
  439.     Color := 15187588;
  440.     Tol := 20;
  441.     Hue := 0.05;
  442.     Sat := 2.04;
  443.     LvlReq := 5;
  444.     Max := 250;
  445.     Min := 50;
  446.     IXP := 11;
  447.   end;
  448.  
  449.   with Objects[objFleshyGrowth] do
  450.   begin
  451.     ObjID := objFleshyGrowth;
  452.     Name := 'Fleshy Growth';
  453.     UpText := ['eshy grow', 'iphon Fle', 'Siphon Fleshy growth', 'shy gro'];
  454.     Color := 4082573;
  455.     Tol := 11;
  456.     Hue := 0.07;
  457.     Sat := 0.49;
  458.     LvlReq := 20;
  459.     Max := 250;
  460.     Min := 50;
  461.     IXP := 47;
  462.   end;
  463.  
  464.   with Objects[objFireStorm] do
  465.   begin
  466.     ObjID := objFireStorm;
  467.     Name := 'Fire Storm';
  468.     UpText := ['ire sto', 'iphon Fir', 'Siphon Fire storm', 'ire sto'];
  469.     Color := 2571174;
  470.     Tol := 3;
  471.     Hue := 0.19;
  472.     Sat := 4.75;
  473.     LvlReq := 27;
  474.     Max := 250;
  475.     Min := 50;
  476.     IXP := 42;
  477.   end;
  478.  
  479.   with Objects[objEarthEss] do
  480.   begin
  481.     ObjID := objEarthEss;
  482.     Name := 'Earth essling';
  483.     UpText := ['rth ess', 'iphon Ear', 'Siphon Earth essling', 'arth essl'];
  484.     Color := 4744582;
  485.     Tol := 15;
  486.     Hue := 0.04;
  487.     Sat := 0.32;
  488.     LvlReq := 1;
  489.     Max := 250;
  490.     Min := 50;
  491.     IXP := 15;
  492.   end;
  493.  
  494.   with Objects[objRockFrag] do
  495.   begin
  496.     ObjID := objRockFrag;
  497.     Name := 'Rock Fragment';
  498.     UpText := ['Siphon Rock', 'on Roc', 'Rock', 'Fragment'];
  499.     Color := 3434345;
  500.     Tol := 13;
  501.     Hue := 0.41;
  502.     Sat := 0.46;
  503.     LvlReq := 9;
  504.     Min := 60;
  505.     Max := 900;
  506.     IXP := 29;
  507.   end;
  508.  
  509.   with Objects[objFireball] do
  510.   begin
  511.     ObjID := objFireball;
  512.     Name := 'Fireball';
  513.     UpText := ['Siphon Fireball', 'on Fire', 'reball', 'fireball'];
  514.     Color := 1924282;
  515.     Tol := 12;
  516.     Hue := 0.36;
  517.     Sat := 1.10;
  518.     LvlReq := 14;
  519.     Min := 60;
  520.     Max := 900;
  521.     IXP := 35;
  522.   end;
  523.  
  524.   with Objects[objMindEssling] do
  525.   begin
  526.     ObjID := objMindEssling;
  527.     Name := 'Mind Essling';
  528.     UpText := ['Mind Essling', 'ind', 'nd essl', 'ssling'];
  529.     Color := 7905200;
  530.     Tol := 17;
  531.     Hue := 0.21;
  532.     Sat := 0.40;
  533.     LvlReq := 1;
  534.     Max := 150;
  535.     Min := 2;
  536.     IXP := 30;
  537.   end;
  538.  
  539.   with Objects[objCyclone] do
  540.   begin
  541.     ObjID := objCyclone;
  542.     Name := 'Cyclone';
  543.     UpText := ['Siphon Cyclone', 'clone', 'yclone', 'cyclone'];
  544.     Color := 2698292;
  545.     Tol := 6;
  546.     Hue := 0.51;
  547.     Sat := 1.10;
  548.     LvlReq := 1;
  549.     Min := 80;
  550.     Max := 900;
  551.     IXP := 19;
  552.   end;
  553. end;
  554.  
  555. function GetObject(vObj : Integer) : TObj;
  556. begin
  557.   Result := Objects[vObj];
  558. end;
  559.  
  560. function GetObjectByXP(xp : Integer) : TObj;
  561. var
  562.   i : Integer;
  563. begin
  564.   for i := 0 to High(Objects) do
  565.     if(Objects[i].IXP = xp)then
  566.       Result := Objects[i];
  567. end;
  568.  
  569. procedure AddObject(var objArr : TObjectArray; ObjID : Integer);
  570. begin
  571.   SetLength(objArr, Length(objArr) + 1);
  572.   objArr[High(objArr)] := GetObject(ObjID);
  573. end;
  574.  
  575. procedure FilterObjects();
  576. var
  577.   tmpObjects : TObjectArray;
  578.   i : Integer;
  579. begin
  580.   for i := 0 to High(Objects) do
  581.    // if(InIntArray(Players[CurrentPlayer].Integers, Objects[i].ObjID))then
  582.       AddObject(tmpObjects, Objects[i].ObjID);
  583.  
  584.   SetLength(Objects, High(tmpObjects));
  585.   Objects := tmpObjects;
  586. end;
  587.  
  588. procedure SortObjects();
  589. var
  590.   tmpObjects : TObjectArray;
  591.   TIA : TIntegerArray;
  592.   i : Integer;
  593. begin
  594.   SetLength(TIA, Length(Objects));
  595.  
  596.   for i := 0 to High(Objects) do
  597.     TIA[i] := Objects[i].IXP;
  598.  
  599.   Quicksort(TIA);
  600.   InvertTIA(TIA);
  601.  
  602.   SetLength(tmpObjects, Length(Objects));
  603.  
  604.   for i := 0 to High(TIA) do
  605.     tmpObjects[i] := GetObjectByXP(TIA[i]);
  606.  
  607.   Objects := tmpObjects;
  608. end;
  609.  
  610. procedure SetFalse(reason : string);
  611. begin
  612.   WriteLn(reason);
  613.   Players[CurrentPlayer].Active := False;
  614. end;
  615.  
  616. function K_FindObj(var x, y, vObj : Integer) : Boolean;
  617. var
  618.   fObj : TObj;
  619.   a, h : Integer;
  620.   TPA  : TPointArray;
  621.   ATPA : T2DPointArray;
  622.   tmpCTS : Integer;
  623. begin
  624.   if(not(LoggedIn))then Exit;
  625.   FindNormalRandoms;
  626.  
  627.   fObj := GetObject(vObj);
  628.  
  629.   tmpCTS := GetColorToleranceSpeed;
  630.   ColorToleranceSpeed(2);
  631.  
  632.   with fObj do
  633.   begin
  634.     SetColorSpeed2Modifiers(Hue, Sat);
  635.  
  636.     FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, TB.X1, TB.Y1, TB.X2, TB.Y2, Tol);
  637.     ATPA := TPAtoATPAEx(TPA, 20, 20);
  638.     SortATPASize(ATPA,True);
  639.  
  640.     H := High(ATPA);
  641.     DebugThis(Name);
  642.  
  643.     for a := 0 to H do
  644.     begin
  645.       MiddleTPAEx(atpa[a], X, Y);
  646.  
  647.       DebugThis(tostr(Length(atpa[a])));
  648.  
  649.       if((Length(atpa[a]) < Min) or (Length(atpa[a]) > Max))then
  650.         Continue;
  651.  
  652.       MMouse(X, Y, 5, 5);
  653.  
  654.       if(WaitUpTextMulti(UpText, RandomRange(350,450)))then
  655.       begin
  656.         ClickMouse2(True);
  657.  
  658.         if(DidRedClick)then
  659.         begin
  660.           ColorToleranceSpeed(tmpCTS);
  661.           SetColorSpeed2Modifiers(0.2, 0.2);
  662.  
  663.           Result := True;
  664.           Exit;
  665.         end;
  666.       end else
  667.       if(IsUptextMultiCustom(['esswraith', 'wraith', 'raith', 'Floating ess', 'Float', 'ing ess', 'Floating essence']))then
  668.       begin
  669.         Clickmouse2(False);
  670.  
  671.         if(WaitOptionMulti(UpText, 800))then
  672.         begin
  673.           ColorToleranceSpeed(tmpCTS);
  674.           SetColorSpeed2Modifiers(0.2, 0.2);
  675.  
  676.           Result := True;
  677.           Exit;
  678.         end;
  679.       end;
  680.     end;
  681.   end;
  682.  
  683.   ColorToleranceSpeed(tmpCTS);
  684.   SetColorSpeed2Modifiers(0.2, 0.2);
  685. end;
  686.  
  687. Function FindObjectPlatform: Boolean;
  688. var
  689.   CTS, I, L: Integer;
  690.   TPA: TPointArray;
  691.   ATPA: T2DPointArray;
  692. begin
  693.   Result:= False;
  694.  
  695.   If SafeNub Then
  696.   Begin
  697.     TB:= IntToBox(MSX1, MSY1, MSX2, MSY2);
  698.     Result:=True;
  699.     Exit;
  700.   End;
  701.   CTS:= GetColorToleranceSpeed;
  702.   ColorToleranceSpeed(2);
  703.  
  704.   SetColorSpeed2Modifiers(IslandHue, IslandSat);
  705.   FindColorsTolerance(TPA, IslandColor, MSX1, MSY1, MSX2, MSY2, IslandTol);
  706.   ATPA:= FloodFillTPA(TPA);
  707.   SortATPASize(ATPA,True);
  708.   ColorToleranceSpeed(CTS);
  709.   SetColorSpeed2Modifiers(0.2, 0.2);
  710.  
  711.   If Debug Then
  712.     DebugATPABounds(ATPA);
  713.  
  714.   If Length(TPA) < 1 then
  715.     Exit;
  716.  
  717.  
  718.   L:= High(ATPA);
  719.   For I:= 0 To L do
  720.   Begin
  721.     TB:= GetTPABounds(ATPA[I]);
  722.     If Not (PointInBox(Point(MSCX, MSCY),TB)) then
  723.     begin
  724.       if I=L then
  725.       begin
  726.         writeln('at high, point is not inside');
  727.         exit;
  728.       end else
  729.         continue;
  730.     end else break;
  731.   end;
  732.   DebugThis(tostr(TB));
  733.   Result:=True;
  734. end;
  735.  
  736. function FindWizard: Boolean;
  737. var
  738.   a, h : Integer;
  739.   TPA  : TPointArray;
  740.   ATPA : T2DPointArray;
  741.   tmpCTS : Integer;
  742. begin
  743.   if(not(LoggedIn))then Exit;
  744.   FindNormalRandoms;
  745.  
  746.   tmpCTS := GetColorToleranceSpeed;
  747.   ColorToleranceSpeed(2);
  748.  
  749.   SetColorSpeed2Modifiers(0.05, 1.65);
  750.  
  751.   FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5357278, MSX1, MSY1, MSX2, MSY2, 18);
  752.   ATPA := TPAtoATPAEx(TPA, 20, 20);
  753.   SortATPASize(ATPA,True);
  754.  
  755.   H := High(ATPA);
  756.   DebugThis('Wizard');
  757.  
  758.   for a := 0 to H do
  759.   begin
  760.     MiddleTPAEx(atpa[a], X, Y);
  761.  
  762.     DebugThis(tostr(Length(atpa[a])));
  763.  
  764.     if((Length(atpa[a]) < 100) Or (Length(atpa[a]) > 2000))then
  765.       Continue;
  766.  
  767.     MMouse(X, Y, 5, 5);
  768.  
  769.     if(WaitUpTextMulti(['Wizard', 'zard', 'izard'], 750))then
  770.     begin
  771.       repeat
  772.         InvMouse(RandomRange(2, 8), 3);
  773.       until(WaitUpTextMulti(['rune', 'une'], RandomRange(1800, 2000)));
  774.  
  775.       ClickMouse2(False);
  776.  
  777.       if(not(WaitOptionMulti(['Use', 'Use ', 'se '],RandomRange(800, 900))))then
  778.         Exit;
  779.  
  780.       MMouse(X, Y, 5, 5);
  781.  
  782.       if(WaitUpTextMulti(['Wizard', 'zard', 'izard'], 750))then
  783.       begin
  784.         ClickMouse2(True);
  785.  
  786.         if(DidRedClick)then
  787.         begin
  788.           ColorToleranceSpeed(tmpCTS);
  789.           SetColorSpeed2Modifiers(0.2, 0.2);
  790.  
  791.           Result := True;
  792.           MarkTime(TW);
  793.           Exit;
  794.         end;
  795.       end;
  796.     end;
  797.   end;
  798.  
  799.   ColorToleranceSpeed(tmpCTS);
  800.   SetColorSpeed2Modifiers(0.2, 0.2);
  801. end;
  802.  
  803. procedure AntiBan();
  804. begin
  805.   if(not(LoggedIn))then Exit;
  806.   FindNormalRandoms;
  807.  
  808.   case (Random(1000)) of
  809.     0 : RandomRClick;
  810.     1 : HoverSkill('random', False);
  811.     2 : ExamineInv;
  812.     3 : MouseSpeed := (RandomRange(10, 12));
  813.     4 : begin HoverSkill('Runecrafting', False); Wait(RandomRange(2000, 4000)); end;
  814.     5 : begin PickUpMouse; SleepAndMoveMouse(1500 + Random(500)); end;
  815.     6 : begin GameTab(tab_Stats); Wait(1500 + Random(500)); GameTab(tab_Inv); end;
  816.     7 .. 100 : Wait(RandomRange(750, 2000));
  817.     101: begin BoredHuman; SetAngle(SRL_ANGLE_HIGH); end;
  818.   end;
  819. end;
  820.  
  821. function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor : Integer) : Boolean;
  822. var
  823.   h, m, s : Integer;
  824. begin
  825.   if not LoggedIn then Exit;
  826.  
  827.   if (HowManyPlayers = 1) then
  828.   begin
  829.     if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
  830.     else
  831.       if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
  832.       begin
  833.         RealBTime := ((x + z) / 60000);
  834.         Logout;
  835.         MarkTime(CurrentBTime);
  836.         repeat
  837.           Wait(21000);
  838.           ConvertTime((x + z) - TimeFromMark(CurrentBTime), h, m, s);
  839.           ClearDebug;
  840.         until(TimeFromMark(CurrentBTime) > (x + z));
  841.         if SwitchWorlds then
  842.           if LoginPlayerToLob then
  843.             ChangeWorld(RandomWorld(True, False))
  844.         else
  845.           LoginPlayer;
  846.         Wait(4000);
  847.         Result := LoggedIn;
  848.         ClickNorth(SRL_ANGLE_HIGH);
  849.         IncEx(BreakRounds, (w) + (x));
  850.         w := (BreakIn * 60000);
  851.         x := (BreakFor * 60000);
  852.         y := RandomRange(-Bir * 60000, Bir * 60000);
  853.         z := RandomRange(-Bfr * 60000, Bfr * 60000);
  854.       end;
  855.   end;
  856. end;
  857.  
  858. procedure Proggy;
  859. begin
  860.   ClearDebug();
  861.   Stats_Commit;
  862.   XP := (GetXPBarTotal - StartXP);
  863.   XPH:= Round(((XP) / (GetTimeRunning / 1000)) * 3600);
  864.   Writeln('======== Kyle''s Esswraith Extractor =========');
  865.   WriteLn('You are using Version ' + Version);
  866.   Writeln('Time Running: ' + TimeRunning);
  867.   Writeln('Experience Earned: ' + IntToStr(XP));
  868.   Writeln('Experience/Hour: ' + IntToStr(XPH));
  869.   Writeln('=============================================');
  870.   MarkTime(TP);
  871. end;
  872.  
  873. Procedure GetMoreEssence;
  874. var
  875.   a, h, t: Integer;
  876.   TPA  : TPointArray;
  877.   ATPA : T2DPointArray;
  878.   tmpCTS : Integer;
  879. begin
  880.   if(not(LoggedIn))then Exit;
  881.   FindNormalRandoms;
  882.   MarkTime(T);
  883.  
  884.   repeat
  885.     if(not(LoggedIn))then Exit;
  886.  
  887.     if(TimeFromMark(t) > 30000)then
  888.       SetFalse('Failed to get more essence.');
  889.  
  890.     tmpCTS := GetColorToleranceSpeed;
  891.     ColorToleranceSpeed(2);
  892.  
  893.     SetColorSpeed2Modifiers(0.47, 0.04);
  894.  
  895.     FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4013632, MSX1, MSY1, MSX2, MSY2, 15);
  896.     ATPA := TPAtoATPAEx(TPA, 20, 20);
  897.     SortATPASize(ATPA,True);
  898.  
  899.     H := High(ATPA);
  900.     DebugThis('Rocks');
  901.  
  902.     for a := 0 to H do
  903.     begin
  904.       MiddleTPAEx(atpa[a], X, Y);
  905.  
  906.       DebugThis(tostr(Length(atpa[a])));
  907.  
  908.       if((Length(atpa[a]) < 50) Or (Length(atpa[a]) > 2000))then
  909.         Continue;
  910.  
  911.       MMouse(X, Y, 5, 5);
  912.  
  913.       if(WaitUpTextMulti(['Collect', 'llect', 'Float'], 750))then
  914.       begin
  915.         ClickMouse2(True);
  916.  
  917.         if(DidRedClick)then
  918.         begin
  919.           ColorToleranceSpeed(tmpCTS);
  920.           SetColorSpeed2Modifiers(0.2, 0.2);
  921.           Exit;
  922.         end;
  923.       end else
  924.       if(not(IsUptextMultiCustom(['Walk', 'lk here', 'here'])))then
  925.       begin
  926.         Clickmouse2(False);
  927.  
  928.         if(WaitOptionMulti(['Collect', 'llect', 'Float'], 800))then
  929.         begin
  930.           ColorToleranceSpeed(tmpCTS);
  931.           SetColorSpeed2Modifiers(0.2, 0.2);
  932.           Exit;
  933.         end;
  934.       end;
  935.     end;
  936.     ColorToleranceSpeed(tmpCTS);
  937.     SetColorSpeed2Modifiers(0.2, 0.2);
  938.   until FindDTM(EssenceDTM,X,Y,MIX1,MIY1,MIX2,MIY2);
  939. end;
  940.  
  941. procedure ScriptSetup();
  942. begin
  943.   SetupObjects();
  944.   SortObjects();
  945.  
  946.   SetAngle(SRL_ANGLE_HIGH);
  947.   StartXP := GetXPBarTotal;
  948.   RCLvl := GetSkillLevel(SKILL_RUNECRAFTING);
  949.   Gametab(tab_Inv);
  950.  
  951.   Higher := False;
  952.   SafeNub:= False;
  953.  
  954.   Case Floors Of
  955.     0 : Begin SafeNub:=True; End;
  956.     1 : Begin IslandHue:=0.19; IslandSat:=0.71; IslandColor:=3112315; IslandTol:=12; End;
  957.     2 : Begin IslandHue:=3.58; IslandSat:=0.43; IslandColor:=8224087; IslandTol:=14; End;
  958.     3 : Begin IslandHue:=0.12; IslandSat:=0.73; IslandColor:=9145506; IslandTol:=12; End;
  959.   End;
  960. end;
  961.  
  962. procedure MainLoop();
  963. var
  964.   fObj : TObj;
  965.   x, y, i, InitialXP, UpdateXP, t: Integer;
  966. Label
  967.   Waiting;
  968. begin
  969.   repeat
  970.     repeat
  971.       if not loggedin then loginplayer;
  972.       FindNormalRandoms;
  973.  
  974.       if(TakeBreaks)then BreakHandler(BreakIn, BreakFor, Bir, Bfr);
  975.  
  976.       if(TimeFromMark(TW) > 600000)then
  977.         FindWizard;
  978.  
  979.       if not WaitFindDTMEX(EssenceDTM, EX, EY, MIX1, MIY1, MIX2, MIY2, 100, 2000) then
  980.         GetMoreEssence;
  981.  
  982.       if(TimeFromMark(RCt) > (3600000 + RandomRange(-1800000, 1800000)))then
  983.       begin
  984.         RCLvl := GetSkillLevel(SKILL_RUNECRAFTING);
  985.         MarkTime(RCt);
  986.       end;
  987.  
  988.       for i := 0 to High(Objects) do
  989.       begin
  990.         fObj := GetObject(i);
  991.  
  992.         if(RCLvl >= fObj.LvlReq)then
  993.         begin
  994.           if(FindObjectPlatform)then
  995.             if(K_FindObj(x, y, i))then
  996.             begin
  997.               Waiting:
  998.  
  999.               if(TimeFromMark(TP) > 60000)then
  1000.                 Proggy;
  1001.  
  1002.               Wait(RandomRange(500, 750));
  1003.               InitialXP := GetXPBarTotal;
  1004.               CurrentXP := fObj.IXP;
  1005.  
  1006.               MarkTime(T);
  1007.               repeat
  1008.                 Wait(100);
  1009.                 if(FindNormalRandoms)then
  1010.                 begin
  1011.                   if(not(LoggedIn))then
  1012.                     SetFalse('Not Logged in');
  1013.                   SetAngle(SRL_ANGLE_HIGH);
  1014.                   MakeCompass('N');
  1015.                 end;
  1016.                 if(TimeFromMark(T) > RandomRange(7000, 7200))then
  1017.                   Break;
  1018.  
  1019.                 AntiBan;
  1020.                 for i := 0 to High(Objects) do
  1021.                 begin
  1022.                   fObj := GetObject(i);
  1023.  
  1024.                   if(RCLvl >= fObj.LvlReq) And (CurrentXP < fObj.IXP)then
  1025.                     if(FindObjectPlatform)then
  1026.                       if(K_FindObj(x, y, i))then
  1027.                       begin
  1028.                         Higher := True;
  1029.                         Break;
  1030.                       end;
  1031.                 end;
  1032.  
  1033.                 if(Higher)then
  1034.                   Break;
  1035.  
  1036.                 UpdateXP := GetXPBarTotal;
  1037.  
  1038.                 if(UpdateXP > InitialXP)then
  1039.                 begin
  1040.                   InitialXP := GetXPBarTotal;
  1041.                   T := 0;
  1042.                   MarkTime(T);
  1043.                 end;
  1044.               until(False);
  1045.  
  1046.               if(Higher)then
  1047.               begin
  1048.                 Higher := False;
  1049.                 Goto Waiting;
  1050.               end;
  1051.             end;
  1052.         end;
  1053.       end;
  1054.  
  1055.       if(FindNormalRandoms)then
  1056.       begin
  1057.         if(not(LoggedIn))then
  1058.           SetFalse('Not Logged in');
  1059.         SetAngle(SRL_ANGLE_HIGH);
  1060.         MakeCompass('N');
  1061.       end;
  1062.     until(not(LoggedIn));
  1063.  
  1064.     if(Players[CurrentPlayer].Active)then
  1065.       SetFalse('Not Logged in');
  1066.  
  1067.     NextPlayer(Players[CurrentPlayer].Active);
  1068.     ScriptSetup();
  1069.   until(AllPlayersInactive);
  1070. end;
  1071.  
  1072. begin
  1073.   Smart_Server := 10;
  1074.   Smart_Members := True;
  1075.   Smart_Signed := True;
  1076.  
  1077.   SetupSRL();
  1078.   SetupSRLStats(1036, SRLStats_Username, SRLStats_Password);
  1079.  
  1080.   {* Initial Break Settings *}
  1081.   w := (BreakIn * 60000);
  1082.   x := (BreakFor * 60000);
  1083.   y := RandomRange(-Bir * 60000, Bir * 60000);
  1084.   z := RandomRange(-Bfr * 60000, Bfr * 60000);
  1085.  
  1086.   ActivateClient();
  1087.   DeclarePlayers();
  1088.   LoginPlayer();
  1089.  
  1090.   while(not(RSReady()))do
  1091.     Wait(9000);
  1092.  
  1093.   AddOnTerminate('Fr33DTM');
  1094.   SetDtm;
  1095.  
  1096.   MarkTime(TP);
  1097.   MarkTime(RCt);
  1098.  
  1099.   ScriptSetup();
  1100.  
  1101.   if(not(WaitFindDTMEX(EssenceDTM, EX, EY, MIX1, MIY1, MIX2, MIY2, 100, 2000)))then
  1102.     GetMoreEssence;
  1103.  
  1104.   MainLoop;
  1105. end.