- 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.bot.input.Mouse; 
- import org.rsbot.event.listeners.PaintListener; 
- import org.rsbot.event.listeners.ServerMessageListener; 
- import org.rsbot.event.events.ServerMessageEvent; 
-   
- @ScriptManifest(authors = "Rapid", category = "AlexMaley", name = "Tuna Potato Maker", version = 0.1, description = "Makes uncooked pizza's using the summining scrolls and incomplete pizza's.") 
-   
- public class TunaPotatoMaker extends Script implements PaintListener, 
-  ServerMessageListener { 
-   
- 	public long seconds1; 
- 	public long ProfitPerHour; 
- 	public long-  startTime =  System- . currentTimeMillis()- ; 
 
- 	public int TotalProfit; 
- 	public int CornBowlMade; 
- 	public int TunaBowlMade; 
- 	public int PotatoButterMade; 
- 	public int TunaPotatoMade; 
- 	public int Counter; 
- 	public int BankBoothID = 11402; 
- 	public int KnifeID = 946; 
- 	//Primary ingredients 
- 	public int ButterID = 6697; 
- 	public int PotatoID = 6701; 
- 	public int CornID = 5988; 
- 	public int BowlID = 1923; 
- 	public int TunaID = 361; 
- 	//Secondary Ingredients 
- 	public int ButterPotatoID = 6703; 
- 	public int CornBowlID = 7088; 
- 	public int TunaBowlID = 7068; 
- 	//Final product 
- 	public int TunaPotatoID = 7060; 
-   
- 	private int antiBan() { 
- 		int random = random(1, 4); 
- 		switch (random) { 
- 		case 1: 
- 			if (random(1, 4) == 2) { 
- 				moveMouseRandomly(300); 
- 				return random(100, 500); 
- 			} 
- 		case 2: 
- 			if (random(1, 10) == 5) { 
- 				if (getCurrentTab() != TAB_INVENTORY) { 
- 					openTab(TAB_INVENTORY); 
- 					return random(100, 500); 
- 				} else { 
- 					return random(100, 500); 
- 				} 
- 			} 
- 		case 3: 
- 			if (random(1, 200) == 100) { 
- 				if (getMyPlayer().isMoving()) { 
- 					return random(100, 500); 
- 				} 
- 				if (getCurrentTab() != TAB_STATS) { 
- 					openTab(TAB_STATS); 
- 				} 
- 				moveMouse(686, 306, 20, 10); 
- 				wait(random(1500, 3000)); 
- 				if (getCurrentTab() != TAB_INVENTORY) { 
- 					openTab(TAB_INVENTORY); 
- 				} 
- 				return random(100, 500); 
- 			} 
- 		case 4: 
- 			if (random(1, 150) == 75) { 
- 				openTab(random(0, 8)); 
- 				wait(random(1500, 2500)); 
- 				return random(100, 500); 
- 			} 
- 		} 
- 		return 50; 
- 	} 
-   
- 	public void doBank(){ 
- 		RSObject BankBooth = getNearestObjectByID(BankBoothID); 
- 		atObject(BankBooth, "Use-quickly"); 
- 	} 
-   
- 	public boolean doButter(){ 
- 		try{ 
- 			doBank(); 
- 			wait(random(500,600)); 
- 			if (!bank.isOpen()){ 
- 				doBank(); 
- 				wait(random(200,300)); 
- 			} 
- 			wait(random(1000,1250)); 
- 			while (!isLoggedIn()){ 
- 				wait(random(100,200)); 
- 			} 
- 			Counter = bank.getCount(ButterID); 
- 				if (Counter < 13){ 
- 					log("No butter in bank, stopping script."); 
- 					stopScript(); 
- 				} 
- 			bank.depositAllExcept(KnifeID); 
- 			wait(random(200,300)); 
- 			bank.withdraw(ButterID, 13); 
- 			wait(random(1000,1250)); 
- 			Counter = getInventoryCount(ButterID); 
- 			while (Counter == 0){ 
- 				bank.deposit(ButterID, 13); 
- 				wait(random(200,300)); 
- 				bank.withdraw(ButterID, 13); 
- 				wait(random(1000,1250)); 
- 				Counter = getInventoryCount(ButterID); 
- 			} 
- 			bank.withdraw(PotatoID, 13); 
- 			wait(random(1000,1250)); 
- 			Counter = getInventoryCount(PotatoID); 
- 			while (Counter == 0){ 
- 				bank.deposit(PotatoID, 13); 
- 				wait(random(200, 300)); 
- 				bank.withdraw(PotatoID, 13); 
- 				wait(random(1000, 1250)); 
- 				Counter = getInventoryCount(PotatoID); 
- 			} 
- 			bank.close(); 
- 			wait(random(200,300)); 
- 			atInventoryItem(ButterID, "Use"); 
- 			wait(random(200,300)); 
- 			while (!isItemSelected()){ 
- 				atInventoryItem(ButterID, "Use"); 
- 				wait(random(200, 300)); 
- 			} 
- 			atInventoryItem(PotatoID, "Use"); 
- 			wait(random(1000,1200)); 
- 			while (!RSInterface.getInterface(513).isValid()){ 
- 				wait(random(200,300)); 
- 				atInventoryItem(ButterID, "Use"); 
- 				wait(random(200,300)); 
- 				while (!isItemSelected()){ 
- 					atInventoryItem(ButterID, "Use"); 
- 					wait(random(200, 300)); 
- 				} 
- 				atInventoryItem(PotatoID, "Use"); 
- 				wait(random(1000,1250)); 
- 			} 
- 			if (RSInterface.getInterface(513).isValid()){ 
- 				clickMouse(260, 415, 10, 10, false); 
- 					if (getMenuActions().contains("Make All")){ 
- 						atMenu("Make All"); 
- 					} 
- 			} 
- 			for (int i = 0; i <= 13; i++) { 
- 				if (RSInterface.getInterface( 
- 						Constants.INTERFACE_LEVELUP) 
- 						.isValid()) { 
- 					clickContinue(); 
- 				} 
- 				antiBan(); 
- 				wait(1250); 
- 			} 
-   
- 		} 
- 		return true; 
- 	} 
-   
- 	public boolean doCorn(){ 
- 		try{ 
- 			doBank(); 
- 			wait(random(500,800)); 
- 			if (!bank.isOpen()){ 
- 				doBank(); 
- 				wait(random(500,800)); 
- 			} 
- 			bank.depositAllExcept(KnifeID); 
- 			wait(random(250,300)); 
- 			bank.withdraw(CornID, 13); 
- 			wait(random(1000,1250)); 
- 			Counter = getInventoryCount(CornID); 
- 			while (Counter != 13){ 
- 				bank.deposit(CornID, 13); 
- 				wait(random(250,300)); 
- 				bank.withdraw(CornID, 13); 
- 				wait(random(1000,1250)); 
- 				Counter = getInventoryCount(CornID); 
- 			} 
- 			bank.withdraw(BowlID,13); 
- 			wait(random(1000,1250)); 
- 			Counter = getInventoryCount(BowlID); 
- 			while (Counter != 13){ 
- 				Counter = getInventoryCount(CornID); 
- 				while (Counter > 13){ 
- 					bank.depositAllExcept(KnifeID); 
- 					wait(random(300,400)); 
- 					bank.withdraw(CornID, 13); 
- 					wait(random(1000,1250)); 
- 					Counter = getInventoryCount(CornID); 
- 				} 
- 				bank.deposit(BowlID, 13); 
- 				wait(random(300,400)); 
- 				bank.withdraw(BowlID, 13); 
- 				wait(random(1000,1250)); 
- 				Counter = getInventoryCount(BowlID); 
- 			} 
- 			bank.close(); 
- 			wait(random(300,400)); 
- 			atInventoryItem(BowlID, "Use"); 
- 			wait(random(200,300)); 
- 			while (!isItemSelected()){ 
- 				atInventoryItem(BowlID, "Use"); 
- 				wait(random(200,300)); 
- 			} 
- 			atInventoryItem(CornID, "Use"); 
- 			wait(random(1000,1250)); 
- 			while (!RSInterface.getInterface(513).isValid()){ 
- 				atInventoryItem(BowlID, "Use"); 
- 				wait(random(200,300)); 
- 				while (!isItemSelected()){ 
- 					atInventoryItem(BowlID, "Use"); 
- 					wait(random(200,300)); 
- 				} 
- 				atInventoryItem(CornID, "Use"); 
- 				wait(random(500,600)); 
- 			} 
- 			if (RSInterface.getInterface(513).isValid()){ 
- 				clickMouse(260, 415, 10, 10, false); 
- 					if (getMenuActions().contains("Make All")){ 
- 						atMenu("Make All"); 
- 					} 
- 			} 
- 			for (int i = 0; i <= 13; i++) { 
- 				if (RSInterface.getInterface( 
- 						Constants.INTERFACE_LEVELUP) 
- 						.isValid()) { 
- 					clickContinue(); 
- 				} 
- 				antiBan(); 
- 				wait(1250); 
- 			} 
-   
- 		} 
- 		return true; 
- 	} 
-   
- 	public boolean doTuna(){ 
- 		try{ 
- 			doBank(); 
- 			wait(random(500,600)); 
- 			if (!bank.isOpen()){ 
- 				doBank(); 
- 				wait(random(500,600)); 
- 			} 
- 			bank.depositAllExcept(KnifeID, CornBowlID); 
- 			wait(random(300,400)); 
- 			bank.withdraw(TunaID, 13); 
- 			wait(random(1000,1250)); 
- 			Counter = getInventoryCount(TunaID); 
- 			while (Counter != 13){ 
- 				bank.deposit(TunaID, 13); 
- 				wait(random(200,300)); 
- 				bank.withdraw(TunaID, 13); 
- 				wait(random(1000,1250)); 
- 			} 
- 			bank.close(); 
- 			atInventoryItem(TunaID, "Use"); 
- 			wait(random(200,300)); 
- 			while (!isItemSelected()){ 
- 				atInventoryItem(TunaID, "Use"); 
- 				wait(random(200,300)); 
- 			} 
- 			atInventoryItem(CornBowlID, "Use"); 
- 			wait(random(1000,1250)); 
- 			while (!RSInterface.getInterface(513).isValid()){ 
- 				atInventoryItem(TunaID, "Use"); 
- 				wait(random(200,300)); 
- 				while (!isItemSelected()){ 
- 					atInventoryItem(TunaID, "Use"); 
- 					wait(random(200,300)); 
- 				} 
- 				atInventoryItem(CornBowlID, "Use"); 
- 				wait(random(1000,1250)); 
- 			} 
- 			if (RSInterface.getInterface(513).isValid()){ 
- 				clickMouse(260, 415, 10, 10, false); 
- 					if (getMenuActions().contains("Make All")){ 
- 						atMenu("Make All"); 
- 					} 
- 			} 
- 			for (int i = 0; i <= 13; i++) { 
- 				if (RSInterface.getInterface( 
- 						Constants.INTERFACE_LEVELUP) 
- 						.isValid()) { 
- 					clickContinue(); 
- 				} 
- 				antiBan(); 
- 				wait(1250); 
- 			} 
-   
- 		} 
- 		return true; 
- 	} 
-   
- 	public boolean doFinal(){ 
- 		try{ 
- 			doBank(); 
- 			wait(random(500,600)); 
- 			if (!bank.isOpen()){ 
- 				doBank(); 
- 				wait(random(500,600)); 
- 			} 
- 			bank.depositAllExcept(KnifeID, TunaBowlID); 
- 			wait(random(200,300)); 
- 			bank.withdraw(ButterPotatoID, 13); 
- 			wait(random(1000,1250)); 
- 			Counter = getInventoryCount(ButterPotatoID); 
- 			while (Counter != 13){ 
- 				bank.deposit(ButterPotatoID, 13); 
- 				wait(random(200,300)); 
- 				bank.withdraw(ButterPotatoID, 13); 
- 				wait(random(1000,1250)); 
- 				Counter = getInventoryCount(ButterPotatoID); 
- 			} 
- 			wait(random(300,400)); 
- 			bank.close(); 
- 			wait(random(300,400)); 
- 			atInventoryItem(ButterPotatoID, "Use"); 
- 			wait(random(200,300)); 
- 			while (!isItemSelected()){ 
- 				atInventoryItem(ButterPotatoID, "Use"); 
- 				wait(random(200,300)); 
- 			} 
- 			atInventoryItem(TunaBowlID, "Use"); 
- 			wait(random(1000,1250)); 
- 				while (!RSInterface.getInterface(513).isValid()){ 
- 					wait(random(200,300)); 
- 					atInventoryItem(ButterPotatoID, "Use"); 
- 					wait(random(200,300)); 
- 					while (!isItemSelected()){ 
- 						atInventoryItem(ButterPotatoID, "Use"); 
- 						wait(random(200,300)); 
- 					} 
- 					atInventoryItem(TunaBowlID, "Use"); 
- 					wait(random(1000,1250)); 
- 				} 
- 			if (RSInterface.getInterface(513).isValid()){ 
- 				clickMouse(260, 415, 10, 10, false); 
- 					if (getMenuActions().contains("Make All")){ 
- 						atMenu("Make All"); 
- 					} 
- 			} 
- 			for (int i = 0; i <= 13; i++) { 
- 				if (RSInterface.getInterface( 
- 						Constants.INTERFACE_LEVELUP) 
- 						.isValid()) { 
- 					clickContinue(); 
- 				} 
- 				antiBan(); 
- 				wait(1250); 
- 			} 
- 			wait(random(100,200)); 
-   
- 		} 
- 		return true; 
- 	} 
-   
- 	@Override 
- 	public int loop() { 
- 		if (doButter()){ 
- 			if (doCorn()){ 
- 				if (doTuna()){ 
- 					if (doFinal()){ 
-   
- 					} 
- 				} 
- 			} 
- 		} 
- 		return(random(500,1000)); 
- 	} 
-   
- 	@Override 
- 		if (isLoggedIn()){ 
- 			long-  millis =  System- . currentTimeMillis()-  - startTime; 
 
- 			final long hours = millis / (1000 * 60 * 60); 
- 			millis -= hours * 1000 * 60 * 60; 
- 			final long minutes = millis / (1000 * 60); 
- 			millis -= minutes * 1000 * 60; 
- 			final long seconds = millis / 1000; 
- 			seconds1 = seconds1 + millis / 1000; 
- 			TotalProfit = TunaPotatoMade * 700; 
- 			ProfitPerHour = ((TotalProfit / seconds1) * 60) * 60; 
- 			g.drawRect(0, 0, 226 , 163); 
- 			g.fillRect(0, 0, 226, 163); 
- 			g.drawString("Butter with Potato's made : " + PotatoButterMade, 9, 23 ); 
- 			g.drawString("Sweet corn bowls made : " + CornBowlMade, 9,43); 
- 			g.drawString("Tuna bowls made : " + TunaBowlMade, 9, 63); 
- 			g.drawString("Tuna potato's made : " + TunaPotatoMade, 9, 83); 
- 			g.drawString("Total Profit made : " +  TotalProfit + "!", 9, 103); 
- 			g.drawString("Profit P/Hour : " + ProfitPerHour + "!", 9, 123); 
- 			g.drawString("Duration : " + hours + ":" + minutes + ":" + seconds, 9, 143); 
- 		} 
- 	} 
-   
- 	@Override 
- 	public void serverMessageRecieved(ServerMessageEvent e) { 
- 		String-  serverString = e. getMessage()- ; 
 
- 		if (serverString.contains("You put the cooked sweetcorn into the bowl.")){ 
- 			CornBowlMade++; 
- 		} 
- 		if (serverString.contains("You mix the ingredients to make the topping.")){ 
- 			TunaBowlMade++; 
- 		} 
- 		if (serverString.contains("You add the butter to the potato.")){ 
- 			PotatoButterMade++; 
- 		} 
- 		if (serverString.contains("You add the topping to the potato.")){ 
- 			TunaPotatoMade++; 
- 		} 
- 	} 
- } 
-