Diddy 265 Share Posted September 5, 2015 Thats true I can learn some things from just looking at code but having a tutorial putting it to use in a video demonstration is always nice. AndIDontKnowHowToLookAtOtherScriptsCode. try this public final String[] items = { "Big bones", "Limpwurt root" } // items you want to pick up puplic int onLoop() { GroundItem stuff = GroundItems.getNearest(items); //rest of the code } got this from http://dreambot.org/forums/index.php/topic/1963-complete-varrockge-pvp-world-looter-source/ Link to comment Share on other sites More sharing options...
Pug 130 Share Posted September 10, 2015 first time ive looked at this thread in a while and it continues to grow and get better by the day, nice one dude Link to comment Share on other sites More sharing options...
the0fox 0 Share Posted September 10, 2015 i want to request a basic fighter script Link to comment Share on other sites More sharing options...
Metallicblank 0 Share Posted September 22, 2015 I've been trying to follow this guide. I've gotten to the sleep timer. I put it into the code just as you have. Then once I compile the script still spam clicks the tree and doesn't wait. I'm not sure what I am getting wrong? package BasicWoodcutter; import org.dreambot.api.methods.filter.Filter; 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 java.awt.*; /** * Created by metal on 9/21/2015. */ @ScriptManifest(category = Category.WOODCUTTING, name = "Basic WoodCutter", author = "Metal", version = 1.0) public class MainClass extends AbstractScript{ @Override public void onStart (){ log("Hi"); } @Override public int onLoop() { GameObject tree = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Tree")); if(tree.interact("Chop down")){ int countLog = getInventory().count("Logs"); sleepUntil(() -> getInventory().count("Logs") > countLog, 8000); } return 600; } @Override public void onExit () { } @Override public void onPaint(Graphics graphics) { } } Any help would be appreciated. Also thank you for making these! Link to comment Share on other sites More sharing options...
Computor 178 Author Share Posted September 22, 2015 I've been trying to follow this guide. I've gotten to the sleep timer. I put it into the code just as you have. Then once I compile the script still spam clicks the tree and doesn't wait. I'm not sure what I am getting wrong? package BasicWoodcutter; import org.dreambot.api.methods.filter.Filter; 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 java.awt.*; /** * Created by metal on 9/21/2015. */ @ScriptManifest(category = Category.WOODCUTTING, name = "Basic WoodCutter", author = "Metal", version = 1.0) public class MainClass extends AbstractScript{ @Override public void onStart (){ log("Hi"); } @Override public int onLoop() { GameObject tree = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Tree")); if(tree.interact("Chop down")){ int countLog = getInventory().count("Logs"); sleepUntil(() -> getInventory().count("Logs") > countLog, 8000); } return 600; } @Override public void onExit () { } @Override public void onPaint(Graphics graphics) { } } Any help would be appreciated. Also thank you for making these! Fixed Metallicblank 1 Link to comment Share on other sites More sharing options...
NZL 13 Share Posted October 26, 2015 Nice tut, Instead of sleeping for 8000 can we randomise it by saying calculation.random(5000,8000)? So everything is randomised?Assuming the calculation.random selects a number between 5 and 8 seconds? Link to comment Share on other sites More sharing options...
Diddy 265 Share Posted October 26, 2015 Nice tut, Instead of sleeping for 8000 can we randomise it by saying calculation.random(5000,8000)? So everything is randomised? Assuming the calculation.random selects a number between 5 and 8 seconds? yep Link to comment Share on other sites More sharing options...
Before 95 Share Posted November 11, 2015 Why is Computer banned? Link to comment Share on other sites More sharing options...
milkmotel 0 Share Posted December 14, 2015 When you use the script if(tree != null && tree.interact("Chop down")) is it actually doing tree.interact even though it's a condition for the if statement? that's the only bit of code that's confusing me. I have no experience with Java so I don't know how this works Link to comment Share on other sites More sharing options...
infallible 28 Share Posted December 14, 2015 When you use the script if(tree != null && tree.interact("Chop down")) is it actually doing tree.interact even though it's a condition for the if statement? that's the only bit of code that's confusing me. I have no experience with Java so I don't know how this works Yes, it will perform a nullcheck first and then interact "Chop down" with the tree. It will then only continue to the next line of code if BOTH conditions were met. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now