Jump to content

Alek

Ex-Staff
  • Posts

    7878
  • Joined

  • Last visited

  • Days Won

    202
  • Feedback

    100%

Everything posted by Alek

  1. Version 2.4.64: -Fixed human input enabling/disabling -Removed Antiban class (forgot to last update) -Patched an issue with Chatbox isVisible(), may fix some issues with world hopping
  2. Command-line: Almost complete with command-line arguments. This update I added the ability to login automatically, bypassing the Boot UI along with setting a proxy (optional). Here is the current list: Summer Cleanup: Removed the following: Antiban class LocalWalker class < Walking Client isMirrorMode() Client isVIP() Bot setMouseSpeed() Bot getMouseSpeed() Bank getAbsoluteSlotPosition() Camera toEntity(Entity, boolean) Camera toPosition(Position, boolean) Client getCurrentWorld() < World Client getRawTooltip() < MenuAPI Client getTooltip() < MenuAPI Mouse getMouseSpeed() Mouse setMouseSpeed() Settings toggleRoofs() Utilities convertIntegers() Utilities convertStrings() Utilities isMirrorMode() Scripters were notified on 19 April 16 of the Summer Cleanup. Additional: A few changes were made to prevent Scripters from touching things that would affect either the entire client or other scripts. Most notably, GameConstants has been hidden and setHumanInputEnabled has had the functionality stripped. For the human input, there are a lot of other ways to achieve the same result. Version 2.4.64: -Fixed human input enabling/disabling -Removed Antiban class (forgot to last update) -Patched an issue with Chatbox isVisible(), may fix some issues with world hopping Version 2.4.65: -Patched small issue in Worlds class -Added Client isHumanInputEnabled() -AutoLogin now re-attempts initially with a quick-login (~20 seconds) if you were disconnected from world hopping -AutoLogin various improvements -Boot login flag allows names with spaces. Replace the space in your name with an underscore
  3. Alek

    2.4.62

    What do you need INodeRouteFinder for?
  4. Alek

    2.4.62

    Which script are you trying to pick?
  5. Alek

    2.4.62

    Fixed the only one client issue, if you are still receiving an error please post below. Additionally some web walking issues were fixed. Please give scripters some time to update their scripts, a lot of code was changed.
  6. What??? In regards to your issue, Swing (what I'm, using for the UI) combined with W10 and high resolutions is a nightmare. What resolution are you at?
  7. I'm still working on it.
  8. Song: Cashed out Lyric: how do you like them apples, microsoft, wipe them off Song: Swag surfin' Lyric: i leave that pussy micro-soft like windows vista He supports Microsoft and the Windows line of products. Obviously he is technologically inclined to subliminally lead this generation of Apple hipsters to the greater good. PC master race. Please discuss below.
  9. Vanilla swing list things
  10. Scotty is a good boy.
  11. Alek

    2.4.60

    Yes, this will be fixed for .61. Thank you.
  12. Alek

    2.4.60

    No, its still on the todo list. The bug fixes were more along improvements; for instance the default widget closing searches only for widgets in the main game screen clip, etc.
  13. Alek

    2.4.60

    bug fixes and web walking changes
  14. Without using web walking (not accurate if you have banks close to each other): banks.sort(new Comparator<Area>() { public int compare(Area bank1, Area bank2) { return bank1.getRandomPosition().distance(myPosition()) - bank2.getRandomPosition().distance(myPosition()); } }); First index in the collection will be to your closest position, last would be furthest.
  15. I normally don't write like that but it's nice if it's a one-class script, really logical and easy on the eyes.
  16. Runs multiple games for me; I have 19 tickets in one run so far.
  17. You also get updates automatically if I make any.
  18. Originally I wanted to do that or make a Catapult Sniper; it would grab a list of players, adjust coordinates, and fire. Not enough time though, have to get back to some of my real work now.
  19. Haven't seen a Castle Wars script on either here or a competitor bot. This is something I wrote up real quick; you could just AFK outside the spawn room but I added some basic logic to prevent some reports. Features: -Waits for game -Grabs bandages, finds enemies, attacks people -Leaves spawn zone, walks to high-traffic areas This is an open-source script, written so its easy to understand for some of you newer guys. If you are a VIP+ member you get the convenience of the script being on the SDN. Source: import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.util.GraphicUtilities; import org.osbot.rs07.api.util.LocalPathFinder; import org.osbot.rs07.event.InteractionEvent; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.awt.*; import java.util.Collection; import java.util.LinkedList; import java.util.Optional; import java.util.stream.Collectors; /** * Created by Alek on 5/8/2016. */ @ScriptManifest(name = "Castle Wars", author = "Alek", version = 1.0, info = "Castle Wars Script", logo = "") public class CastleWars extends Script { ScriptState scriptState = ScriptState.PENDING; private Team myTeam = null; private Player enemyPlayer = null; private final Area ZAMORAK_SPAWN_ROOM = new Area(2368, 3127, 2376, 3135).setPlane(1); private final Area SARADOMIN_SPAWN_ROOM = new Area(2423, 3072, 2431, 3080).setPlane(1); private final Area ZAMORAK_WAITING_ROOM = new Area(2403, 9510, 2437, 9543); private final Area SARADOMIN_WAITING_ROOM = new Area(2363, 9478, 2394, 9502); private final Area SARADOMIN_SPAWN_AREA = new Area(2420, 3072, 2431, 3083).setPlane(1); private final Area ZAMORAK_SPAWN_AREA = new Area(2368, 3124, 2379, 3135).setPlane(1); private final Position ZAMORAK_STAIRS_DOWN = new Position(2380, 3127, 1); private final Position SARADOMIN_STAIRS_DOWN = new Position(2419, 3080, 1); private final Position ZAMORAK_LADDER_DOWN = new Position(2378, 3134, 1); private final Position SARADOMIN_LADDER_DOWN = new Position(2421, 3073, 1); private final Position ZAMORAK_BARRIER = new Position(2377, 3131, 1); private final Position SARADOMIN_BARRIER = new Position(2422, 3076, 1); private final Position CENTER_ISLAND = new Position(2400, 3104, 0); private final Position ZAMORAK_CASTLE_FRONT = new Position(2387, 3115, 0); private final Position SARADOMIN_CASTLE_FRONT = new Position(2411, 3092, 0); private enum Team { SARADOMIN(1), ZAMORAK(2); int teamId; Team(int teamId) { this.teamId = teamId; } int getTeamId() { return teamId; } } private enum ScriptState {FIND_PORTAL, WAIT_FOR_GAME, GRAB_SUPPLIES, LEAVE_SPAWN, FIND_OPPONENT, FIGHT_OPPONENT, PENDING} @Override public void onPaint(Graphics2D g) { g.setColor(Color.WHITE); g.drawString(scriptState.name(), 10, 120); } @Override public int onLoop() { scriptState = getScriptState(); switch (scriptState) { case FIND_PORTAL: myTeam = null; Optional<RS2Object> optionalPortal = getObjects().getAll().stream().filter(o -> o.getName().equals("Guthix Portal")).findFirst(); if (optionalPortal.isPresent()) { if (optionalPortal.get().interact("Enter")) { new ConditionalSleep(5000, 500) { @Override public boolean condition() throws InterruptedException { return SARADOMIN_WAITING_ROOM.contains(myPlayer()) || ZAMORAK_WAITING_ROOM.contains(myPlayer()); } }.sleep(); } } else { log("Please start the script in Castle Wars!"); stop(false); } break; case WAIT_FOR_GAME: if (getDialogues().isPendingOption()) { getDialogues().selectOption("Yes please!"); } else if (myPlayer().getArea(2).getRandomPosition().interact(getBot(), "Walk here")) { getMouse().moveOutsideScreen(); new ConditionalSleep(MethodProvider.random(30000, 60000), 3000) { @Override public boolean condition() throws InterruptedException { return getDialogues().isPendingOption() || (SARADOMIN_SPAWN_ROOM.contains(myPosition()) || ZAMORAK_SPAWN_ROOM.contains(myPosition())); } }.sleep(); } break; case GRAB_SUPPLIES: Optional<RS2Object> optionalTable = getObjects().getAll().stream().filter(o -> o.getName().equals("Table") && (ZAMORAK_SPAWN_ROOM.contains(o) || SARADOMIN_SPAWN_ROOM.contains(o))).findFirst(); if (optionalTable.isPresent()) { for (int i = 0; i < MethodProvider.random(1, 5); i++) { if (optionalTable.get().interact("Take-5")) { final int slots = getInventory().getEmptySlots(); new ConditionalSleep(5000, 500) { @Override public boolean condition() throws InterruptedException { return slots != getInventory().getEmptySlots(); } }.sleep(); } } } break; case LEAVE_SPAWN: boolean successfullyLeftSpawnArea = false; if (SARADOMIN_SPAWN_ROOM.contains(myPosition()) || ZAMORAK_SPAWN_ROOM.contains(myPosition())) { Optional<RS2Object> optionalBarrier; if (getMyTeam().equals(Team.ZAMORAK)) optionalBarrier = getObjects().getAll().stream().filter(o -> o.getPosition().equals(ZAMORAK_BARRIER)).findFirst(); else optionalBarrier = getObjects().getAll().stream().filter(o -> o.getPosition().equals(SARADOMIN_BARRIER)).findFirst(); if (optionalBarrier.isPresent()) { if (optionalBarrier.get().interact("Pass")) { new ConditionalSleep(5000, 500) { @Override public boolean condition() throws InterruptedException { return !SARADOMIN_SPAWN_ROOM.contains(myPosition()) && !ZAMORAK_SPAWN_ROOM.contains(myPosition()); } }.sleep(); } } } else { Optional<RS2Object> optionalStairs; if (getMyTeam().equals(Team.ZAMORAK)) optionalStairs = getObjects().getAll().stream().filter(o -> o.getPosition().equals(ZAMORAK_STAIRS_DOWN)).findFirst(); else optionalStairs = getObjects().getAll().stream().filter(o -> o.getPosition().equals(SARADOMIN_STAIRS_DOWN)).findFirst(); if (optionalStairs.isPresent()) { if (!isPathBlocked(optionalStairs.get())) { if (optionalStairs.get().interact("Climb")) { successfullyLeftSpawnArea = true; new ConditionalSleep(5000, 500) { @Override public boolean condition() throws InterruptedException { return myPosition().getZ() == 0; } }.sleep(); } } else { Optional<RS2Object> optionalLadder; if (getMyTeam().equals(Team.ZAMORAK)) optionalLadder = getObjects().getAll().stream().filter(o -> o.getPosition().equals(ZAMORAK_LADDER_DOWN)).findFirst(); else optionalLadder = getObjects().getAll().stream().filter(o -> o.getPosition().equals(SARADOMIN_LADDER_DOWN)).findFirst(); if (optionalLadder.isPresent()) { if (!isPathBlocked(optionalLadder.get())) { if (optionalLadder.get().interact("Climb-down")) { successfullyLeftSpawnArea = true; new ConditionalSleep(5000, 500) { @Override public boolean condition() throws InterruptedException { return myPosition().getZ() == 0; } }.sleep(); } } else { NPC barricade = getNpcs().closest("Barricade"); if (barricade != null) { if (barricade.interact("Attack")) { new ConditionalSleep(5000, 500) { @Override public boolean condition() throws InterruptedException { return !barricade.exists(); } }.sleep(); } } } } } } if (successfullyLeftSpawnArea) { switch (MethodProvider.random(0, 2)) { case 1: getWalking().webWalk(CENTER_ISLAND); break; case 2: if (getMyTeam().equals(Team.ZAMORAK)) getWalking().webWalk(ZAMORAK_CASTLE_FRONT); else getWalking().webWalk(SARADOMIN_CASTLE_FRONT); break; } } } break; case FIND_OPPONENT: Collection<Player> enemies = getPlayers().getAll().stream().filter(p -> p.getTeam() != getMyTeam().getTeamId()).collect(Collectors.toList()); if (!enemies.isEmpty()) { for (Player enemy : enemies) { Rectangle enemyBounds = GraphicUtilities.getModelBoundingBox(getBot(), enemy.getGridX(), enemy.getGridY(), enemy.getZ(), enemy.getModel()); if (getMap().canReach(enemy)) { if (enemyBounds.intersects(GraphicUtilities.MAIN_SCREEN_CLIP)) { InteractionEvent event = new InteractionEvent(enemy, "Attack").setWalkTo(false); execute(event); if (event.hasFinished()) { enemyPlayer = enemy; break; } } else if (MethodProvider.random(0, 1) == 1) { getWalking().walk(enemy); break; } } } } break; case FIGHT_OPPONENT: if (enemyPlayer.exists()) { if (myPlayer().isInteracting(enemyPlayer)) { if (getInventory().contains("Bandages") && (getSkills().getStatic(Skill.HITPOINTS) - getSkills().getDynamic(Skill.HITPOINTS) > 10)) getInventory().getItem("Bandages").interact("Heal"); new ConditionalSleep(MethodProvider.random(2000, 5000), 500) { @Override public boolean condition() throws InterruptedException { return enemyPlayer.exists(); } }.sleep(); } else if (getMap().canReach(enemyPlayer)) { enemyPlayer.interact("Attack"); } else { enemyPlayer = null; } } else { enemyPlayer = null; } break; } return 1000; } private ScriptState getScriptState() { if (getConfigs().get(1021) == 0) return ScriptState.FIND_PORTAL; if (ZAMORAK_WAITING_ROOM.contains(myPlayer()) || SARADOMIN_WAITING_ROOM.contains(myPlayer())) return ScriptState.WAIT_FOR_GAME; if (SARADOMIN_SPAWN_AREA.contains(myPlayer()) || ZAMORAK_SPAWN_AREA.contains(myPlayer())) if (!getInventory().contains("Bandages")) return ScriptState.GRAB_SUPPLIES; else return ScriptState.LEAVE_SPAWN; if (enemyPlayer == null) return ScriptState.FIND_OPPONENT; return ScriptState.FIGHT_OPPONENT; } private Team getMyTeam() { if (myTeam == null) myTeam = myPlayer().getTeam() == 1 ? Team.SARADOMIN : Team.ZAMORAK; return myTeam; } private boolean isPathBlocked(Entity entity) { LocalPathFinder pf = new LocalPathFinder(bot); LinkedList<Position> path = pf.findPath(entity); if (pf.foundPath()) { Collection<NPC> barricades = getNpcs().getAll().stream().filter(o -> o.getName().equals("Barricade")).collect(Collectors.toList()); for (Position position : path) for (NPC barricade : barricades) if (barricade.getPosition().equals(position)) return true; return false; } return true; } }
  20. In spirit of Frog Friday, we have a weekend release for all to enjoy. Finally got around to patching some logic which has been driving me crazy for about a year, Bank depositAllExcept. If your inventory did not have the specified item in the call, it would still individually deposit each item instead of clicking the "Deposit All" button. Other than that debugging should work again and scripters should be pleased with the new getDirectoryData() method. Example: new File(getDirectoryData()+getName()+File.separator+"info.txt"); Additionally the ScriptAnalyzer has now been disabled; I've gathered enough information from local scripts to being developing a server-sided solution. Changelog: -Patched debugging, see the "FAQ" for more information on arg flags -Improved Bank logic -Added Inventory getEmptySlotCount() -Added Script getDirectoryData() -Disabled local ScriptAnalyzer -The OSBot Staff
×
×
  • Create New...