codercal 2 Share Posted January 10, 2020 (edited) I am currently trying to create a bot for the Rune Mysteries Quest. I was able to use web walking to get to the room where the quest is started in Lumbridge Castle. Using code like below. private Area loc = new Area(3209, 3220, 3212,3224, 1); while (!loc.contains(getLocalPlayer())){ log("Head to " + STATE); getWalking().walk(loc.getRandomTile()); sleepUntil(() -> getLocalPlayer().isStandingStill(), Calculations.random(1000, 2000)); } I am now trying to leave this room (image at bottom) to head to the Wizard's Tower, however, after trying multiple new Area's my character will not move. From reading other posts i believe this is because it can't find a path? I then tried using localPath, even just to move 2 tiles towards the door, however it gives me a warning that the "Local path list is empty! Cannot proceed!" even though I can see there are tiles in it when printed originally. Console output is attached at bottom. Below is all of my code so far! I have written some simple rune-crafting and cow killing scripts and haven't run into an issue like this moving around the world. Ideally I would just be able to use the web walker. Any help would be appreciated! package main; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.walking.path.impl.LocalPath; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.NPC; @ScriptManifest(category = Category.QUEST, name = "Rune Mysteries", author = "Codercal", version = 3) public class Main extends AbstractScript { private State STATE = State.GO_WIZARD_TOWER; private Area dukeHoracio = new Area(3209, 3220, 3212,3224, 1); // coordinates for duke horacio private Area sedridor = new Area(3102, 9569,3107,9574, 0); // coordinates in Wizard's Tower LocalPath<Tile> localPath = new LocalPath<>(this); @Override public void onStart() { log("Start Rune Mysteries"); getSkillTracker().start(); localPath.add(new Tile(3208,3222, 1)); localPath.add(new Tile(3206,3226, 1)); localPath.add(new Tile(3215,3221)); localPath.add(new Tile(3203,3214)); } private enum State{ START_QUEST, GO_WIZARD_TOWER, } @Override public int onLoop() { if (STATE == State.START_QUEST) { goTo(dukeHoracio); NPC duke = getNpcs().closest("Duke Horacio"); //Get through all dialogue while (!getDialogues().canContinue()) { duke.interact(); } getDialogues().continueDialogue(); sleep(1000); if (getWidgets().getWidgetChild(219, 1) != null) { getWidgets().getWidgetChild(219, 1, 1).interact(); sleep(1000); } while (getDialogues().canContinue()) { getDialogues().continueDialogue(); sleep(1000); } if (getWidgets().getWidgetChild(219, 1) != null) { getWidgets().getWidgetChild(219, 1, 1).interact(); sleep(1000); } while (getDialogues().canContinue()) { getDialogues().continueDialogue(); sleep(1000); } STATE = State.GO_WIZARD_TOWER; } if (STATE == State.GO_WIZARD_TOWER) { log(localPath.toString()); localPath.walk(); sleep(2000); STATE = State.GO_WIZARD_TOWER; } return 0; } // Runs to a given area public void goTo(Area loc){ while (!loc.contains(getLocalPlayer())){ log("Head to " + STATE); getWalking().walk(loc.getRandomTile()); sleepUntil(() -> getLocalPlayer().isStandingStill(), Calculations.random(1000, 2000)); } } } Edited January 10, 2020 by codercal Link to comment Share on other sites More sharing options...
Defiled 415 Share Posted January 10, 2020 (edited) o.O why the while loops?? Don't you know that the script as a whole is inside a loop called the "onLoop"? You can just use if statement.. also instead of all this crap: sleepUntil(() -> getLocalPlayer().isStandingStill(), Calculations.random(1000, 2000)); use the shouldWalk method.. ex: if(!exampleArea.contains(getLocalPlayer()) { if(getWalking().shouldWalk(7)) getWalking().walk(exampleArea.getRandomTile()); } Also, since this is quest script.. I advise you to use PlayerSettings configs.. checkout Articron's guide on them.. Also for WidgetChildren.. I strongly advise you to create a WC Object.. null check it then execute.. ex: WidgetChild wc = getWidgets().getWidgetChild(int widget, int widgetChild); if(wc != null && wc.isVisible()) wc.interact("..."); Also an advice on Areas with different tile levels.. Area area = new Area(new TIle(x,y,z), new Tile(x,y,z)); Also keep your onLoop tidy.. this is hard to read through Edited January 10, 2020 by Defiled Link to comment Share on other sites More sharing options...
Nuclear Nezz 1969 Share Posted January 10, 2020 The basement of the wizard tower isn't within the web, so you'll need to walk to the ladder on the overworld level of the tower, then go down the ladder yourself. Once down the ladder it's local so you can use walk to get to the wizard himself. Link to comment Share on other sites More sharing options...
codercal 2 Author Share Posted January 10, 2020 @Defiled Thanks for the tips, still improving. @Nuclear Nezz Thanks I'll try that, however i tried using web walking with an area on the first floor of Lumbridge Castle and my character still would not leave this room and i'm not sure why if it's in the web? Also am i using localpath here correctly? Defiled and Nuclear Nezz 1 1 Link to comment Share on other sites More sharing options...
Nuclear Nezz 1969 Share Posted January 10, 2020 Well, I can see that you're going from floor 1 to floor 0 in your four tiles on the local path, when you're doing local path specifically it does not check for new obstacles within the path, it just tries to walk directly to those. I'm wondering if it's seeing the 4th tile as being able to walk to it because of no obstacles, but then not walking to it because on floor 0 Try removing the last two tiles and running that, see if it'll walk just the two tiles on floor 1. That is mostly the correct way to use local paths, but when we generate a local path it's every tile between you and your destination, so you can accurately find where you are and where you should be walking next. Edit: just checked, it should have ignored the last 2 tiles since you can't walk to them (different z) and walked to the second tile in the path anyway. I'd still suggest maybe trying to remove the floor 0 tiles and adding more into your floor 1 tiles Defiled 1 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