Eddie1205 1 Share Posted June 29, 2018 Heyy this is the first script I wrote. Hope you enjoy, and I'd appreciate any advice/constructive criticism anyone has Features: Steals silk from audy Stops to fight guards(if one attacks you) eats food(herring, because that's what I have) Drops all the silks when your inventory is full Some level of "antiban" (random "clock" values) package Main; import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.GameObject; import org.dreambot.api.wrappers.items.Item; @ScriptManifest(name = "silk stealer", description = "steals silk", category = Category.THIEVING, author = "Rose", version = 1.0) public class Main extends AbstractScript { private int state = -1; public void onStart(){ super.onStart(); state = 0; } public int onLoop() { if(state == 0){ Stealing(); } if(state == 1){ Dropping(); } if(getCombat().getHealthPercent() < Calculations.random(40, 60) && getInventory().contains("Herring")){ Eat(); }else{ state = 0; } return Calculations.random(800, 1200); } private void Stealing(){ GameObject stall = getGameObjects().closest("Silk stall"); if(!getInventory().isFull()){ if(!getLocalPlayer().isHealthBarVisible() && stall.distance() <= 3) { stall.interact("Steal-from"); } }else if(getLocalPlayer().isHealthBarVisible()){ sleepUntil(()-> !getLocalPlayer().isAnimating(), Calculations.random(10000, 20000)); }else{ state = 1; } } private void Dropping(){ if(getInventory().isFull()){ getInventory().dropAll("Silk"); }else{ state = 0; } } private void Eat(){ Item food = getInventory().get(item -> item != null); if(food != null) { food.interact("Eat"); sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(2000, 4000)); } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.