Kocke 1 Posted July 4, 2018 Hello I need some help with my script, when I try to run it gives me some error. I can't figure out what it causing it. Can someone help me? @ScriptManifest(category = Category.SMITHING, name = "Kmelter", author = "Kocke", version = 1.0) public abstract class main extends AbstractScript{ Area SMELT = new Area(3272, 3182, 3280, 3189); Area BANK = new Area(3268, 3171, 3271, 3161); int bar = 0; public int onLoop() { if(getInventory().contains("Iron ore")) //Smelt { if(SMELT.contains(getLocalPlayer())) { GameObject Smel = getGameObjects().closest("Furnce"); if(Smel != null) { Smel.interact("Smelt"); if(sleepUntil(() -> getWidgets().getWidget(270).isVisible(), 8000)) { if(getWidgets().getWidget(270).getChild(16).interact("Smelt")) { if(sleepUntil(() -> !getInventory().contains("Iron ore"), 8000)){ } } } } } }else { if(getWalking().walk(SMELT.getRandomTile())){ sleep(Calculations.random(3000, 5500)); } } if(!getInventory().contains("Iron ore")) //Bank { if(BANK.contains(getLocalPlayer())) { if(getBank().isOpen()) { if(getBank().depositAllItems()) { if(sleepUntil(() -> getInventory().isEmpty(), 3000)) { if(getBank().contains("Iron ore")) { if(getBank().withdrawAll("Iron ore")) { if(sleepUntil(() -> getInventory().contains("Iron ore"), 8000)){ } } } else { return -1; } } } }else { if(getBank().openClosest()) { }} }else {if(getWalking().walk(BANK.getRandomTile())){ //move to bank sleep(Calculations.random(3000, 5500));} } } return 800; }
Hashtag 9073 Posted July 4, 2018 The error you're getting most likely tells what causes it, so paste the error line here.
Kocke 1 Author Posted July 5, 2018 Rewrote the script and it works now, the error I was getting was because some of the imports did not work.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.