import java.awt.Rectangle; import impsoft.nexus.bots.color.constants.Areas; import impsoft.nexus.bots.color.methods.ColorScript; import impsoft.nexus.bots.color.scriptobjects.Menu; public class assBuyer extends ColorScript { public static String arugs[]; public static double version = 1; public static String[] commands = new String[] {"spotID", "Buy Amount", "Max Price"}; public String author = "assSoft - Anow - Solar - Seungki"; public String description = "assBuyer"; public String argsBuyAmount; public int argsSpotID; public int argsMaxPrice; public boolean run; public Rectangle[] shopSpotRecs = new Rectangle[] // 5 Rows - 8 Items Per Row { new Rectangle(80, 70, 30, 25), new Rectangle(125, 70, 30, 25), new Rectangle(170, 70, 30, 25), new Rectangle(220, 70, 30, 25), new Rectangle(265, 70, 30, 25), new Rectangle(315, 70, 30, 25), new Rectangle(360, 70, 30, 25), new Rectangle(408, 70, 30, 25), new Rectangle(80, 117, 30, 25), new Rectangle(125, 117, 30, 25), new Rectangle(170, 117, 30, 25), new Rectangle(220, 117, 30, 25), new Rectangle(265, 117, 30, 25), new Rectangle(315, 117, 30, 25), new Rectangle(360, 117, 30, 25), new Rectangle(408, 117, 30, 25), new Rectangle(80, 165, 30, 25), new Rectangle(125, 165, 30, 25), new Rectangle(170, 165, 30, 25), new Rectangle(220, 165, 30, 25), new Rectangle(265, 165, 30, 25), new Rectangle(315, 165, 30, 25), new Rectangle(360, 165, 30, 25), new Rectangle(408, 165, 30, 25), new Rectangle(80, 210, 30, 25), new Rectangle(125, 210, 30, 25), new Rectangle(170, 210, 30, 25), new Rectangle(220, 210, 30, 25), new Rectangle(265, 210, 30, 25), new Rectangle(315, 210, 30, 25), new Rectangle(360, 210, 30, 25), new Rectangle(408, 210, 30, 25), new Rectangle(80, 258, 30, 25), new Rectangle(125, 258, 30, 25), new Rectangle(170, 258, 30, 25), new Rectangle(220, 258, 30, 25), new Rectangle(265, 258, 30, 25), new Rectangle(315, 258, 30, 25), new Rectangle(360, 258, 30, 25), new Rectangle(408, 258, 30, 25), }; public boolean doStart(String cmd, String[] args) { if (args.length == 0) { log("No Args!"); return false; } log("Starting assBuyer"); log("By - anow2"); log(""); argsSpotID = Integer.parseInt(arugs[0]); argsBuyAmount = arugs[1]; argsMaxPrice = Integer.parseInt(arugs[2]); return true; } public void script() throws InterruptedException{ run = true; while (run) { log("Starting Now, Arent you excited?"); sleep(1500); while (theBot.loggedIn && run) { buyItemAtSpot(argsSpotID, argsBuyAmount, argsMaxPrice); sleep(random(200,400)); } } } public void buyItemAtMenuOptionSpot(int itemspotID, String menuSpotInfo) throws InterruptedException{ mouseMove(shopSpotRecs[itemspotID]); sleep(random(200,500)); String topText = getTopText(); if (topText.indexOf("Value") > 0) { log("Item Numbuh " + itemspotID +" is really " + topText); mouseClickRight(currentMouseX(), currentMouseY()); sleep(random(100, 300)); Menu shopItemMenu = getMenu(Areas.GAME, 2000); if (shopItemMenu != null) { sleep(random(75, 115)); shopItemMenu.selectContains(menuSpotInfo); sleep(random(200,275)); } else { log("You Lied to me! Theres no Item :("); } } } public int getItemPriceAtSpot(int spotID) throws InterruptedException{ mouseClickLeft(shopSpotRecs[spotID]); String priceText = getChat(0); if (priceText == null) { while (priceText != null) { priceText = getChat(0); } { String[] currentPrice; String[] currentPrice2; int currentPriceInt; log(priceText); currentPrice = priceText.split("costs "); currentPrice2 = currentPrice[1].split(" geepee."); log(currentPrice[1]); log(currentPrice2[0]); currentPriceInt = Integer.parseInt((currentPrice2[0])); return currentPriceInt; } } return spotID; } public void buyItemAtSpot(int argsSpotID, String argsBuyAmount, int argsMaxPrice) throws InterruptedException{ int itemPrice = getItemPriceAtSpot(argsSpotID); if (itemPrice <= argsMaxPrice) { buyItemAtMenuOptionSpot(argsSpotID, argsBuyAmount); log("Ownt that n33b arse Item, Its now my slave :)"); sleep(100); } else { log("Oh hell naw, shopkeepah betta lowah da price, its ova our max"); } }}