-
Posts
5430 -
Joined
-
Last visited
-
Days Won
1 -
Feedback
100%
Posts posted by Acerd
-
-
gz?
i only made it for some plebs
-
1
-
-
1-7 makes gloves
7-9 makes boots
9-10 makes cowls
requested by: http://osbot.org/forum/topic/102807-crafting-till-level-10-script-request/?view=getnewpost
link: http://uppit.com/abbhqeuf9nu8
source:
import java.util.Optional; import java.util.function.BooleanSupplier; import org.osbot.rs07.api.Widgets; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "Acerd", info = "", logo = "", name = "1-10 crafting", version = 0) public class TenCrafting extends Script { private CachedWidget widget; private Armour armour; private boolean started; @Override public void onStart() throws InterruptedException { super.onStart(); started = true; } @SuppressWarnings("unchecked") @Override public int onLoop() throws InterruptedException { if (started) { if (getSkills().getStatic(Skill.CRAFTING) < 7) armour = Armour.LEATHER_GLOVES; else if (getSkills().getStatic(Skill.CRAFTING) < 9) armour = Armour.LEATHER_BOOTS; else armour = Armour.LEATHER_COWL; widget = new CachedWidget(armour.getArmour()); if (getSkills().getStatic(Skill.CRAFTING) >= 10) { stop(); } else if (canCraftArmour()) { if (isAmountPromptVisible()) { if (getKeyboard().typeString("" + MethodProvider.random(27, 99), true)) { new CSleep(() -> !canCraftArmour() || mustContinue(), 100_000).sleep(); } } else if (widget.getWidget(getWidgets()) != null) { if (widget.getWidget(getWidgets()).interact(armour.getOption())) { new CSleep(() -> !canCraftArmour() || mustContinue() || isAmountPromptVisible(), 100_000) .sleep(); } } else if (!isItemSelected("Needle")) { getInventory().interact("Use", "Needle"); } else { if (getInventory().interact("Use", "Leather")) { new CSleep(() -> widget.getWidget(getWidgets()) != null, 5_000).sleep(); } } } else { if (!getBank().isOpen()) openBank(); else if (getInventory().contains(i -> !i.getName().equals("Needle") && !i.getName().equals("Thread") && !i.getName().equals("Leather"))) { getBank().depositAllExcept("Needle", "Thread", "Leather"); } else if (!getInventory().contains("Needle")) { if (getBank().contains("Needle")) { getBank().withdraw("Needle", 1); } else { stop(); } } else if (!getInventory().contains("Thread")) { if (getBank().contains("Thread")) { getBank().withdrawAllButOne("Thread"); } else { stop(); } } else if (!getInventory().contains("Leather")) { if (getBank().contains("Leather")) { getBank().withdrawAll("Leather"); } else { stop(); } } else { getBank().close(); } } } return 300; } private final class CSleep extends ConditionalSleep { private final BooleanSupplier condition; public CSleep(final BooleanSupplier condition, int timeout) { super(timeout); this.condition = condition; } @Override public boolean condition() throws InterruptedException { return condition.getAsBoolean(); } } private class CachedWidget { private String text; private RS2Widget widget; public CachedWidget(final String text) { this.text = text; } public RS2Widget getWidget(final Widgets widgets) { if (widget == null) cacheWidget(widgets); return widget; } private void cacheWidget(final Widgets widgets) { RS2Widget widget = null; if (text != null) widget = widgets.getWidgetContainingText(text); this.widget = widget; } } private enum Armour { LEATHER_GLOVES("Gloves", "Make All pairs of Leather gloves"), LEATHER_BOOTS("Boots", "Make All pairs of Leather boots"), LEATHER_COWL("Cowl", "Make All Cowls"); private String armour, option; Armour(String armour, String option) { this.armour = armour; this.option = option; } private String getArmour() { return armour; } private String getOption() { return option; } } private boolean canCraftArmour() { return getInventory().contains("Thread") && getInventory().contains("Needle") && getInventory().contains("Leather") && !getBank().isOpen(); } private boolean isItemSelected(final String item) { String selectedName = getInventory().getSelectedItemName(); return selectedName != null && selectedName.equals(item); } private boolean mustContinue() { return getDialogues().isPendingContinuation(); } private boolean isAmountPromptVisible() { Optional<RS2Widget> amountWidget = getWidgets().getAll().stream() .filter(widg -> widg.getMessage().contains("Enter amount")).findFirst(); return amountWidget.isPresent() && amountWidget.get().isVisible(); } private void openBank() throws InterruptedException { if (getBank().open()) new CSleep(() -> getBank().isOpen(), 5_000).sleep(); } }
enjoy noobs
has not been tested so idk if it actually works
-
2
-
-
wincest
-
why is he not banned yet
He's refunding , I am holding the money for him and currently Yabit is the only one who has been refunded.
-
1
-
-
keep it alive
-
who ?
i am incestman , it was a meme for a few months when i said in the chatbox that i watched an anime with incest and everyone started calling me incestman and making fun of me
but the meme died
-
2
-
-
rip 2k16-2k16
-
1
-
-
incestman
-
incestman
-
my own
na jk i dont even bot
-
using what script?
my own. its in the SDN as well for free.
-
i bot 2-4 hours fletching sometimes w/o mirror mode , im 72 fletching rn havent been banned , its also a fresh lvl 3 acc
-
Which scripts?
-
swedish for "yes i stole your girl" ?
-
-
wouldnt that also make it impossible for osbuddy etc to show someone elses hp?
Probably , I'm not sure.
-
surely you could use Skills#getDynamic() and Skills#getStatic() to get the hp?
Most likely but he's talking about Character (as in other players)
-
The bot is currently down, please wait while the developers fix it. There is no ETA meaning no one really knows when its going to be fixed , therefore don't ask when its going to be back up.
-
5
-
-
why
-
id buy the cup if its only the icon
-
-
PS: I'll scam quit only if you offer 4 Ferrari's to complete cooks assistant. Of course i'll do the quest for you so go get those keys ready for me i'll be taking them home in 3 minutes.
that wouldnt be a scamquit though
-
inb4 someone gets twc again (beezmans)
-
hodor
Good night
in Spam/Off Topic
Posted
no one cares