The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Java Code
Posted by: Cheese | June 16, 2010 @ 1:17pm
Java Code
[
Download
]
import java.awt.*; import java.awt.event.KeyEvent; import java.util.*; import org.rsbot.script.*; import org.rsbot.script.wrappers.*; import org.rsbot.bot.Bot; import org.rsbot.event.listeners.PaintListener; import org.rsbot.event.listeners.ServerMessageListener; import org.rsbot.event.events.ServerMessageEvent; @ScriptManifest(authors = "Rapid", category = "Rapid", name = "Cheese Producer ;) v2", version = 1.0, description = "WHAT_YOU_WANT_IT_TO_SAY_IN_DESCRIPTION") public class CheeseProducer extends Script implements ServerMessageListener { //Summoning Regeneration Timers public long SummoningTimer; public long CurrentTime; public long TimeToNextSpecial; public Boolean SpecialRegained; //SkillsTab public int FirstTabX = 554; public int FirstTabY = 211; public int TabDifferenceX = 62; public int TabDifferenceY = 23; //Log Variables public int TotalPizzaMade; //General Variables public int RandomNumber; public int RandomX; public int RandomY; //Summoning/Pizza Swap public Boolean usingScrolls = true; public Boolean makingPizza = false; //Pizza Variables public int CheeseID = 1985; public int UncookedID = 2287; public int IncompleteID = 2285; public int CheeseCount; public int PizzaCount; public int PizzaMade; public int CombinedWithdraw; public int CheeseInv; public int PizzaInv; //Make-All ID's public int PizzaX = 236; public int PizzaY = 397; public int MakeX = 192; public int MakeY = 457; //Withdraw public Boolean WithdrawPotion = false; //Objects public RSObject FindBank; //ID's public int SummoningPotion1 = 12146; public int SummoningPotion2 = 12144; public int SummoningPotion3 = 12142; public int VialID = 229; public int ScrollID = 12430; public int PouchID = 12067; public int BankBoothID = 11402; public int Animation = 7660; //Mouse Variables public int DepositSummonX = 457; public int DepositSummonY = 295; public int SummonIconX = 695; public int SummonIconY = 135; //Count Variables public int SpecialCount; public int SummoningPotionCounter; //Check Variables public int CheckScroll; public int CheckPotion; public int CheckPotionInv; public Boolean CheckDeposit; public Boolean PotUp; public int SummoningPoint = 60; public int SummoningPotionCount; public void doAntiBanPizza(){ RandomNumber = random(1, 3); if (RandomNumber == 1){ log("Using anti-ban method 1."); RandomX = 520 + random(0, 15); RandomY = 53 + random(0, 15); moveMouse(RandomX, RandomY); clickMouse(true); WaitRandom(); RandomX = RandomX + random(-200, 200); RandomY = RandomY + random(-200, 200); moveMouse(RandomX, RandomY); WaitRandom(); RandomX = 520 + random(0, 15); RandomY = 53 + random(0, 15); moveMouse(RandomX, RandomY); clickMouse(true); WaitRandom(); } if (RandomNumber == 3){ log("Using anti-ban method 2."); RandomX = 553 + random(0, 20); RandomY = 168 + random(0, 30); moveMouse(RandomX, RandomY); clickMouse(true); WaitRandom(); RandomNumber = random(1, 24); if (RandomNumber == 1){ RandomX = 554 + random(0, 40); RandomY = 211 + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 2){ RandomX = FirstTabX + TabDifferenceX + random(0, 40); RandomY = FirstTabY + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 3){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0, 40); RandomY = FirstTabY + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 4){ RandomX = FirstTabX + random(0, 40); RandomY = FirstTabY + TabDifferenceY + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 5){ RandomX = FirstTabX + TabDifferenceX + random(0, 40); RandomY = FirstTabY + TabDifferenceY + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 6){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0, 40); RandomY = FirstTabY + TabDifferenceY + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 7){ RandomX = FirstTabX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 2) + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 8){ RandomX = FirstTabX + TabDifferenceX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 2) + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 9){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 2) + random(0, 20); moveMouse(RandomX, RandomY); } if (RandomNumber == 10){ RandomX = FirstTabX + random(0, 40); RandomY = FirstTabY + (TabDifferenceY * 3) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 11){ RandomX = FirstTabX + TabDifferenceX + random(0, 40); RandomY = FirstTabY + (TabDifferenceY * 3) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 12){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 3) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 13){ RandomX = FirstTabX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 4) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 14){ RandomX = FirstTabX + TabDifferenceX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 4) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 15){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 4) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 16){ RandomX = FirstTabX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 5) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 17){ RandomX = FirstTabX + TabDifferenceX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 5) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 18){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 5) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 19){ RandomX = FirstTabX + random(0, 40); RandomY = FirstTabY + (TabDifferenceY * 6) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 20){ RandomX = FirstTabX + TabDifferenceX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 6) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 21){ RandomX = FirstTabX + (TabDifferenceX * 2) + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 6) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 21){ RandomX = FirstTabX + random(0, 40); RandomY = FirstTabY + (TabDifferenceY * 7) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 22){ RandomX = FirstTabX + TabDifferenceX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 7) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 23){ RandomX = FirstTabX + TabDifferenceX + random(0, 40); RandomY = FirstTabY + (TabDifferenceY * 7) + random(0,20); moveMouse(RandomX, RandomY); } if (RandomNumber == 24){ RandomX = FirstTabX + random(0,40); RandomY = FirstTabY + (TabDifferenceY * 8) + random(0,20); moveMouse(RandomX, RandomY); } WaitRandom(); WaitRandom(); } if (RandomNumber == 2){ log("Using anti-ban method 2."); RandomX = random(0, 500); RandomY = random(0, 250); moveMouse(RandomX, RandomY); wait(random(10000, 30000)); } } public void doAntiBan(){ } public void WaitRandom(){ RandomNumber = random(1, 5); if (RandomNumber == 1){ wait(random(500,1000)); } if (RandomNumber == 2){ wait(random(750,1250)); } if (RandomNumber == 3){ wait(random(1000, 1500)); } if (RandomNumber == 4){ wait(random(1500,2000)); } if (RandomNumber == 5){ wait(random(2000, 2500)); } } public void WithdrawPot(){ CheckPotionInv = getInventoryCount(SummoningPotion3); CheckPotionInv = CheckPotionInv + getInventoryCount(SummoningPotion2); CheckPotionInv = CheckPotionInv + getInventoryCount(SummoningPotion1); if (CheckPotionInv == 0); RSObject FindBank = getNearestObjectByID(BankBoothID); if (FindBank != null){ while (!bank.open()){ if (!bank.open()){ atObject(FindBank, "Use-quickly"); wait(random(4000, 5000)); bank.getCount(SummoningPotion3); if (SummoningPotionCount == 0){ log("Out of potions"); stopScript(); } } } } bank.withdraw(SummoningPotion3, 1); } public void DrinkPot(){ bank.close(); SummoningPotionCount = getInventoryCount(SummoningPotion3); while (SummoningPotionCount == 1){ SummoningPotionCount = getInventoryCount(SummoningPotion3); atInventoryItem(SummoningPotion3, "Drink"); SummoningPoint = SummoningPoint + 15; wait(random(2000,3000)); atInventoryItem(SummoningPotion2, "Drink"); SummoningPoint = SummoningPoint + 15; wait(random(2000,3000)); atInventoryItem(SummoningPotion1, "Drink"); SummoningPoint = SummoningPoint + 15; wait(random(2000,3000)); } } public void MakePizza(){ atInventoryItem(IncompleteID, "Use"); wait(random(1000,2000)); atInventoryItem(CheeseID, "Use"); wait(random(1000,2000)); PizzaX = PizzaX + random(0, 30); PizzaY = PizzaY + random(0, 10); moveMouse(PizzaX, PizzaY); PizzaX = 236; PizzaY = 397; clickMouse(false); MakeX = 194 + random(0, 90); MakeY = 457 + random(0, 5); moveMouse(MakeX, MakeY); clickMouse(true); MakeX = 194; MakeY = 457; } public int loop(){ TimeToNextSpecial = System.currentTimeMillis() - SummoningTimer; if (TimeToNextSpecial == 300000){ SpecialRegained = true; SummoningPoint = SummoningPoint + 10; } if (SpecialRegained == true){ SummoningTimer = System.currentTimeMillis(); SpecialRegained = false; } try{ if (usingScrolls == true){ CheckScroll = getInventoryCount(ScrollID); if (CheckScroll == 0){ log("No scrolls left. Going to make pizza's"); usingScrolls = false; makingPizza = true; } } if (usingScrolls == true){ log("Using scrolls option."); while (SpecialCount <= 7){ log("Doing Special."); SummonIconX = SummonIconX + random(0, 50); SummonIconY = SummonIconY + random(0, 10); moveMouse(SummonIconX, SummonIconY); clickMouse(true); SummonIconX = 695; SummonIconY = 135; SummoningPoint = SummoningPoint - 6; SpecialCount = SpecialCount + random(1, 2); WaitRandom(); if (SummoningPoint <= 6){ WithdrawPot(); WaitRandom(); DrinkPot(); } } SpecialCount = 0; log("Banking."); RSObject FindBank = getNearestObjectByID(BankBoothID); if (FindBank == null){ log("Couldn't find bank..."); stopScript(); } while (!bank.isOpen()){ atObject(FindBank, "Use-quickly"); WaitRandom(); } if (bank.isOpen()); bank.depositAllFamiliar(); } if (makingPizza == true){ PizzaCount = getInventoryCount(IncompleteID); CheeseCount = getInventoryCount(CheeseID); CombinedWithdraw = PizzaCount + CheeseCount; if (CombinedWithdraw != 28){ RSObject FindBank = getNearestObjectByID(BankBoothID); while (!bank.isOpen()){ atObject(FindBank, "Use-quickly"); WaitRandom(); } PizzaCount = bank.getCount(IncompleteID); CheeseCount = bank.getCount(CheeseID); if (PizzaCount == 0){ log("No Pizza's"); stopScript(); } if (CheeseCount == 0){ log("No Cheese"); stopScript(); } bank.depositAll(); bank.withdraw(IncompleteID, 14); wait(random(100,200)); bank.withdraw(CheeseID, 14); WaitRandom(); CheeseInv = getInventoryCount(CheeseID); PizzaInv = getInventoryCount(IncompleteID); CombinedWithdraw = PizzaInv + CheeseInv; while (CombinedWithdraw != 28){ CombinedWithdraw = 0; bank.depositAll(); bank.withdraw(IncompleteID, 14); wait(random(100,200)); bank.withdraw(CheeseID, 14); WaitRandom(); CheeseInv = getInventoryCount(CheeseID); PizzaInv = getInventoryCount(IncompleteID); CombinedWithdraw = PizzaInv + CheeseInv; } bank.close(); WaitRandom(); while(bank.isOpen()){ bank.close(); WaitRandom(); } } MakePizza(); WaitRandom(); PizzaMade = getInventoryCount(UncookedID); WaitRandom(); PizzaMade = getInventoryCount(UncookedID); while (PizzaMade == 0){ MakePizza(); WaitRandom(); PizzaMade = getInventoryCount(UncookedID); } doAntiBanPizza(); while (PizzaMade < 14){ PizzaMade = getInventoryCount(UncookedID); wait(random(100,200)); } log("Pizza's done."); atObject(FindBank, "Use-quickly"); WaitRandom(); while (!bank.isOpen()){ atObject(FindBank, "Use-quickly"); WaitRandom(); } bank.depositAll(); bank.withdraw(IncompleteID, 14); wait(random(100,200)); bank.withdraw(CheeseID, 14); WaitRandom(); CheeseInv = getInventoryCount(CheeseID); PizzaInv = getInventoryCount(IncompleteID); CombinedWithdraw = PizzaInv + CheeseInv; while (CombinedWithdraw != 28){ bank.withdraw(IncompleteID, 14); wait(random(100,200)); bank.withdraw(CheeseID, 14); WaitRandom(); CheeseInv = getInventoryCount(CheeseID); PizzaInv = getInventoryCount(IncompleteID); CombinedWithdraw = PizzaInv + CheeseInv; } bank.close(); WaitRandom(); while(bank.isOpen()){ bank.close(); wait(random(1000,2000)); } } } catch (Exception e){ log("Script failed. Trying to start again."); } return random(500,1000); } public void onFinish(){ log("Thanks for using I2HYCheeseProducer"); log("Uncooked pizza's made: " + TotalPizzaMade + "."); } @Override public void serverMessageRecieved(ServerMessageEvent e) { String word = e.getMessage(); if (word.contains("You add the cheese to the pizza.")){ TotalPizzaMade = TotalPizzaMade + 1; } } }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.48 / 8
63 Votes
http://codebin.yi.org/694
page generated in 0.00 seconds