-
Posts
4692 -
Joined
-
Last visited
-
Feedback
91.3%
Everything posted by Joseph
-
Alek i see how your script selection is coming, before you go through with what your thinking about. Look in to trees which might be much better. For example look at the picture in my thread. Look at the gui http://osbot.org/forum/topic/57725-ds-path-collecter/
-
Extracting items put into trade screen after RS update?
Joseph replied to darkxor's topic in Scripting Help
isnt it fixed in the new update? -
nice update, can you tell us what part of the api your working on?
-
it was nice, upload some more vids
-
naw chill that was eariler when there wasnt many votes im 7-9
-
thats because its coded to osb 1. You cant run it on OSB2. Unless you convert it. I dont mind doing it. Done: http://osbot.org/forum/topic/57725-ds-path-collecter/
-
can i ask how the scripts going to be organized? by a drop down catalog list would be a nice ideas
-
dam im the only one for now in my age level lol
-
oh nice keep up the good work. I want to see mgi release something nice next
-
congratz @MGI your bring back hope
-
sorry everybody for some reason im not getting my notifications for this thread. But i finally noticed and ill give you all 80 hours free trial (a little over 3 days) enjoy guy
-
i meant shouldnt the value change after the onLoop finishes looping though? thats what i think. I never really had a problem with inventory.contains
-
thats sad to hear, but wouldnt the value change after it finishes looping?
-
so im a bit confused, what exactly are you trying to accomplish here? Your saying innvnetory.contains is slow? its a boolean what you mean. Are your rying to say the deposit method is slow?
-
Why don't you use getItem(name). Which return the first item and then interact with it.
-
i think cyber monday would be better and reasonable
-
nice im still here
-
[Suggestion Poll] OSBot Community Events
Joseph replied to Extreme Scripts's topic in Community Discussion
dont make the event public make it so that only member can read it. -
He's a guy and not a girl. Please do log the error
-
Alek you think you could update my script in within a few mins. I want to release my beta crafter script. I meant to do it earlier but I got lazy. Please!! @Alek done do me that favor please and thank you
-
Done
-
thank you For everybody: In my main class i have static timers since most of the script require to enter how much items you want to make.. All use the same method with the same static variable. Its meant for less typing.
-
Hello everybody, This is meant for learning purposed. Im not saying im the best, im sure i could learn more stuff. Im sure this could help others. Please note you have to have some knowledge of java because im not releasing everything. But some stuff, so there might be thing missing but if you know enough of java you could see it. i released my inventory listener. LINK Data class: Dont mind the static part, i have one whole class with separate static classes datas. I have a Main class that handles everything The my sub class GlassBlower. package scripts; import java.awt.Graphics2D; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; import core.AIOCrafter; import core.Data; import core.Data.DMode; import core.Data.GlassBlower; import dependencies.DsAPI; import dependencies.settings.DsAbstractScript; import dependencies.settings.DsNode; import dependencies.web.WebBank; public class DsGlassblower extends DsAbstractScript { private DsNode[] nodeList = new DsNode[] {new DsBank(), new Glassblow()}; private String status; private int total = 0, hoverAmount; private DsAPI dsAPI; private GlassBlower.Type type; private boolean enterAmount; private Bank bank; private Inventory inventory; //private Player myPlayer; public DsGlassblower(GlassBlower.Type type) { this.dsAPI = AIOCrafter.dsAPI; this.type = type; this.bank = sI().bank; this.inventory = sI().inventory; //this.myPlayer = sI().myPlayer(); } @Override public void handleAdded(Item item) { if (item != null){ String name = item.getName(); if (name.equalsIgnoreCase(type.toString())) { AIOCrafter.waitTimer.reset(); total++; } } } @Override public void handleRemoved(Item item) {} @Override public boolean oldScript() { return false; } @Override public void onPaint(Graphics2D g) { g.drawString("status: " +this.status, 560, 370); g.drawString("Total: " +this.total, 560, 390); } @Override public Script sI() { return AIOCrafter.script; } public void log(String name) { sI().log(name); } @Override public String Manifest() { return DMode.GLASS_BLOWER.toString(); } @Override public int onLoop() throws InterruptedException { for (DsNode DsNode: nodeList) { if (DsNode.activate()) { this.status = DsNode.status(); DsNode.run(); break; } } return 700; } private class DsBank implements DsNode { @Override public String status() { return "Banking: "; } @Override public boolean activate() throws InterruptedException { return !dsAPI.containsAll(true, Data.GLASSBLOWING_PIPE, Data.MOLTEN_GLASS); } @Override public void run() throws InterruptedException { if (!bank.isOpen()){ openBank(); }else{ if (sI().bank.depositAllExcept(Data.GLASSBLOWING_PIPE, Data.MOLTEN_GLASS)) { withdrawSupplys(); } } } private void openBank() { Entity banker = dsAPI.getWebBank().getClosestBank(); if (banker != null) { if (!banker.isVisible()) sI().camera.toEntity(banker, true); else{ banker.interact(WebBank.bankActions); dsAPI.conSleep(bank.isOpen(), 5000).sleep(); } } } private void withdrawSupplys() { if (!sI().inventory.contains(Data.GLASSBLOWING_PIPE)){ if (sI().bank.contains(Data.GLASSBLOWING_PIPE)) { sI().bank.withdraw(Data.GLASSBLOWING_PIPE, 1); dsAPI.conSleep(inventory.contains(Data.GLASSBLOWING_PIPE), 7000).sleep(); }else{ sI().log("Bank doesnt contain glassblowing pipe"); sI().stop(AIOCrafter.stop); } } else if (!sI().inventory.contains(Data.MOLTEN_GLASS)) { if (sI().bank.contains(Data.MOLTEN_GLASS)) { if (AIOCrafter.debug) { sI().bank.withdraw(Data.MOLTEN_GLASS, 10); }else{ sI().bank.withdrawAll(Data.MOLTEN_GLASS); } dsAPI.conSleep(inventory.contains(Data.MOLTEN_GLASS), 7000).sleep(); }else{ sI().log("Bank doesnt contain molten glass"); sI().stop(AIOCrafter.stop); } } }} private class Glassblow implements DsNode { @Override public String status() { return "Blowing: " +type.toString(); } @Override public boolean activate() throws InterruptedException { return true; } @Override public void run() throws InterruptedException { if (sI().bank.isOpen()) { sI().bank.close(); }else{ if (sI().tabs.open(Tab.INVENTORY)) { //add in moving item in inv if (AIOCrafter.waitTimer.getElapsed() > 3000) { selectOption(); } if (AIOCrafter.waitTimer.getElapsed() <= 3000) { mouseIsWaiting(hoverAmount, dsAPI.getWebBank().getClosestBank()); inventory.deselectItem(); } } } } private void mouseIsWaiting(int amount, Entity e) { if (sI().inventory.getAmount(Data.MOLTEN_GLASS) > amount) { if (sI().mouse.isWithinCanvas()) sI().mouse.moveOutsideScreen(); }else{ if (e != null) { if (!e.isVisible()) sI().camera.toEntity(e); else e.hover(); } } } public void selectOption() throws IllegalArgumentException, InterruptedException { if (enterAmount) { enterAmount(); } else{ if (type.getInterface(sI()) != null) { if (type.getInterface(sI()).interact("make x")) { AIOCrafter.keyboardTimer.reset(); enterAmount = true; AIOCrafter.sleep(200, 100); } }else{ if (sI().inventory.getSelectedItemName() == null) { sI().inventory.interact("use", Data.GLASSBLOWING_PIPE); dsAPI.conSleep(inventory.isItemSelected(), 7000); }else{ if (sI().inventory.getSelectedItemName().equalsIgnoreCase(Data.GLASSBLOWING_PIPE)) { sI().inventory.interact("use", Data.MOLTEN_GLASS); AIOCrafter.sleep(600, 100); }else{ sI().inventory.deselectItem(); } } } } } private int enterAmount() throws IllegalArgumentException, InterruptedException { hoverAmount = MethodProvider.random(2, 10); int number = MethodProvider.random(30, 50); if (dsAPI.isInterfaceOverChat()) { sI().keyboard.typeString(Integer.toString(number), true); enterAmount = false; AIOCrafter.sleep(1000, 100); }else{ while(AIOCrafter.keyboardTimer.getElapsed() > 3000) { enterAmount = false; break; } } return 300; } } }
-
The class is named InventoryTrackers (with an s), the interface name is InventoryTracker (without the s, found statically in the class.) How do you use it, you must create a new thread and initialize it. You must also end the thread once the script is done. Dont for get to implement InventoryTracker. Example: public class ScriptName extends Script implements InventoryTracker { private InventoryTrackers invTracker; //create a field } Next create a new thread, and initialize the tracker within the onStart Override public void onStart() throws InterruptedException { this.invTracker = new InventoryTrackers(this, this); new Thread(invTracker).start(); } Now within your script you should have the two method overrided. Keep the condition so it doesn't affect your script once its paused or not logged in. @Override public void handleAdded(Item item) { if (!bot.getScriptExecutor().isPaused() && client.isLoggedIn()) { } } @Override public void handleRemoved(Item item) { if (!bot.getScriptExecutor().isPaused() && client.isLoggedIn()) { } } Kill the thread once the script is over. @Override public void onExit() throws InterruptedException { invTracker.stop(); } if you have any question feel free to ask. if im missing something let me know.