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

Untitled

By: a guest on May 8th, 2012  |  syntax: Java  |  size: 33.12 KB  |  hits: 16  |  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. public class rena_bdkpro extends Script
  2.  
  3. {
  4.         // General walk
  5.         int step = 0;
  6.     int[] path = null;
  7.     int loop = 0;
  8.        
  9.         private void useItemOnWall(int itemID, int x, int y) {
  10.          int slot = getInventoryIndex(new int[] { itemID });
  11.          int i = e.getWallObjectIndexByCoords(x, y);
  12.          int j = e.wallObjectIdArray()[i];
  13.          int k = e.wallObjectDirArray()[i];
  14.          if (k == -1) {
  15.              System.out.println("Error identifying wall object at coords: " + x + ":" + y);
  16.              return;
  17.          }
  18.          int m = x - e.getTileX();
  19.          int n = y - e.getTileY();
  20.          e.b(m, n, 56, k);
  21.          e.hh.a(161, (byte)93);
  22.          e.hh.c.a(x, (byte)54);
  23.          e.hh.c.a(y, (byte)77);
  24.          e.hh.c.c(9, k);
  25.          e.hh.c.a(slot, (byte)-59);
  26.          e.hh.c(0);
  27.         }
  28.        
  29.     int[] npcID = new int[]
  30.     {
  31.         // All monsters in Dungeon Possibily Blocking our path
  32.                 22, 190, 271, 295, 66, 108, 189
  33.     };
  34.        
  35.     // Collect d bones, dstone, 2 half keys, dmed
  36.     int[] CollectIDs = {814,795,523,526,527};
  37.        
  38.     int fightMode = 0;
  39.         // Loot reporting
  40.         int dbones =0;
  41.         int dstone =0;
  42.     int halfloop =0;
  43.         int halftooth =0;
  44.         int dmed =0;
  45.        
  46.  
  47.         // Items + Trips reporting
  48.         int trips =0;
  49.  
  50.         int nooffood =0;
  51.         int noofpray =0;
  52.         int noofsap =0;
  53.         int noofssp =0;
  54.        
  55.         // Path handling
  56.     boolean bankingnow;
  57.         boolean walkingaltarnow;
  58.         boolean walkingdragonsnow;
  59.         boolean fightingnow;
  60.        
  61.         // Param Options handling
  62.         int aaa =0;
  63.         int bbb =0;
  64.         int ccc =0;
  65.         int ddd =0;
  66.         int eee =0;
  67.         int fff =0;
  68.         int ggg =0;
  69.         int hhh =0;
  70.         int iii =0;
  71.         int jjj =0;
  72.         int kkk =0;
  73.         int lll =0;
  74.         int mmm =0;
  75.         int nnn =0;
  76.         int ooo =0;
  77.         int ppp =0;
  78.         // Boolean Param options
  79.         boolean pray = false;
  80.         boolean attack = false;
  81.         boolean str = false;
  82.         boolean sleep = true;
  83.         boolean usingdmed = false;
  84.         int minmed =0;
  85.        
  86.         //Dungeon Walk
  87.         boolean walk1 = false;
  88.         boolean walk2 = false;
  89.         boolean walk3 = false;
  90.         boolean walk4 = false;
  91.         boolean walk5 = false;
  92.         boolean walk6 = false;
  93.         boolean walk7 = false;
  94.         boolean walk8 = false;
  95.         boolean walk9 = false;
  96.         boolean walk10 = false;
  97.         boolean walk11 = false;
  98.         boolean walk12 = false;
  99.         boolean walk13 = false;
  100.         boolean walk14 = false;
  101.         boolean walk15 = false;
  102.         boolean walk16 = false;
  103.         boolean walk17 = false;
  104.         boolean walk18 = false;
  105.         boolean walk19 = false;
  106.         boolean walk20 = false;
  107.         boolean walk21 = false;
  108.         boolean walk22 = false;
  109.         boolean walk23 = false;
  110.         boolean walk24 = false;
  111.        
  112.        
  113.     private Extension e;
  114.  
  115.     public rena_bdkpro(Extension e) {
  116.          super(e);
  117.          this.e = e;
  118.      }
  119.  
  120.      public void init(String params)
  121.         {
  122.                        
  123.             System.out.println(" ");
  124.                 System.out.println("[================== !~ RENAFOX'S SCRIPTS ~! ===================]");
  125.                 System.out.println("[==============================================================]");
  126.                         System.out.println("[=== !~ Thanks for purchasing this script                ~! ===]");
  127.                         System.out.println("[=== !~ Started Blue Dragon Killer Pro By Renafox        ~! ===]");
  128.                 System.out.println("[=== !~ Version 1.0                                     ~! ===]");
  129.                         System.out.println(" ");
  130.                         System.out.println("[==================== !~ INSCTRUCTIONS ~! ======================]");
  131.                         System.out.println("[=== !~ rena_bdkpro <a>,<b>,<c>,<d>,<e>,<f>,<g>....<o>    ~! ===]");
  132.                         System.out.println("[=== !~                                                   ~! ===]");
  133.                         System.out.println("[---------------- !~ Param inputs available ~! -----------------]");
  134.                         System.out.println("[=== !~                                                   ~! ===]");
  135.                         System.out.println("[=== !~ <a> = Fightmode (0=contrl, 1=str, 2=acc, 3=def)   ~! ===]");
  136.                         System.out.println("[--------------------- !~ Food options ~! ----------------------]");
  137.                         System.out.println("[=== !~ <b> = Food id   (cakes not supported)             ~! ===]");
  138.                         System.out.println("[=== !~ <c> = No. of food withdrawn from bank             ~! ===]");
  139.                         System.out.println("[=== !~ <d> = Hp to eat at                                ~! ===]");
  140.                         System.out.println("[--------------- !~ Prayer potions Options ~! ------------------]");
  141.                         System.out.println("[=== !~ <e> = Use prayer? (0=no, 1=yes)(Use Para Monster) ~! ===]");
  142.                         System.out.println("[=== !~ <f> = No. of prayer pots withdrawn from bank      ~! ===]");
  143.                         System.out.println("[=== !~ <g> = Prayer lvl to drink dose of ppot at         ~! ===]");
  144.                         System.out.println("[--------------- !~ Attack potions Options ~! ------------------]");
  145.                         System.out.println("[=== !~ <h> = Use Super attack potions? (0=no, 1=yes)     ~! ===]");
  146.                         System.out.println("[=== !~ <i> = No. of SAPs pots withdrawn from bank        ~! ===]");
  147.                         System.out.println("[=== !~ <j> = Attack lvl to drink dose of ppot at         ~! ===]");
  148.                         System.out.println("[--------------- !~ Strength potions Options ~! ----------------]");
  149.                         System.out.println("[=== !~ <k> = Use Super Strength potions? (0=no, 1=yes)   ~! ===]");
  150.                         System.out.println("[=== !~ <l> = No. of SSP pots withdrawn from bank         ~! ===]");
  151.                         System.out.println("[=== !~ <m> = Strength lvl to drink dose of ppot at       ~! ===]");
  152.                         System.out.println("[---------------------- !~ Sleeping? ~! ------------------------]");
  153.                         System.out.println("[=== !~ <n> = Use sleeping bag? (0=no, 1=yes)             ~! ===]");
  154.                         System.out.println("[=== !~ <o> = Wearing Dmed?     (0=no, 1=yes)             ~! ===]");
  155.                         System.out.println("[=== !~ <p> = Your Actual Prayer level                    ~! ===]");
  156.                         System.out.println("[===============================================================]");
  157.                         System.out.println(" ");
  158.                         System.out.println("[=== !~ Note that the scripts end trips when prayer = 0   ~! ===]");
  159.                         System.out.println("[=== !~ Followed by when hp lower than <d> & out of <b>   ~! ===]");
  160.                         System.out.println("[=== !~ Or lastly, when inventory is full...              ~! ===]");
  161.                         System.out.println("[===============================================================]");
  162.                        
  163.                 String[] pa = params.trim().split(",");        
  164.         this.aaa = Integer.parseInt(pa[0]);            
  165.                 this.bbb = Integer.parseInt(pa[1]);
  166.         this.ccc = Integer.parseInt(pa[2]);
  167.                 this.ddd = Integer.parseInt(pa[3]);
  168.                 this.eee = Integer.parseInt(pa[4]);
  169.                 this.fff = Integer.parseInt(pa[5]);
  170.                 this.ggg = Integer.parseInt(pa[6]);
  171.                 this.hhh = Integer.parseInt(pa[7]);
  172.                 this.jjj = Integer.parseInt(pa[8]);
  173.                 this.jjj = Integer.parseInt(pa[9]);
  174.                 this.kkk = Integer.parseInt(pa[10]);
  175.                 this.lll = Integer.parseInt(pa[11]);
  176.                 this.mmm = Integer.parseInt(pa[12]);
  177.                 this.nnn = Integer.parseInt(pa[13]);
  178.                 this.ooo = Integer.parseInt(pa[14]);
  179.                 this.ppp = Integer.parseInt(pa[15]);
  180.                
  181.                 // Params eee , hhh , kkk , nnn Are Booleans
  182.  
  183.                 if(eee == 1)
  184.                 {
  185.                     pray = true;
  186.                 }
  187.                 if(eee == 0)
  188.                 {
  189.                     pray = false;
  190.                 }
  191.                 if(hhh == 1)
  192.                 {
  193.                     attack = true;
  194.                 }
  195.                 if(hhh == 0)
  196.                 {
  197.                     attack = false;
  198.                 }
  199.                 if(kkk == 1)
  200.                 {
  201.                     str = true;
  202.                 }
  203.                 if(kkk == 0)
  204.                 {
  205.                     str = false;
  206.                 }
  207.                 if(nnn == 1)
  208.                 {
  209.                     sleep = true;
  210.                 }
  211.                 if(nnn == 0)
  212.                 {
  213.                     sleep = false;
  214.                 }
  215.                 if(ooo == 1)
  216.                 {
  217.                     usingdmed = true;
  218.                 }
  219.                 if(ooo == 0)
  220.                 {
  221.                     usingdmed = false;
  222.                 }
  223.                
  224.                 System.out.println("[===============================================================]");
  225.                 System.out.println("[Rena] Started Blue Dragon Killer Pro by Renafox");
  226.                 System.out.println("[---------------------------------------------------------------]");
  227.                 System.out.println("[Rena] Fighting with fightmode: "+aaa+" !");
  228.                 System.out.println("[--------------------- !~ Food options ~! ----------------------]");
  229.                 System.out.println("[Rena] Eating food id: "+bbb+" !");
  230.                 System.out.println("[Rena] Withdrawing "+ccc+" no of food from bank!");
  231.                 System.out.println("[Rena] Eating food at hp level: "+ddd+" !");
  232.                 System.out.println("[--------------- !~ Prayer potions Options ~! ------------------]");
  233.                 if(!pray)
  234.                 {
  235.                     System.out.println("[Rena] We are NOT USING prayer !");
  236.                 }
  237.                 if(pray)
  238.                 {
  239.                     System.out.println("[Rena] We are USING prayer !");
  240.                 }
  241.                 System.out.println("[Rena] Withdrawing "+fff+" no of Pray Pots from bank !");
  242.                 System.out.println("[Rena] Drink dose of Pray Pot at level: "+ggg+" !");
  243.                 System.out.println("[--------------- !~ Attack potions Options ~! ------------------]");
  244.                 if(!attack)
  245.                 {
  246.                 System.out.println("[Rena] We are NOT USING Super Attack potions !");
  247.                 }
  248.                 if(attack)
  249.                 {
  250.                 System.out.println("[Rena] We are USING Super Attack potions !");
  251.                 }
  252.                 System.out.println("[Rena] Withdrawing "+iii+" no of Super Atk Pot from bank!");
  253.                 System.out.println("[Rena] Drink dose of Super Atk pot at level: "+jjj+" !");
  254.                 System.out.println("[--------------- !~ Strength potions Options ~! ----------------]");
  255.                 if(!str)
  256.                 {
  257.                 System.out.println("[Rena] We are NOT USING Super Strength potions !");
  258.                 }
  259.                 if(str)
  260.                 {
  261.                 System.out.println("[Rena] We are USING Super Strength potions !");
  262.                 }
  263.                 System.out.println("[Rena] Withdrawing "+lll+" no of Super Str Pot from bank!");
  264.                 System.out.println("[Rena] Drink dose of Super Str Pot at level: "+mmm+" !");
  265.                 System.out.println("[---------------------- !~ Sleeping? ~! ------------------------]");
  266.                 if(!sleep)
  267.                 {
  268.                 System.out.println("[Rena] We ARE NOT Sleeping !");
  269.                 }
  270.                 if(sleep)
  271.                 {
  272.                 System.out.println("[Rena] We ARE Sleeping !");
  273.                 }
  274.                 if(!usingdmed)
  275.                 {
  276.                 minmed =0;
  277.                 System.out.println("[Rena] We ARE NOT wearing dmed !");
  278.                 }
  279.                 if(usingdmed)
  280.                 {
  281.                 minmed =1;
  282.                 System.out.println("[Rena] We ARE wearing dmed !");
  283.                 }
  284.                 System.out.println("[Rena] Your actual prayer level is : "+ppp+" !");
  285.                 System.out.println("[===============================================================]");
  286.                                
  287.         bankingnow = true;
  288.         walkingaltarnow = false;
  289.         walkingdragonsnow = false;
  290.         fightingnow = false;
  291.        
  292.        
  293.     }    
  294.  
  295.     public int main()
  296.  
  297.     {
  298.         if(getFightMode() != aaa)
  299.  
  300.             setFightMode(aaa);
  301.  
  302.  
  303.  
  304.         if(getFatigue() > 55)
  305.  
  306.         {
  307.  
  308.             useSleepingBag();
  309.  
  310.             return 2000;
  311.  
  312.         }
  313.                
  314.                
  315.                
  316.                 if(bankingnow && !walkingaltarnow && !walkingdragonsnow && !fightingnow)
  317.                 {
  318.  
  319.             if(isBanking())
  320.  
  321.             {
  322.                             // Deposit loot
  323.                                 if(getInventoryCount(465) > 0)
  324.                 {            
  325.                     deposit(465, getInventoryCount(465));                                      
  326.                     return random(900,1000);
  327.                 }
  328.                 if(getInventoryCount(814) > 0)
  329.                 {            
  330.                                 dbones  += getInventoryCount(814);
  331.                     deposit(814, getInventoryCount(814));                                      
  332.                     return random(1000,900);
  333.                 }
  334.                             if(getInventoryCount(523) > 0)
  335.                 {            
  336.                                 dstone  += getInventoryCount(523);
  337.                     deposit(523, getInventoryCount(523));                                      
  338.                     return random(1000,900);
  339.                 }
  340.                                 if(getInventoryCount(527) > 0)
  341.                 {            
  342.                                 halfloop  += getInventoryCount(527);
  343.                     deposit(527, getInventoryCount(527));                                      
  344.                     return random(1000,900);
  345.                 }
  346.                                 if(getInventoryCount(526) > 0)
  347.                 {            
  348.                                 halftooth  += getInventoryCount(526);
  349.                     deposit(526, getInventoryCount(526));                                      
  350.                     return random(1000,900);
  351.                 }
  352.                                 if(getInventoryCount(795) > minmed)
  353.                 {            
  354.                                 dmed  += getInventoryCount(795)-minmed;
  355.                     deposit(795, getInventoryCount(795)-minmed);                                       
  356.                     return random(1000,900);
  357.                 }
  358.                                 // Take items needed
  359.                         if(getInventoryCount(42) > 1) //lawrune
  360.                         {                
  361.                      deposit(42,getInventoryCount(42)-1);
  362.                      return random(1900, 2000);            
  363.                 }
  364.                 else if(getInventoryCount(42) < 1)
  365.                 {                
  366.                      withdraw(42,1);
  367.                      return random(1900, 2000);            
  368.                 }
  369.                         if(getInventoryCount(33) > 3) //airrune
  370.                         {                
  371.                      deposit(33,getInventoryCount(33)-3);
  372.                      return random(1900, 2000);            
  373.                 }
  374.                 else if(getInventoryCount(33) < 3)
  375.                 {                
  376.                      withdraw(33,3-getInventoryCount(33));
  377.                      return random(1900, 2000);            
  378.                 }
  379.                         if(getInventoryCount(32) > 1) //waterrune
  380.                         {                
  381.                      deposit(32,getInventoryCount(32)-1);
  382.                      return random(1900, 2000);            
  383.                 }
  384.                 else if(getInventoryCount(32) < 1)
  385.                 {                
  386.                      withdraw(32,1);
  387.                      return random(1900, 2000);            
  388.                 }
  389.                                 if(getInventoryCount(bbb) > ccc) //Food
  390.                         {                
  391.                      deposit(bbb,getInventoryCount(bbb)-ccc);
  392.                      return random(1900, 2000);            
  393.                 }
  394.                 else if(getInventoryCount(bbb) < ccc)
  395.                 {                
  396.                      withdraw(bbb,ccc);
  397.                      return random(1900, 2000);            
  398.                 }
  399.                                 if(pray)
  400.                                 {
  401.                                     if(getInventoryCount(485) > 0) //Prayer pots
  402.                             {                
  403.                          deposit(485,getInventoryCount(485));
  404.                          return random(1900, 2000);            
  405.                     }
  406.                                         if(getInventoryCount(484) > 0) //Prayer pots
  407.                             {                
  408.                          deposit(484,getInventoryCount(484));
  409.                          return random(1900, 2000);            
  410.                     }
  411.                                     if(getInventoryCount(483) > fff)
  412.                             {                
  413.                          deposit(483,getInventoryCount(483)-fff);
  414.                          return random(2200, 3000);            
  415.                     }
  416.                     else if(getInventoryCount(483) < fff)
  417.                     {                
  418.                          withdraw(483,fff);
  419.                          return random(2200, 2500);            
  420.                     }
  421.                                 }
  422.                                 if(attack)
  423.                                 {
  424.                                     if(getInventoryCount(488) > 0) //Super attack pots
  425.                             {                
  426.                          deposit(488,getInventoryCount(488));
  427.                          return random(1900, 2000);            
  428.                     }
  429.                                         if(getInventoryCount(487) > 0)
  430.                             {                
  431.                          deposit(487,getInventoryCount(487));
  432.                          return random(1900, 2000);            
  433.                     }
  434.                                     if(getInventoryCount(486) > iii)
  435.                             {                
  436.                          deposit(486,getInventoryCount(486)-iii);
  437.                          return random(2200, 2500);            
  438.                     }
  439.                     else if(getInventoryCount(486) < iii)
  440.                     {                
  441.                          withdraw(486,iii);
  442.                          return random(2200, 2500);          
  443.                     }
  444.                                 }
  445.                                 if(str)
  446.                                 {
  447.                                     if(getInventoryCount(493) > 0) //Super str pots
  448.                             {                
  449.                          deposit(493,getInventoryCount(493));
  450.                          return random(1900, 2000);            
  451.                     }
  452.                                         if(getInventoryCount(494) > 0)
  453.                             {                
  454.                          deposit(494,getInventoryCount(494));
  455.                          return random(1900, 2000);            
  456.                     }
  457.                                     if(getInventoryCount(492) > lll)
  458.                             {                
  459.                          deposit(492,getInventoryCount(492)-lll);
  460.                          return random(2000, 2500);            
  461.                     }
  462.                     else if(getInventoryCount(492) < lll)
  463.                     {                
  464.                          withdraw(492,lll);
  465.                          return random(2000, 2500);            
  466.                     }
  467.                                 }
  468.                        
  469.                             bankingnow = false;
  470.                     walkingaltarnow = true;
  471.                                 walkingdragonsnow = false;
  472.                     fightingnow = false;
  473.                                
  474.                                 trips++;
  475.                                
  476.                                 if(getInventoryCount(bbb) > 0)
  477.                 {            
  478.                                 nooffood  += getInventoryCount(bbb);
  479.                 }
  480.                                 if(getInventoryCount(483) > 0)
  481.                 {            
  482.                                 noofpray  += getInventoryCount(483);
  483.                 }
  484.                                 if(getInventoryCount(486) > 0)
  485.                 {            
  486.                                 noofsap  += getInventoryCount(486);
  487.                 }
  488.                                 if(getInventoryCount(492) > 0)
  489.                 {            
  490.                                 noofssp  += getInventoryCount(492);
  491.                 }
  492.                 closeBank();
  493.                         System.out.println("=============== ~Status Reporting~ =================");    
  494.                                 System.out.println("Did "+trips+" trips so far!");
  495.                                 System.out.println("----------------------------------------------------");
  496.                         System.out.println("==================== ~Loots~  ======================");
  497.                         System.out.println("Obtained "+dbones+" dragon bones so far!");
  498.                         System.out.println("Obtained "+dstone+" dragonstones so far!");
  499.                         System.out.println("Obtained "+halfloop+" half loop keys so far!");
  500.                         System.out.println("Obtained "+halftooth+" half tooth keys so far!");
  501.                                 System.out.println("Obtained "+dmed+" dragon medium helmets so far!");
  502.                         System.out.println("----------------------------------------------------");
  503.                         System.out.println("===================== ~ROCKS~ ======================");
  504.                         System.out.println("Used "+nooffood+" of Food so far!");
  505.                                 System.out.println("Used "+noofpray+" of Prayer Potions so far!");
  506.                                 System.out.println("Used "+noofsap+" of Super Attack Potions so far!");
  507.                                 System.out.println("Used "+noofssp+" of Super Strength Potions so far!");
  508.                         System.out.println("----------------------------------------------------");
  509.                         System.out.println("====================================================");    
  510.                                 System.out.println(" ");
  511.                                 System.out.println("[Rena] Switching to Walking to Altar ... !");
  512.                                
  513.                 return random(2000,2500);
  514.  
  515.             }
  516.             // menu open
  517.             if(isQuestMenu())
  518.             {
  519.                 answer(0);
  520.                 return random(8000, 10000);
  521.             }
  522.             if(distanceTo(329,552) < 5) {
  523.  
  524.                 int banker[] = getNpcByIdNotTalk(95);
  525.  
  526.                 if(banker[0] != -1)
  527.  
  528.                     talkToNpc(banker[0]);
  529.  
  530.                 return 6000;
  531.  
  532.             }
  533.                        
  534.                         if(getY()<549)
  535.                         {
  536.                             walkTo(315,548);
  537.                                 return random(500, 800);
  538.             }  
  539.                         if(getY()>=548 && getX()<328)
  540.                         {
  541.                             walkTo(329,552);
  542.                                 return random(700, 800);
  543.             }
  544.                        
  545.                         walkTo(329,552);
  546.  
  547.             return 2000;
  548.                 }
  549.                 // Walking to Altar
  550.         if(!bankingnow && walkingaltarnow && !walkingdragonsnow && !fightingnow)
  551.                 {
  552.                
  553.             if(isAtApproxCoords(334,554,5))
  554.                         {
  555.                             walkTo(328,552);
  556.                                 return random(1500, 1750);
  557.             }
  558.                        
  559.                         if(getX() == 328 && getY() == 552)
  560.                         {
  561.                        
  562.                                 walkTo(326,552);
  563.                 return random(2000,3000);
  564.  
  565.             }
  566.             if(getY()>538&&getY()<=558)
  567.                         {
  568.  
  569.                 walkTo(316,538);
  570.                 return random(1500,2500);
  571.  
  572.             }
  573.                         if(getY()>520&&getY()<=538)
  574.                         {
  575.  
  576.                 walkTo(315,520);
  577.                 return random(2000,2500);
  578.  
  579.             }
  580.                         if(getY()>505&&getY()<=520&&getX()<=341)
  581.                         {
  582.  
  583.                 walkTo(330,505);
  584.                 return random(2000,2500);
  585.  
  586.             }
  587.                         if(getY()>487&&getY()<=505&&getX()<341)
  588.                         {
  589.  
  590.                 walkTo(341,487);
  591.                 return random(2000,2500);
  592.  
  593.             }
  594.                        
  595.                         if(getX() == 341 && getY() == 487)
  596.                         {
  597.                 int[] gate = getObjectById(137);
  598.  
  599.                 if(gate[0]!=-1){
  600.  
  601.                     atObject(gate[1],gate[2]);
  602.  
  603.                    return random(3500,4000);
  604.                                 }
  605.  
  606.             }
  607.                        
  608.                        
  609.                         if(getY()>474&&getY()<=488&&getX()>=342)
  610.                         {
  611.  
  612.                 walkTo(354,474);
  613.                 return random(2000,2500);
  614.  
  615.             }
  616.                         if(getY()>464&&getY()<=474)
  617.                         {
  618.  
  619.                 walkTo(362,464);
  620.                 return random(2000,2500);
  621.             }
  622.                         if(isAtApproxCoords(362,464, 2))
  623.                         {
  624.                                 if(getCurrentLevel(5) < ppp )
  625.                                 {
  626.                                    int[] altar = getObjectById(235); //recharge pray
  627.                    if(altar[0] != -1)
  628.                    {
  629.                        atObject(altar[1], altar[2]);
  630.                       return random(2500, 3500);
  631.                                    }
  632.                                    return 1500;
  633.                     }
  634.                                 if(getCurrentLevel(5) == ppp)
  635.                                 {
  636.                                     System.out.println("[Rena] Prayer Recharged!");
  637.                                     bankingnow = false;
  638.                         walkingaltarnow = false;
  639.                                     walkingdragonsnow = true;
  640.                         fightingnow = false;
  641.                                        
  642.                         System.out.println("[Rena] Switching to Walking to Dragons ... !");
  643.                                     return 1000;
  644.                     }
  645.                         }
  646.                 }
  647.                        
  648.                 if(!bankingnow && !walkingaltarnow && walkingdragonsnow && !fightingnow)
  649.                 {
  650.                    
  651.                     // On surface
  652.                     if(getY()<1500)
  653.                         {
  654.                         System.out.println("[Rena] On surface!");
  655.                         System.out.println(" ");
  656.                        
  657.                             if(getY()>=464&&getY()<478)
  658.                             {
  659.  
  660.                     walkTo(365,478);
  661.                     return random(1500,2500);
  662.  
  663.                 }
  664.                                 if(getY()>=478&&getY()<499)
  665.                             {
  666.  
  667.                     walkTo(365,499);
  668.                     return random(1500,2500);
  669.  
  670.                 }
  671.                                 if(getY()>=499&&getY()<521)
  672.                             {
  673.  
  674.                     walkTo(372,521);
  675.                     return random(1500,2500);
  676.  
  677.                 }
  678.                                 if(isAtApproxCoords(376,520,4))
  679.                                 {
  680.                                     int[] ladder = getObjectById(6); //ladder
  681.                     if(ladder[0] != -1)
  682.                     {
  683.                        atObject(ladder[1], ladder[2]);
  684.                        return random(1400, 1500);
  685.                                     }
  686.                                         return 1000;
  687.                                 }
  688.                         }
  689.                         // In dungeon
  690.                     if(getY()>1499)
  691.                         {
  692.                         System.out.println("[Rena] In dungeon!");
  693.                         System.out.println(" ");
  694.                             //Detect if falador
  695.                             if(isAtApproxCoords(312,552,2))
  696.                         {
  697.                     bankingnow = true;
  698.                         walkingaltarnow = false;
  699.                         walkingdragonsnow = false;
  700.                                         fightingnow=false;
  701.                         System.out.println("[Rena] Switching to banking ... !");
  702.                         }
  703.                                
  704.                                 //Eat food
  705.                             if(getCurrentLevel(3) <= ddd )
  706.                             {
  707.                                         if(getInventoryCount(bbb) == 0) // Ends trip if no food or see below
  708.                                     {
  709.                         System.out.println("[Rena] Out of food and injured !");
  710.                                                 System.out.println("[Rena] Banking for supplies !");
  711.                         castOnSelf(18);
  712.                         return 750;
  713.  
  714.                     }
  715.                                         if(getInventoryCount(bbb) > 0) // Eat food if have
  716.                                     {
  717.                         if(inCombat())
  718.                                         {
  719.                                             walkTo(getX(), getY());
  720.                                     }
  721.                                     useItem(getInventoryIndex(bbb));
  722.                                             System.out.println("[Rena] HP below: "+bbb+" , eating food !");
  723.                         return random(1900, 2200);
  724.                     }
  725.                                 }
  726.                                 //Damn, remember to index 1 more layer down at the end of script
  727.                                 //If healthly, proceed
  728.                                 if(getCurrentLevel(3) > ddd )
  729.                             {
  730.                                
  731.                                 if(inCombat())
  732.                                 {
  733.                                     walkTo(getX(), getY());
  734.                             }
  735.                                
  736.                                
  737.                                 //At start of dung
  738.                             if(isAtApproxCoords(376,3355,2))
  739.                                 {
  740.                                         step = 0;
  741.                                         path = new int[] {376,3338,376,3324,361,3320,348,3322,349,3337,343,3351,330,3363,330,3373,338,3371,341,3363,342,3369,343,3377,350,3375,348,3363,354,3353};
  742.                                         System.out.println("[Rena] Beginning long walk .. !");
  743.                                 }
  744.                                
  745.                             if(isAtApproxCoords(356,3353,1))
  746.                             {
  747.                                 bankingnow = false;
  748.                                         walkingaltarnow = false;
  749.                                         walkingdragonsnow = false;
  750.                                         fightingnow = true;
  751.                                         System.out.println("[Rena] Switch To fighting dragons.. !");
  752.                             }
  753.                                 if(getX()== 354 && getY()== 3353 )
  754.                             {
  755.                                        
  756.                                         int[] door = getWallObjectById(84); //Open door
  757.                                         if(door[0] != -1)
  758.                                         {
  759.                                                 useItemOnWall(596,door[1],door[2]);
  760.                                                 return random(1500, 1600);
  761.                                         }
  762.                                         System.out.println("[Rena] Opening the door ... !");
  763.                                 }
  764.                                
  765.                                 }
  766.                                
  767.                         }                  
  768.                 }
  769.                        
  770.                        
  771.                        
  772.                        
  773.                        
  774.                        
  775.                        
  776.                        
  777.                        
  778.                        
  779.                        
  780.                        
  781.                        
  782.                        
  783.                 if(!bankingnow && !walkingaltarnow && !walkingdragonsnow && fightingnow)
  784.                 {
  785.                        
  786.                         if(isAtApproxCoords(312,552,2))
  787.                     {
  788.                 bankingnow = true;
  789.                     walkingaltarnow = false;
  790.                                 walkingdragonsnow = false;
  791.                     fightingnow = false;
  792.                     System.out.println("[Rena] Switching to banking...");
  793.                 }
  794.                     if(getCurrentLevel(3) <= ddd )
  795.                         {
  796.                                 //The running
  797.                                 if(getHpPercent() < 30 )
  798.                                 {
  799.                                         System.out.println("[Rena] HP at Dangerous Levels Somehow... Escaping!");
  800.                                         System.out.println("[Rena] Time to go Home! (Fally)");  
  801.                                         System.out.println(" ");
  802.                                         castOnSelf(18);
  803.                                         bankingnow = true;
  804.                         walkingaltarnow = false;
  805.                                         walkingdragonsnow = false;
  806.                         fightingnow = false;
  807.                                         step = 0;
  808.                                         loop = 0;
  809.                                         path = null;
  810.                     return 2000;
  811.                 }
  812.                             if(getInventoryCount(bbb) == 0) // ends trip if no food or see below
  813.                                 {
  814.  
  815.                     System.out.println("[Rena] All out of food (ID: "+bbb+")!");
  816.                                         System.out.println("[Rena] Time to go Home! (Fally)");
  817.                                         System.out.println(" ");
  818.                                         castOnSelf(18);
  819.                                         bankingnow = true;
  820.                         walkingaltarnow = false;
  821.                                         walkingdragonsnow = false;
  822.                         fightingnow = false;
  823.                                         step = 0;
  824.                                         loop = 0;
  825.                                         path = null;
  826.                     return 2000;
  827.                 }
  828.                            
  829.                                 //Eating
  830.                 if(getInventoryCount(bbb) > 0) {
  831.                         if(inCombat()) {
  832.                                 walkTo(getX(), getY());
  833.                         }
  834.                         useItem(getInventoryIndex(bbb));
  835.                         System.out.println("[Rena] HP below "+ddd+" , eating food (ID: "+bbb+")!");
  836.                         System.out.println(" ");
  837.                         return random(2600, 2800);
  838.                 }
  839.             }
  840.                         // Drink Super Attack
  841.                         if(attack && getInventoryCount(486) > 0 || getInventoryCount(487) > 0 || getInventoryCount(488) > 0&& getCurrentLevel(0) <= jjj )
  842.                         {
  843.                                 if(inCombat())
  844.                                 {
  845.                                        walkTo(getX(), getY());
  846.                                 }
  847.                                 if(getInventoryCount(488) >0)
  848.                                 {
  849.                                         useItem(getInventoryIndex(488));
  850.                                         System.out.println("[Rena] Attack Level at/below "+jjj+" , drinking SAP!");
  851.                                         System.out.println(" ");
  852.                                         return random(3400, 3800);
  853.                                 }
  854.                                 if(getInventoryCount(487) >0)
  855.                                 {
  856.                                         useItem(getInventoryIndex(487));
  857.                                         System.out.println("[Rena] Attack Level at/below "+jjj+" , drinking SAP!");
  858.                                         System.out.println(" ");
  859.                                         return random(3400, 3800);
  860.                                 }
  861.                                 if(getInventoryCount(486) >0)
  862.                                 {
  863.                                         useItem(getInventoryIndex(486));
  864.                                         System.out.println("[Rena] Attack Level at/below "+jjj+" , drinking SAP!");
  865.                                         System.out.println(" ");
  866.                                         return random(3400, 3800);
  867.                                 }
  868.                                 return random(2600, 2800);
  869.                         }
  870.                         // Drink Super Str
  871.                         if(str && getInventoryCount(494) > 0 || getInventoryCount(493) > 0 || getInventoryCount(492) > 0 && getCurrentLevel(2) <= mmm )
  872.                         {
  873.                                 if(inCombat())
  874.                                 {
  875.                                        walkTo(getX(), getY());
  876.                                 }
  877.                                 if(getInventoryCount(494) >0)
  878.                                 {
  879.                                         useItem(getInventoryIndex(494));
  880.                                         System.out.println("[Rena] Str Level at/below "+mmm+" , drinking SSP!");
  881.                                         System.out.println(" ");
  882.                                         return random(3400, 3800);
  883.                                 }
  884.                                 if(getInventoryCount(493) >0)
  885.                                 {
  886.                                         useItem(getInventoryIndex(493));
  887.                                         System.out.println("[Rena] Str Level at/below "+mmm+" , drinking SSP!");
  888.                                         System.out.println(" ");
  889.                                         return random(3400, 3800);
  890.                                 }
  891.                                 if(getInventoryCount(492) >0)
  892.                                 {
  893.                                         useItem(getInventoryIndex(492));
  894.                                         System.out.println("[Rena] Str Level at/below "+mmm+" , drinking SSP!");
  895.                                         System.out.println(" ");
  896.                                         return random(3400, 3800);
  897.                                 }
  898.                                 return random(2600, 2800);
  899.                         }
  900.                         if(getInventoryCount(465) > 0)  // Drop vials (empty)
  901.                         {
  902.                                 if(inCombat())
  903.                                 {
  904.                                                 walkTo(getX(), getY());
  905.                                 }
  906.                                 dropItem(getInventoryIndex(465));
  907.                                 System.out.println("[Rena] Dropping those empty vials!");
  908.                                 System.out.println(" ");
  909.                                 return random(1900, 2200);
  910.                         }
  911.                         if(getInventoryCount() ==30)
  912.                         {
  913.                                 if(getInventoryCount(bbb) > 0)  // Eats food to make space for drops when you still have food
  914.                                 {
  915.                                         if(inCombat())
  916.                                         {
  917.                                                 walkTo(getX(), getY());
  918.                                         }
  919.                                         useItem(getInventoryIndex(bbb));
  920.                                         System.out.println("[Rena] Inventory full and still packed with food...");      
  921.                                         System.out.println("[Rena] Eating food to make space...");
  922.                                         System.out.println(" ");
  923.                                         return random(2600,2800);
  924.                                 }
  925.                                 if(getInventoryCount(bbb) == 0)  // Full inventory but no food? Trip finished!
  926.                                 {
  927.                                         bankingnow = true;
  928.                         walkingaltarnow = false;
  929.                                         walkingdragonsnow = false;
  930.                         fightingnow = false;
  931.                                         System.out.println("[Rena] All out of food (ID: "+bbb+")!");
  932.                                         System.out.println("[Rena] Trip finished successfully with Max Efficiency!");  
  933.                                         System.out.println("[Rena] Time to go Home! (Fally)");  
  934.                                         System.out.println(" ");
  935.                                         castOnSelf(18);
  936.                                         return random(2600, 2800);
  937.                                 }
  938.             }
  939.                         int[] aa = getItemById(814);
  940.             if(aa[0]!=-1)
  941.                         {
  942.                                 if(inCombat())
  943.                                 {
  944.                                        walkTo(getX(), getY());
  945.                                 }
  946.                                 walkTo(aa[1], aa[2]);
  947.                 pickupItem(814, aa[1], aa[2]);
  948.                                 System.out.println("[Rena] Picking up dragon bones at "+aa[1]+","+aa[2]+" ...");
  949.                                 System.out.println(" ");
  950.                 return random(1200,1300);
  951.                                        
  952.                         }
  953. if(getInventoryCount(814) > 0) {
  954.                                 useItem(getInventoryIndex(814));
  955.                                 return 1000;
  956.                         }
  957.                         int[] bb = getItemById(795);
  958.             if(bb[0]!=-1)
  959.                         {
  960.                                 if(inCombat())
  961.                                 {
  962.                                        walkTo(getX(), getY());
  963.                                 }
  964.                                 walkTo(bb[1], bb[2]);
  965.                 pickupItem(795, bb[1], bb[2]);
  966.                                 System.out.println("[Rena] Picking up dragon medium helmet at "+bb[1]+","+bb[2]+" ...");
  967.                                 System.out.println(" ");
  968.                 return random(1200,1300);
  969.                                        
  970.                         }
  971.                        
  972.                         int[] cc = getItemById(523);
  973.             if(cc[0]!=-1)
  974.                         {      
  975.                                 if(inCombat())
  976.                                 {
  977.                                        walkTo(getX(), getY());
  978.                                 }
  979.                                 walkTo(cc[1], cc[2]);
  980.                 pickupItem(523, cc[1], cc[2]);
  981.                                 System.out.println("[Rena] Picking up Dragonstone at "+cc[1]+","+cc[2]+" ...");
  982.                                 System.out.println(" ");
  983.                 return random(1200,1300);
  984.                                        
  985.                         }
  986.                         int[] dd = getItemById(526);
  987.             if(dd[0]!=-1)
  988.                         {
  989.                                 if(inCombat())
  990.                                 {
  991.                                        walkTo(getX(), getY());
  992.                                 }
  993.                                 walkTo(dd[1], dd[2]);
  994.                 pickupItem(526, dd[1], dd[2]);
  995.                                 System.out.println("[Rena] Picking up half key tooth at "+dd[1]+","+dd[2]+" ...");
  996.                                 System.out.println(" ");
  997.                 return random(1200,1300);
  998.                                        
  999.                         }
  1000.                         int[] ee = getItemById(527);
  1001.             if(ee[0]!=-1)
  1002.                         {
  1003.                                 if(inCombat())
  1004.                                 {
  1005.                                        walkTo(getX(), getY());
  1006.                                 }
  1007.                                 walkTo(ee[1], ee[2]);
  1008.                 pickupItem(527, ee[1], ee[2]);
  1009.                                 System.out.println("[Rena] Picking up half key loop at "+ee[1]+","+ee[2]+" ...");
  1010.                                 System.out.println(" ");
  1011.                 return random(1200,1300);
  1012.                                        
  1013.                         }
  1014.                        
  1015.                        
  1016.                        
  1017.                        
  1018.                        
  1019.                        
  1020.                        
  1021.                        
  1022.                        
  1023.                        
  1024.                         if(getFatigue() > 60 && sleep)
  1025.             {
  1026.                                 if(inCombat())
  1027.                                 {
  1028.                                        walkTo(getX(), getY());
  1029.                                 }
  1030.                 useSleepingBag();
  1031.                                 System.out.println("[Rena] Fatigue %: 60 reached! Sleeping... ");
  1032.                                 System.out.println(" ");
  1033.                 return 2000;
  1034.             }
  1035.  
  1036.                         // Dragon Fighting
  1037.                        
  1038.                         int[] npc;
  1039.                         npc = getNpcInRadius(202,364,3349,10);
  1040.                         if(npc[0] != -1 && !inCombat())
  1041.                         {
  1042.                                 attackNpc(npc[0]);
  1043.                                 System.out.println("[Rena] Blue Dragon spotted in Zone  ... Attacking ... ");
  1044.                                 System.out.println(" ");
  1045.                                 return random(1000, 1200);
  1046.                         }
  1047.                         else if(npc[0] == -1 && !inCombat())
  1048.                         {
  1049.                                 walkTo(370,3354);
  1050.                                 System.out.println("[Rena] Dont see any Blue dragons around here :/");
  1051.                                 System.out.println("[Rena] Walking back to Blue dragons spawn point !");
  1052.                                 System.out.println(" ");
  1053.                                 return random(1900, 2100);
  1054.                         }
  1055.                         if(!isAtApproxCoords(364,3349,10) && !inCombat())
  1056.                         {
  1057.                                 walkTo(370,3354);
  1058.                                 System.out.println("[Rena] Went outside Blue Dragons Zone ... Walking back!");
  1059.                                 System.out.println(" ");
  1060.                                 return random(1900, 2100);
  1061.                         }
  1062.                         return random(1900, 2200);
  1063.         }
  1064.                
  1065.                
  1066.                
  1067.                 // general walk
  1068.        if((step + 1) < path.length) {
  1069.  
  1070.           if(isAtApproxCoords(path[step], path[step + 1], 0))
  1071.              step = step + 2;
  1072.           walkTo(path[step] , path[step + 1] );
  1073.                   System.out.println("[Rena] Running . . . ! ");
  1074.           return random(850, 1200);
  1075.        }
  1076.        loop++;
  1077.        if(loop > 10)
  1078.             {
  1079.           step = 0;
  1080.           loop = 0;
  1081.         }
  1082.         return random(800, 1000);
  1083.  
  1084.  
  1085.     }
  1086.        
  1087.  
  1088.  
  1089. }