1. // Made by I2apid/Rapid for use by Rapid and Hemmy only!
  2. // The script produces cheese from albino rat by using
  3. // the scrolls.
  4.  
  5. import java.awt.*;
  6. import java.awt.event.KeyEvent;
  7. import java.util.*;
  8.  
  9. import org.rsbot.script.*;
  10. import org.rsbot.script.wrappers.*;
  11. import org.rsbot.bot.Bot;
  12. import org.rsbot.event.listeners.PaintListener;
  13. import org.rsbot.event.listeners.ServerMessageListener;
  14. import org.rsbot.event.events.ServerMessageEvent;
  15.  
  16. @ScriptManifest(authors = "Rapid", category = "Rapid", name = "Cheese Producer ;)", version = 1.0, description = "WHAT_YOU_WANT_IT_TO_SAY_IN_DESCRIPTION")
  17.  
  18. public class Summoning extends Script {
  19.  
  20. //Summoning Variables
  21. public Boolean SummoningPotion;
  22. public Boolean GetPotion;
  23. public int SummoningPotionID [] = {12142, 12144, 12156};
  24. public int SummoningPotion3 = 12142;
  25. public int SummoningPotion2 = 12144;
  26. public int SummoningPotion1 = 12156;
  27. public int CheckPotion;
  28. public int ScrollID = 12430;
  29.  
  30. public int ScrollCount;
  31. public int SummoningPotionCount;
  32.  
  33. //Banking Variables
  34. public Boolean BankOpen;
  35.  
  36. //Object Variables
  37. public int bankBooth = 11402;
  38. public RSObject BankBooth = getNearestObjectByID(bankBooth);
  39.  
  40. //Mouse Variables
  41. public int SummoningX = 691;
  42. public int SummoningY = 141;
  43. public int DepositSummoningX = 455;
  44. public int DepositSummoningY = 298;
  45. public int CloseBankX = 482;
  46. public int CloseBankY = 28;
  47.  
  48. //Counters
  49. public int ClickCount;
  50. public int SpecialCount;
  51. public int ClickToBank;
  52. public int Failed;
  53.  
  54. //Output Variables
  55. public int TotalCheese;
  56. public int TotalTimesBanked;
  57.  
  58. public void CheckInventory(){
  59. ScrollCount = getInventoryCount(ScrollID);
  60. SummoningPotionCount = getInventoryCount(SummoningPotionID);
  61. if (ScrollCount == 0){
  62. log("No Scrolls found.");
  63. stopScript();
  64. }
  65. }
  66.  
  67. public void DoSummoning(){
  68. //Using summoning special
  69. SummoningX = SummoningX + random(0, 50);
  70. SummoningY = SummoningY + random(0, 10);
  71. moveMouse(SummoningX, SummoningY);
  72. clickMouse(true);
  73. ClickCount = ClickCount + 1;
  74. SpecialCount = SpecialCount + 1;
  75. SummoningX = 691;
  76. SummoningY = 141;
  77. }
  78.  
  79. public void OpenBank(){
  80. atObject(BankBooth, "Use-quickly ");
  81. BankOpen = true;
  82. wait(random(1000, 2000));
  83. }
  84.  
  85. public void Bank(){
  86. if (BankOpen = true) {
  87. DepositSummoningX = DepositSummoningX + random(0, 30);
  88. DepositSummoningY = DepositSummoningY + random(0, 10);
  89. moveMouse(DepositSummoningX, DepositSummoningY);
  90. clickMouse(true);
  91. DepositSummoningY = 298;
  92. DepositSummoningX = 455;
  93. wait(random(1000,2000));
  94. if (GetPotion = true){
  95. bank.withdraw(SummoningPotion3, 1);
  96. CloseBank();
  97. DrinkPotion();
  98. }
  99. }
  100. }
  101.  
  102. public void CloseBank(){
  103. if (RSInterface.getInterface(Constants.INTERFACE_BANK).isValid()){
  104. CloseBankX = CloseBankX + random(0, 10);
  105. CloseBankY = CloseBankY + random(0, 10);
  106. moveMouse(CloseBankX, CloseBankY);
  107. clickMouse(true);
  108. CloseBankX = 482;
  109. CloseBankY = 28;
  110. wait(random(1000, 2000));
  111. }
  112. }
  113.  
  114. public void SpecialDone(){
  115. if (SpecialCount >= 2){
  116. DrinkPotion();
  117. SpecialCount = 0;
  118. }
  119. if (SummoningPotion = false){
  120. GetPotion = true;
  121. Bank();
  122. }
  123. }
  124.  
  125. public void DrinkPotion(){
  126. if (getCurrentTab() != TAB_INVENTORY){
  127. openTab(TAB_INVENTORY);
  128. }
  129. CheckPotion = getInventoryCount(SummoningPotion3);
  130. if (CheckPotion > 0){
  131. atInventoryItem(SummoningPotion3, "Drink ");
  132. }
  133. if (CheckPotion == 0){
  134. CheckPotion = getInventoryCount(SummoningPotion2);
  135. if (CheckPotion > 0){
  136. atInventoryItem(SummoningPotion2, "Drink ");
  137. }
  138. if (CheckPotion == 0){
  139. CheckPotion = getInventoryCount(SummoningPotion1);
  140. if (CheckPotion > 0){
  141. atInventoryItem(SummoningPotion1, "Drink ");
  142. }
  143. if (CheckPotion == 0){
  144. SummoningPotion = false;
  145. }
  146. }
  147. }
  148. }
  149.  
  150. public int loop() {
  151. CheckInventory();
  152. log("Checking Inventory");
  153. DoSummoning();
  154. log("Doing Summoning");
  155. SpecialDone();
  156. log("Done Special.");
  157. if (ClickCount >= random(6, 7)){
  158. ClickCount = 0;
  159. log("Opening Bank.");
  160. OpenBank();
  161. if (BankOpen = true){
  162. log("Banking.");
  163. Bank();
  164. }
  165. }
  166. return random(500, 1000);
  167. }
  168.  
  169. }