Everything posted by lisabe96
-
How would I detect obstacles on a path
I want to find out why we can't reach it, what obstacle is stopping us from reaching the position is what I want to know
-
How would I detect obstacles on a path
That's what I'm doing now, and sure it works great. But for my AI project I want to build a more general approach where we don't need to know the specific situation. Where I could send my bot to random coordinates and it would handle the obstacles it comes across. I would be able to write the code for that, I just need to find out what I mentioned in my original post. How do I let the pathfinder ignore obstacles and how do I know which kind of obstacle it is.
-
RandQm's Artificial Intelligence Bot
Working on some systems to give the user some more control over the bot. However the goal is AI, it would be annoying if you couldn't give your own input as a user when you want to.
-
How would I detect obstacles on a path
That won't tell us anything about any object's on the path, only that it can't be reached. But if you put 4 walls without a door, it won't be able to reach it either, we have no clue about any obstacles on why we can't reach it.
-
How would I detect obstacles on a path
Imagine that I want to run from lumbridge castle to the cows. IF you try to make a path to inside the cows area, the pathfinder will give you a path through the gate IF it's open. When the gate is not open, the pathfinder won't be able to get in and get stuck. I want to work out a general approach where the pathfinder would ignore that the gate is closed so I can codewise intercept it and handle it. However the pathfinder doesn't know that there's a gate when it's closed, it just treats it as an area where it can not pass/get in. I'm looking for ideas on how I could get doors/gates and let the pathfinder ignore it. Not looking for spoonfedding, I can work it out myself if only I had a lead. Thanks in advance for any help towards this.
-
RandQm's Artificial Intelligence Bot
No not at all, you missed the point. The point is that the bot will act on it's own and perform random tasks. (of what's available) This would result in a real player-like bot. if you'd let the bot run for a few days you would have skills trained, combat, items collected... Just like you would when playing yourself as a real player.
- RandQm's Artificial Intelligence Bot
-
RQCutter - Woodcutting with banking & various locations
Very plausible because: This was my first script I haven't gotten bugs reported so can't fix what I don't know I'm not member and used RSPS to get the data in member area's So feel free to post the bugs
-
Clicking on inventory items + antiban would be helpful :)
Because wine is 35gp and jug is ~85, with water 110 Its mad beginner cash
-
No entities found at lumbridge bank
I did yes
-
No entities found at lumbridge bank
It doesn't return "true" it just gives the area. It works perfect for other banks, however maybe there's an issue when the bank is not on the floor plane. At least it didnt find me being in the area so I assume there's something wrong with it
-
No entities found at lumbridge bank
It's part of the API Banks. contains all the banks and returns their area Banks.LUMBRIDGE_UPPER returns the bank area for lumbridge upper
-
No entities found at lumbridge bank
Works! Thanks a lot. So apparently there's something wrong with Banks.LUMBRIDGE_UPPER I'd assume.
-
No entities found at lumbridge bank
Movement.walkToArea(script, Banks.LUMBRIDGE_UPPER); new ConditionalSleep(5000, 6000) { @Override public boolean condition() throws InterruptedException { for (RS2Object bankBooth : script.getObjects().getAll()) { if (Banks.LUMBRIDGE_UPPER.contains(bankBooth)) { if (bankBooth.getName().equals("Bank booth")) { bankBooth.interact("Bank"); break; } } } return script.getBank().isOpen(); } }.sleep(); This works, however I can't be sure that the player is within the bank area, could be stuck behind the back wall or something. As you see this time there's no check on the z-axis which obviously is the problem @ni562 Yes I tried that, same issue
-
No entities found at lumbridge bank
Tried using area, same issue: Banks.LUMBRIDGE_UPPER.setPlane(2); if (Movement.walkToArea(script, Banks.LUMBRIDGE_UPPER)) { script.log("Arrived at destination"); } public static boolean walkToArea(Script script, Area area) { if (!script.myPlayer().isMoving()) { script.log("not moving"); if (area.contains(script.myPlayer())) { script.log("finished"); return true; } script.log("tryna move"); script.getWalking().webWalk(area.getRandomPosition()); } script.log("movement"); checkRunning(script); return false; } Doesn't recognize my player being inside the area, the plane reset
-
No entities found at lumbridge bank
This seems to be the issue, however it seems to reset the plane Position pos = Banks.LUMBRIDGE_UPPER.getRandomPosition(); Position bank = new Position(pos.getX(), pos.getY(), 2); if (Movement.walkTo(script, bank)) { script.log("here"); } This will print out a plane of 2, however when going to the walkTo method it prints out 0 as plane: public static boolean walkTo(Script script, Position pos) { return walkTo(script, pos, false); } public static boolean walkTo(Script script, Position pos, boolean handleDoor) { if (!script.myPlayer().isMoving()) { script.log(script.myPosition().getZ() + ", " + pos.getZ()); if (script.myPosition().distance(pos) < 3) { script.log("in distance"); if (handleDoor) { openDoor(script, pos); } return true; } script.getWalking().webWalk(pos); } checkRunning(script); return false; } For some reason it resets to 0
-
No entities found at lumbridge bank
Nope ^ I think it's not the actual banking that is the problem becauseeee It doesnt recognize my player being in the bank area in the first place. I'm guessing that that is my issue, it doesnt return my player being in the bank area. Though the player is, no clue how thats possible though
-
No entities found at lumbridge bank
I know, originally I checked for the banker: NPC npc = getNpcs().closest("Banker"); if (npc != null) { npc.interact("Bank"); } } But as that didnt work I tried the bankbooth, then I tried looping through the nearby objects and then I came here. None of the given solutions got it working yet This is what I have now: (doesnt work) if (Banks.LUMBRIDGE_UPPER.contains(myPlayer())) { log("in the bank"); //Doesnt print if (!getBank().isOpen()) { try { if (getBank().open()) { new ConditionalSleep(5000, 6000) { @Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep(); } } catch (InterruptedException e) { e.printStackTrace(); } } } else { getWalking().webWalk(Banks.LUMBRIDGE_UPPER.getRandomPosition()); }
-
No entities found at lumbridge bank
That's what I originally tried
-
No entities found at lumbridge bank
I did now and It didn't work. Logged the stages and it never even found my player being in the bank area.
-
Explv's Tutorial Island [Free] [Random Characters]
Got stuck at chickens, it didn't attack them. For the rest it worked great
-
No entities found at lumbridge bank
Trying to bank at the lumbridge bank at the 2nd floor of the caslte. However when I tried to grab a banker or a bank booth with .closest("Banker"); It didn't find the bankbooth/banker. So I tried looping myself through all the RS2Objects in the area to find a bank booth, but it returned nothing. Am I missing something? for (RS2Object obj : script.getObjects().getAll()) { if (obj.getPosition().distance(script.myPosition()) < 10) { script.log(obj.getName()); if (obj.hasAction("Bank")) { obj.interact("Bank"); return true; } } }
-
[Free] Cook's Assistant Quest completer
Haha thanks, will update that when I fixed some possible bugs if any are found/reported.
-
whats your favorite?
Boardwalk Empire is my all time favorite, currently watching Person of interest, really good imo
-
[Free] Cook's Assistant Quest completer
Cook's assistant quest completer By RandQm Features: Completes whole the quest on it's own Handles obstacles as doors/gates/... Toggles running when energy is available Uses webwalking Reasons to use this: Because why not Only takes 5 minutes Because it is believed having completed quests makes your account more legit (less chance on ban) Instructions: Do not have the supplies ready in your inventory, just start empty. Stand in the Lumbridge kitchen when starting the bot Do not interrupt the bot, it won't be able to pick up progress if you logged out in the middle of something Click here to download the JAR Code for geeks: package rqcooksassistant; import java.awt.Color; import java.awt.Graphics2D; import java.awt.RenderingHints; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Message; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; /** * * @author randqm * */ @ScriptManifest(author = "RandQm", info = "Cooks Assistant", name = "RQ Cooks assistant", version = 1.0, logo = "") public class Main extends Script { private String status = "Starting..."; private int stage = -1; private long startTime; private void updateStage(int stage, String status) { this.stage = stage; this.status = status; } @Override public void onMessage(Message message) { switch (message.getMessage()) { case "You put the grain in the hopper.": updateStage(13, "Operating hopper controls."); break; case "You operate the hopper. The grain slides down the chute.": updateStage(14, "Going to the flour bin."); break; } } @Override public int onLoop() { log("stage: " + stage); switch (stage) { case -1: startTime = System.currentTimeMillis(); updateStage(stage + 1, "Talking to cook."); break; case 0: NPC npc = npcs.closest("Cook"); if (npc != null) { npc.interact("Talk-to"); updateStage(stage + 1, "Handling conversation with cook."); } break; case 1: case 2: if (getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); } else if (getDialogues().isPendingOption()) { getDialogues().selectOption(1); updateStage(stage + 1, "Handling conversation with cook."); } break; case 3: if (getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); } else if (getDialogues().isPendingOption()) { getDialogues().selectOption(4); updateStage(stage + 1, "Handling conversation with cook."); } break; case 4: if (!getDialogues().isPendingContinuation()) { break; } getDialogues().clickContinue(); updateStage(stage + 1, "Take pot."); break; case 5: GroundItem pot = getGroundItems().closest("Pot"); if (pot != null) { pot.interact("Take"); updateStage(stage + 1, "Head to wheat field."); } break; case 6: if (walkTo(new Position(3163, 3289, 0))) { if (checkDoor()) { updateStage(stage + 1, "Pick wheat."); } } break; case 7: RS2Object wheat = getObjects().closest("Wheat"); if (wheat != null) { wheat.interact("Pick"); updateStage(stage + 1, "Head to mill."); } break; case 8: if (!inventory.contains("Grain")) { break; } if (walkTo(new Position(3162, 3290, 0))) { if (checkDoor()) { updateStage(stage + 1, "Head to mill."); } } break; case 9: if (walkTo(new Position(3166, 3302, 0))) { if (checkDoor()) { updateStage(stage + 1, "Going to the hopper."); } } break; case 10: updateStage(stage + (climbLadder(true) ? 1 : -1), "Going to the hopper."); break; case 11: if (myPosition().getZ() != 1) { break; } updateStage(stage + (climbLadder(true) ? 1 : -1), "Putting grain into hopper."); break; case 12: if (myPosition().getZ() != 2) { break; } RS2Object hopper = getObjects().closest("Hopper"); if (hopper != null) { getInventory().interact("Use", "Grain"); if (!getInventory().isItemSelected()) { break; } hopper.interact("use"); } break; case 13: RS2Object controls = getObjects().closest("Hopper controls"); if (controls != null) { controls.interact("Operate"); } break; case 14: updateStage(stage + (climbLadder(false) ? 1 : -1), "Going to the flour bin."); break; case 15: if (myPosition().getZ() != 1) { break; } updateStage(stage + (climbLadder(false) ? 1 : -1), "Putting flour into pot."); break; case 16: if (myPosition().getZ() != 0) { break; } RS2Object flourBin = getObjects().closest("Flour bin"); if (flourBin != null) { getInventory().interact("Use", "Pot"); if (!getInventory().isItemSelected()) { break; } flourBin.interact("use"); updateStage(stage + 1, "Heading to chickens."); } break; case 17: if (!inventory.contains("Pot of flour")) { break; } if (checkDoor()) { updateStage(stage + 1, "Heading to chickens."); } break; case 18: if (walkTo(new Position(3238, 3295, 0))) { if (checkDoor()) { updateStage(stage + 1, "Heading to chickens."); } } break; case 19: if (walkTo(new Position(3230, 3298, 0))) { updateStage(stage + 1, "Taking an egg."); } break; case 20: GroundItem egg = getGroundItems().closest("Egg"); if (egg == null || !egg.exists()) { break; } egg.interact("Take"); updateStage(stage + 1, "Heading to bucket."); break; case 21: if (!getInventory().contains("Egg")) { break; } if (walkTo(new Position(3231, 3291, 0))) { if (checkDoor()) { updateStage(stage + 1, "Taking bucket."); } } break; case 22: GroundItem bucket = getGroundItems().closest("Bucket"); if (bucket == null || !bucket.exists()) { break; } bucket.interact("Take"); updateStage(stage + 1, "Heading to diary cow."); break; case 23: if (!getInventory().contains("Bucket")) { break; } if (walkTo(new Position(3236, 3295, 0))) { if (checkDoor()) { updateStage(stage + 1, "Heading to diary cow."); } } break; case 24: if (walkTo(new Position(3252, 3267, 0))) { if (checkDoor()) { updateStage(stage + 1, "Milking diary cow."); } } break; case 25: if (walkTo(new Position(3255, 3274, 0))) { RS2Object cow = getObjects().closest("Dairy cow"); if (cow != null) { cow.interact("Milk"); updateStage(stage + 1, "Heading back to cook."); } } break; case 26: if (!getInventory().contains("Bucket of milk")) { break; } if (walkTo(new Position(3253, 3267, 0))) { if (checkDoor()) { updateStage(stage + 1, "Talking to cook."); } } break; case 27: if (walkTo(new Position(3208, 3213, 0))) { NPC cook = getNpcs().closest("Cook"); if (cook != null) { cook.interact("Talk-to"); updateStage(stage + 1, "Finishing quest."); } } break; case 28: if (getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); } else { getWidgets().closeOpenInterface(); updateStage(stage + 1, "Finished quest. Thanks for using my script."); stop(); } break; } return 600; } @Override public void onPaint(Graphics2D graphics) { Graphics2D g = (Graphics2D) graphics; g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF)); g.setColor(Color.CYAN); g.drawString("Status: " + status, 10, 310); g.drawString("Running: " + formatTime(System.currentTimeMillis() - startTime), 10, 330); } private boolean checkDoor() { boolean opened = false; for (RS2Object obj : objects.getAll()) { if (obj.getPosition().distance(myPosition()) < 2) { if (obj.hasAction("Open")) { obj.interact("Open"); opened = true; } } } if (opened) { log("Opened closable"); return false; } return true; } private String formatTime(long ms){ long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } private boolean climbLadder(boolean up) { RS2Object ladder = getObjects().closest("Ladder"); if (ladder != null) { ladder.interact(up ? "Climb-up" : "Climb-down"); return true; } return false; } private boolean walkTo(Position pos) { if (!myPlayer().isMoving()) { boolean opened = false; for (RS2Object obj : objects.getAll()) { if (obj.getPosition().distance(myPosition()) < 3) { if (obj.hasAction("Open")) { obj.interact("Open"); opened = true; } } } if (opened) { log("Opened closable"); return false; } if (pos.distance(myPosition()) > 2) { getWalking().webWalk(pos); return false; } log("Finished walking"); return true; } if (!getSettings().isRunning()) { if (getSettings().getRunEnergy() > 10) { getSettings().setRunning(true); } } return false; } }