Jump to content

Lemons

Lifetime Sponsor
  • Posts

    620
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Everything posted by Lemons

  1. The only connections that are not going to be proxied are to localhost, so you would have to create a local server to forward the request through. Other than that, no.
  2. If your using Dropbox, just make a link to the jar in the Dropbox folder. If it updates the link will point to the new version. On windows: https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ On linux/mac: https://www.cyberciti.biz/faq/creating-soft-link-or-symbolic-link/
  3. You can only write/read from %userprofile%/OSBot/Data for windows, or ~/OSBot/Data for *nix systems. Sounds like your making an auto-updater, make it an external application if you want to save to ~/OSBot/Scripts. Also if you want to get the user directory in a Script, use Script.getDirectoryData()
  4. As for how many you can run, go to https://www.cpubenchmark.net/ and look up your current CPU (or use a google search like "i7 7700k site:cpubenchmark.net"). Then, run the bot your planning on running, and get the % of CPU usage for the bot. Say its 5% of your current cpu and your CPUs benchmark on that site is 5000. 5000*0.05 = 250. So an i7 would roughly run 48 bots as its CPU benchmark is 12000. Also let the bots run a little while before taking a reading, java optimizes code as it runs so you'll want to let that stabilize before you take a reading. This again is a rough estimate of what you can expect. Also only server mobos support dual CPU configurations, so dual i7s are not gonna happen unless you have 2 machines. You'll want to look into server hardware if you want something like that but more hardware isn't bad (most server companies now use multiple cheap servers vs one massive expensive server, which is actually closer to a real life "super computer"). As for the dedi prices, CPU would need to be included as for me at least that tends to be the limiting factor.
  5. If you don't get an OOM Exception, it aint a leak.
  6. No problem, you can always add me on skype or discord (handles in profile) if you want to shoot questions at me. Always willing to help someone who is willing to learn
  7. the issue here is this: if (ResponseCode.isDisabledError(18) || ResponseCode.isDisabledError(4) ) { is basically equivalent to this: if ((4 == 4 || 4 == 18) && (18 == 4 || 18 == 18)) { Because ResponseCode.isDisabledError is (most likely) just: public static boolean isDisabledError(int responseCode) { return responseCode == ResponseCode.DISABLED_ACCOUNT || responseCode == 18; } So your mistake is thinking ResponseCode.isDisabledError knows the response code. It does not, it only checks the given response code (and your always giving 4 and 18, so its always true on any response code). Simple misunderstanding, those have bit all of us in the ass at some point. As for individual response codes, just allows you to fine tune responses to different types of connection issues. If you use them or not, that is up to you.
  8. Yes, the "Disabled or locked" statement will triggered on account disable, so you could just touch the file you need in that statement. I think your issue before was misunderstanding how ResponseCode.isDisabledError(int) works. LoginResponseCodeListener should work with osbots login handler for this situation. Just make sure you add the listener in the scripts onStart and all should be good. Also, connection errors could be for a multitude of reasons, look at @Chris's post to handle specific values (just compare responseCode to the # of the error for those).
  9. Not sure if I'm misunderstanding or not, but you need to make a response code listener to use them. You seem to just be compared them against a static integer. Sorry if I misunderstood. getBot().addLoginListener(new LoginResponseCodeListener() { @Override public void onResponseCode(int responseCode) throws InterruptedException { if (ResponseCode.isDisabledError(responseCode)) { // Disabled or locked } else if (ResponseCode.isConnectionError(responseCode)) { // Connection error, if custom login handler sleep or w/e } } }); Also, response codes can be returned on DC, such as when locked/banned.
  10. Should be picking em around , you've waited way too long.
  11. I don't really understand what you mean by "other tile" and all that, but usually these issues occur because distance checks are done with ints. So if its at an angle, the distance is 1.41~ which as an int is rounded to 1. So a tile south 1 tile and east 1 tile is the "same" distance as one just south of you, due to the rounding. Then its just a matter of which NPC is first/last in the internal entity list. Also, you should sleep after interacting until the player is animating/interacting, with a max time (see ConditionalSleep or the other implementations around the forums). Also you can check if the spot exists still using currentSpot.exists(), once the fishing spot is gone exists() will return false.
  12. These flags are what the client uses to calculate pathing. Basically, getTileFlags() returns a int[104][104] that contains the local regions "collision" data. Since OSRS is tile based, its pretty simple in the fact a tile is either blocked via walls or is blocked entirely (solid objects). You can also check if you can cast a spell or shoot a projectile through a wall. Lets look at an example "flag": Now it is an int, but to understand how it works we need the binary representation. 10000000 is the binary representation of 128, but we are looking at the "flags", aka a single bit. This flag has the 8th bit as 1, which we can compare with Region Flags. WALL_WEST is 0x80 in hex form which is 128, so this is our match. But what if multiple flags are flipped? This is where we use the bitwise AND operator: flags[localX][localY] & 128 == 0 What this does is takes the first integer, and 0's out all bits that are not 1 in the second integer (and only the 8th bit is 1 for 128). So this check tests if the 8th bit is 1 (it'll return 128, not 1) or 0 (which returns 0 because all other bits are 0'd). From here we can do this for all the different flags, which you can find using the link in the previous paragraph. Once you can test if there is a wall between nodes, you can connect them. Note that there are no walls surrounding solid objects, so you also need to test if that tile is walkable. This shows a generated "web" of tiles in game, generated from the tile flags. You'll notice there is a bunch of "web" in the open air space too, as this web is just generated by going through every tile and connecting it to its neighbors. All those tiles are not marked "UNWALKABLE" as in your example, and therefore would incorrectly return as reachable. For this use getMap().canReach(Position), which basically does a flood fill of the local region to see what you can get to from the current position.
  13. Should just have to check if any players are interacting with the NPC: public boolean isSplashed(NPC npc) { return !getPlayers().filter(p -> p.isInteracting(npc)).isEmpty(); } Will return true if someone is interacting/splashing the NPC.
  14. Games necklace to Burthorpe Games Room will put you just west of the slayer master if you don't like the hike, otherwise looks good!
  15. Lemons

    camera

    If I'm not mistaken, the highest pitch is 67. So if you wanted to be 100% sure, you could do: if (getCamera().getPitchAngle() < 67) { getCamera().toTop(); } That being said, the Camera.toTop() method most likely already does this check.
  16. The way I handle this is to eat when food will be 100% effective or if the character is under or at a certain threshold (I set this to monsters max hit). So say you eating trout, it heals 7 hp. If we have 25 hp, we heal at 18 hp or less. This keeps us near full HP which is generally what is wanted with food but won't waste food with %s. But say we were fighting something with a max hit of 5, we'd have a minimum threshold of 5 HP, so in case the monster hits us for max damage we can still live.
  17. Sure, give it to @Prozen. This is what I got for positions also: // On ship, near gangplank BRIMHAVEN = new Position(2763, 3238, 1), CATHERBY = new Position(2792, 3417, 1), PORT_KHAZARD = new Position(2674, 3141, 1), MUSA_POINT = new Position(2957, 3158, 1), PORT_SARIM = new Position(3038, 3189, 1), // Off ship, near gangplank DOCK_BRIMHAVEN = new Position(2760, 3238, 0), DOCK_CATHERBY = new Position(2792, 3414, 0), DOCK_PORT_KHAZARD = new Position(2674, 3144, 0), DOCK_MUSA_POINT = new Position(2954, 3158, 0), DOCK_PORT_SARIM = new Position(3038, 3192, 0), Rest you'll need someone who has an account that can access them.
  18. http://oldschoolrunescape.wikia.com/wiki/Charter_ship has all the information for cost for charter ships from A to B.
  19. I created this dump so I could calculate best equipment. It was created using a scrapper from the osrs wikia site, so the data isn't 100% accurate. Please let me know of any errors and I will fix them Format of armor (everything but weapons): THIRD_AGE_FULL_HELMET("3rd age full helmet", new CombatBonus(0, 0, 0, -5, -2), new CombatBonus(47, 49, 43, -3, 48), new OtherBonus(0, 0, 0, 0), true, true, 1, CombatType.MELEE, EquipmentSlot.HAT, new SkillRequirement() .add(Skill.DEFENCE, 65)) And weapons: THIRD_AGE_BOW("3rd age bow", new CombatBonus(0, 0, 0, 0, 80), new CombatBonus(0, 0, 0, 0, 0), new OtherBonus(0, 0, 0, 0), true, true, false, true, 1.5, 6, CombatType.RANGED, new SkillRequirement() .add(Skill.RANGED, 65) new CombatStyle("Accurate", AttackType.RANGED, AttackStyle.RANGED_ACCURATE), new CombatStyle("Rapid", AttackType.RANGED, AttackStyle.RANGED_RAPID), new CombatStyle("Longrange", AttackType.RANGED, AttackStyle.RANGED_LONGRANGE)) All enums can be found here: https://github.com/Lem0ns/QuantumAPI/tree/master/src/rip/quantum/enums/equipment
  20. As the others have said, canReach is how you'd detect if you can reach the given Entity/Position. Using this to find the closest reachable goblin would look like: getNpcs().closest(n -> "Goblin".equals(n.getName()) && getMap().canReach(n));
  21. Character.getInteracting() only works if the other Entity is a Character, aka a Player or NPC. To detect which rock is being mined, you can get a good guess via the players rotation. Note you can be mining a rock and not be near the rock under some circumstances, so don't consider this 100% reliable. private RS2Object getRock(Player p) { Position facing = p.getPosition(); int rotation = p.getRotation(); // Determine offset if (rotation < 256) facing = facing.translate( 0, -1); else if (rotation < 768) facing = facing.translate(-1, 0); else if (rotation < 1280) facing = facing.translate( 0, 1); else if (rotation < 1792) facing = facing.translate( 1, 0); else facing = facing.translate( 0, -1); // Search objects at facing position for "Rocks" return getObjects().get(facing.getX(), facing.getY()) .stream().filter(o -> "Rocks".equals(o.getName())) .findFirst().get(); } I haven't tested this code but should be a good start.
  22. Grid position is going to be a bad indicator, as it is simply a more accurate representation of the local position (think sub-positions). Each position has a 128x128 grid used for animations/moving characters. In your example: 6784 / 128 = 53 6272 / 128 = 49 Which is the same values for the local x/y. They seem static as the local/grid positions are the same relative to the loaded region. There are a few ways to handle instances areas. You can just use local position if it doesn't change from instance to instance, but if the region doesn't contain the entire instance, it won't work. You can find the furthest reachable east X and furthest reachable south Y, then use that as "0,0" and offset from that position. Or you can use an object that has a unique position, or a collection of objects, and get a point of reference from there. Edit: To add to IDontEB, you can use that but the API has a translate method for positions: Position offsetPos = barrier.getPosition().translate(-5, -2);
  23. Something like this could do what you need: final String[] DIALOGUE_OPTIONS = { "Dialogue option", }; void solveDialogue() throws InterruptedException { if (getDialogues().inDialogue()) { // In dialogue, try and find a widget for our option RS2Widget widget = getWidgets().getWidgetContainingText(DIALOGUE_OPTIONS); if (widget != null && widget.isVisible()) { // Widget exists and is visible, solve it getKeyboard().typeString(""+widget.getThirdLevelId(), false); sleep(2000); // Some sleep to prevent spamming } } } Just populate DIALOGUE_OPTIONS with the choices you want to make, and call "solveDialogue()" in onLoop.
×
×
  • Create New...