Jump to content

PolishCivil

Members
  • Posts

    669
  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    100%

Everything posted by PolishCivil

  1. public final RS2Object get(Script ctx) { for (RS2Object object : ctx.closestObjectListForName(getName())) if (object != null && object.getPosition().equals(getLocation())) return object; return null; } Just a little enhancement by me: public WallObject getWallObjectOnPosition(Position position, String... names) { try { if (position == null) { return null; } if (client.getCurrentRegion() == null || client.getCurrentRegion().instance == null || client.getCurrentRegion().instance.getTiles() == null) { return null; } int localX = position.getLocalX(bot); int localY = position.getLocalY(bot); if (localX <= 104 && localY <= 104 && localX >= 0 && localY >= 0) { if (client.getCurrentRegion().instance.getTiles()[position.getZ()][localX][localY] == null) { return null; } XWallObject wallObject = client.getCurrentRegion().instance.getTiles()[position.getZ()][localX][localY].getWallObject(); WallObject wrap = WallObject.wrap(wallObject, position.getZ()); if (names.length == 0 || Arrays.asList(names).contains(wrap.getDefinition().getName())) { return wallObject == null ? null : wrap; } } } catch (Exception ignored) { } return null; }
  2. LOL... Xavier sent me this too a while ago. What a noob cant translate it?
  3. add System.out.println(client.myPlayer());System.out.println(client.getPosition());System.out.println(client.getPosition().getZ()); show output But yh u can always try script.client.getPlane()
  4. Do you know DISHsfshfasfSDHjfsdjnf ? Its my shortcut to System.out.println You nub.
  5. Its just shortcut, it means nothing.
  6. import org.osbot.script.Script; import org.osbot.script.ScriptManifest; import org.osbot.script.rs2.map.Position; import org.osbot.script.rs2.model.RS2Object; import org.osbot.script.rs2.utility.Condition; import java.awt.*; import java.util.List; /** * Created by Robert on 2014-04-18. * Tip: if you want to get trees fast you will need to dump tree positions data. * Like you walk to cutting area, dump positions of trees you want to cut, and then you can get objects by: * client.getCurrentRegion().instance.getTiles()[position.getZ()][localX][localY].getObjects(); * Its alot faster. */ @ScriptManifest(name = "Simple chopper", info = "", author = "PolishCivil", version = 1.0D) public class Chopper extends Script { final static int[] WOODCUTTING_ANIMS_IDS = new int[]{ 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880 }; private String treeName = "Tree"; private RS2Object currentTree = null, nextTree = null; private long lastChopTime; @Override public int onLoop() throws InterruptedException { if (isChoppingTree()) { lastChopTime = System.currentTimeMillis(); } if (currentTree == null || !currentTree.exists()) { log("Searching for: " + treeName); if (nextTree != null && nextTree.exists()) { currentTree = nextTree; } else { currentTree = getClosestTree(null); } if (currentTree == null) { warn("Couldt find - " + treeName); return 2500; } /* We are chopping tree now because getting next tree takes a while, so we are saving time. */ chopTree(); nextTree = getClosestTree(currentTree.getPosition()); return 300; } if (System.currentTimeMillis() - lastChopTime > 2000) { chopTree(); } else { return 600; } return 100; } /** * Interacts with tree * * @throws InterruptedException */ private void chopTree() throws InterruptedException { if (currentTree.interact("Chop down")) { int dist = distance(currentTree); if (waitFor(dist * 600 + 1000, new Condition() { @Override public boolean evaluate() { return isChoppingTree() || (currentTree == null || !currentTree.exists()); } })) { lastChopTime = System.currentTimeMillis(); } } } @Override public void onPaint(Graphics a) { Graphics2D g2d = (Graphics2D) a; if (currentTree != null && currentTree.exists()) { Polygon polygon = currentTree.getPosition().getPolygon(bot); Rectangle bounds = polygon.getBounds(); String text = "Current"; g2d.drawString(text, (int) (bounds.getCenterX() - (g2d.getFontMetrics().stringWidth(text) / 2)), (int) bounds.getCenterY()); g2d.draw(polygon); } if (nextTree != null && nextTree.exists() && !currentTree.equals(nextTree)) { Polygon polygon = nextTree.getPosition().getPolygon(bot); Rectangle bounds = polygon.getBounds(); String text = "Next"; g2d.drawString(text, (int) (bounds.getCenterX() - (g2d.getFontMetrics().stringWidth(text) / 2)), (int) bounds.getCenterY()); g2d.draw(polygon); } } /** * Gets closest tree around player. * * @param exclude - the position exclude - we dont want tree at this position. * @return - tree object. */ private RS2Object getClosestTree(Position exclude) { List<RS2Object> rs2Objects = closestObjectListForName(treeName); RS2Object closest = null; for (RS2Object rs2Object : rs2Objects) { if ((closest == null || distance(rs2Object) < distance(closest)) && (exclude == null || rs2Object.getPosition().distance(exclude) != 0)) { closest = rs2Object; } } return closest; } /** * Checks if player is chopping tree. * * @return whether he is. */ private boolean isChoppingTree() { for (int i : WOODCUTTING_ANIMS_IDS) { if (myPlayer().getAnimation() == i) { return true; } } return false; } /** * Waits for condition. * * @param time - the max time to wait. * @param c - the condition to check. * @return - whether condition evaluated successfuly. */ public boolean waitFor(int time, Condition c) { for (int i = 0; (i < time / 50) && !c.evaluate(); i++) { try { sleep(50); } catch (InterruptedException ignore) { } } return c.evaluate(); } }
  7. What i wrote its not code its snippet. sout = System.out.println which prints things to console. (system one)
  8. private RS2Object tree; onloop: if(tree==null || !tree.exists()) tree = closestRs2ObjectForName("Tree); sout("tree id: "+tree.getId());
  9. I use intellij for code and netbeans for gui.
  10. my v public boolean eatShit() throws InterruptedException { for (Item current : client.getInventory().getItems()) { if (current.getDefinition().getActions() != null) { String[] strings = Arrays.copyOf(current.getDefinition().getActions(), current.getDefinition().getActions().length); Arrays.sort(strings); if (Arrays.binarySearch(strings, "Eat") >= 0) { return client.getInventory().interactWithId(current.getId(), "Eat"); } } } return false; }
  11. U will get it faster than osbot update lel. Even by hand
  12. private void addBasicLines() { add(new WalkLine(new Position(3255, 3226, 0), new Position(3259, 3227, 0))); add(new WalkLine(new Position(3265, 3227, 0), new Position(3259, 3227, 0))); add(new WalkLine(new Position(3265, 3227, 0), new Position(3261, 3236, 0))); add(new WalkLine(new Position(3261, 3236, 0), new Position(3252, 3250, 0))); add(new WalkLine(new Position(3252, 3250, 0), new Position(3248, 3263, 0))); add(new WalkLine(new Position(3248, 3263, 0), new Position(3237, 3286, 0))); add(new WalkLine(new Position(3237, 3286, 0), new Position(3238, 3305, 0))); add(new WalkLine(new Position(3238, 3305, 0), new Position(3258, 3323, 0))); add(new WalkLine(new Position(3258, 3323, 0), new Position(3268, 3328, 0))); add(new WalkLine(new Position(3268, 3328, 0), new Position(3281, 3330, 0))); add(new WalkLine(new Position(3281, 3330, 0), new Position(3272, 3291, 0))); add(new WalkLine(new Position(3272, 3291, 0), new Position(3271, 3230, 0))); add(new WalkLine(new Position(3271, 3230, 0), new Position(3269, 3222, 0))); add(new WalkLine(new Position(3269, 3222, 0), new Position(3269, 3209, 0))); add(new WalkLine(new Position(3269, 3209, 0), new Position(3278, 3196, 0))); add(new WalkLine(new Position(3278, 3196, 0), new Position(3279, 3180, 0))); add(new WalkLine(new Position(3279, 3180, 0), new Position(3276, 3170, 0))); add(new WalkLine(new Position(3276, 3170, 0), new Position(3269, 3165, 0))); add(new WalkLine(new Position(3255, 3226, 0), new Position(3255, 3226, 0))); add(new WalkLine(new Position(3255, 3226, 0), new Position(3236, 3224, 0))); add(new WalkLine(new Position(3236, 3224, 0), new Position(3232, 3218, 0))); add(new WalkLine(new Position(3232, 3218, 0), new Position(3221, 3218, 0))); add(new WalkLine(new Position(3221, 3218, 0), new Position(3214, 3216, 0))); add(new WalkLine(new Position(3214, 3216, 0), new Position(3214, 3211, 0))); add(new WalkLine(new Position(3214, 3211, 0), new Position(3206, 3209, 0))); add(new WalkLine(new Position(3232, 3218, 0), new Position(3235, 3211, 0))); add(new WalkLine(new Position(3235, 3211, 0), new Position(3235, 3204, 0))); add(new WalkLine(new Position(3235, 3204, 0), new Position(3241, 3197, 0))); add(new WalkLine(new Position(3241, 3197, 0), new Position(3243, 3189, 0))); add(new WalkLine(new Position(3243, 3189, 0), new Position(3235, 3175, 0))); add(new WalkLine(new Position(3235, 3175, 0), new Position(3234, 3186, 0))); add(new WalkLine(new Position(3234, 3186, 0), new Position(3224, 3194, 0))); add(new WalkLine(new Position(3224, 3194, 0), new Position(3215, 3196, 0))); add(new WalkLine(new Position(3215, 3196, 0), new Position(3205, 3190, 0))); add(new WalkLine(new Position(3205, 3190, 0), new Position(3195, 3189, 0))); add(new WalkLine(new Position(3195, 3189, 0), new Position(3185, 3197, 0))); add(new WalkLine(new Position(3185, 3197, 0), new Position(3166, 3203, 0))); add(new WalkLine(new Position(3166, 3203, 0), new Position(3152, 3194, 0))); add(new WalkLine(new Position(3235, 3175, 0), new Position(3235, 3175, 0))); add(new WalkLine(new Position(3235, 3175, 0), new Position(3235, 3164, 0))); add(new WalkLine(new Position(3235, 3164, 0), new Position(3225, 3159, 0))); add(new WalkLine(new Position(3225, 3159, 0), new Position(3211, 3161, 0))); add(new WalkLine(new Position(3211, 3161, 0), new Position(3206, 3169, 0))); add(new WalkLine(new Position(3206, 3169, 0), new Position(3201, 3174, 0))); add(new WalkLine(new Position(3201, 3174, 0), new Position(3196, 3169, 0))); add(new WalkLine(new Position(3196, 3169, 0), new Position(3188, 3158, 0))); add(new WalkLine(new Position(3188, 3158, 0), new Position(3172, 3164, 0))); add(new WalkLine(new Position(3172, 3164, 0), new Position(3167, 3170, 0))); add(new WalkLine(new Position(3167, 3170, 0), new Position(3154, 3179, 0))); add(new WalkLine(new Position(3154, 3179, 0), new Position(3152, 3194, 0))); add(new WalkLine(new Position(3201, 3174, 0), new Position(3201, 3181, 0))); add(new WalkLine(new Position(3201, 3181, 0), new Position(3195, 3189, 0))); add(new WalkLine(new Position(3201, 3181, 0), new Position(3205, 3190, 0))); add(new WalkLine(new Position(3185, 3197, 0), new Position(3171, 3188, 0))); add(new WalkLine(new Position(3171, 3188, 0), new Position(3152, 3194, 0))); add(new WalkLine(new Position(3167, 3170, 0), new Position(3171, 3188, 0))); add(new WalkLine(new Position(3196, 3169, 0), new Position(3172, 3164, 0))); add(new WalkLine(new Position(3211, 3161, 0), new Position(3235, 3175, 0))); add(new WalkLine(new Position(3235, 3164, 0), new Position(3226, 3147, 0))); add(new WalkLine(new Position(3225, 3159, 0), new Position(3186, 3151, 0))); add(new WalkLine(new Position(3186, 3151, 0), new Position(3161, 3152, 0))); add(new WalkLine(new Position(3161, 3152, 0), new Position(3145, 3148, 0))); add(new WalkLine(new Position(3145, 3148, 0), new Position(3154, 3179, 0))); add(new WalkLine(new Position(3172, 3164, 0), new Position(3145, 3148, 0))); add(new WalkLine(new Position(3226, 3147, 0), new Position(3225, 3159, 0))); add(new WalkLine(new Position(3215, 3196, 0), new Position(3224, 3194, 0))); add(new WalkLine(new Position(3224, 3194, 0), new Position(3234, 3186, 0))); add(new WalkLine(new Position(3234, 3186, 0), new Position(3243, 3189, 0))); add(new WalkLine(new Position(3235, 3175, 0), new Position(3243, 3189, 0))); add(new WalkLine(new Position(3236, 3224, 0), new Position(3223, 3236, 0))); add(new WalkLine(new Position(3223, 3236, 0), new Position(3215, 3258, 0))); add(new WalkLine(new Position(3215, 3258, 0), new Position(3213, 3275, 0))); add(new WalkLine(new Position(3213, 3275, 0), new Position(3189, 3281, 0))); add(new WalkLine(new Position(3189, 3281, 0), new Position(3161, 3286, 0))); add(new WalkLine(new Position(3161, 3286, 0), new Position(3150, 3293, 0))); add(new WalkLine(new Position(3150, 3293, 0), new Position(3120, 3296, 0))); add(new WalkLine(new Position(3120, 3296, 0), new Position(3109, 3293, 0))); add(new WalkLine(new Position(3109, 3293, 0), new Position(3107, 3278, 0))); add(new WalkLine(new Position(3107, 3278, 0), new Position(3103, 3271, 0))); add(new WalkLine(new Position(3103, 3271, 0), new Position(3103, 3254, 0))); add(new WalkLine(new Position(3103, 3254, 0), new Position(3093, 3247, 0))); add(new WalkLine(new Position(3093, 3247, 0), new Position(3093, 3242, 0))); add(new WalkLine(new Position(3223, 3236, 0), new Position(3203, 3239, 0))); add(new WalkLine(new Position(3203, 3239, 0), new Position(3171, 3236, 0))); add(new WalkLine(new Position(3171, 3236, 0), new Position(3144, 3229, 0))); add(new WalkLine(new Position(3144, 3229, 0), new Position(3113, 3221, 0))); add(new WalkLine(new Position(3113, 3221, 0), new Position(3104, 3238, 0))); add(new WalkLine(new Position(3104, 3238, 0), new Position(3093, 3247, 0))); add(new WalkLine(new Position(3113, 3221, 0), new Position(3112, 3170, 0))); add(new WalkLine(new Position(3276, 3170, 0), new Position(3276, 3153, 0))); add(new WalkLine(new Position(3276, 3153, 0), new Position(3289, 3146, 0))); add(new WalkLine(new Position(3289, 3146, 0), new Position(3302, 3136, 0))); add(new WalkLine(new Position(3302, 3136, 0), new Position(3302, 3117, 0))); add(new WalkLine(new Position(3268, 3328, 0), new Position(3253, 3334, 0))); add(new WalkLine(new Position(3253, 3334, 0), new Position(3235, 3336, 0))); add(new WalkLine(new Position(3235, 3336, 0), new Position(3226, 3337, 0))); add(new WalkLine(new Position(3226, 3337, 0), new Position(3221, 3358, 0))); add(new WalkLine(new Position(3221, 3358, 0), new Position(3209, 3377, 0))); add(new WalkLine(new Position(3209, 3377, 0), new Position(3210, 3427, 0))); add(new WalkLine(new Position(3150, 3293, 0), new Position(3131, 3300, 0))); add(new WalkLine(new Position(3120, 3296, 0), new Position(3131, 3300, 0))); add(new WalkLine(new Position(3131, 3300, 0), new Position(3132, 3332, 0))); add(new WalkLine(new Position(3132, 3332, 0), new Position(3141, 3356, 0))); add(new WalkLine(new Position(3141, 3356, 0), new Position(3135, 3379, 0))); add(new WalkLine(new Position(3135, 3379, 0), new Position(3108, 3388, 0))); add(new WalkLine(new Position(3108, 3388, 0), new Position(3098, 3419, 0))); add(new WalkLine(new Position(3098, 3419, 0), new Position(3081, 3419, 0))); add(new WalkLine(new Position(3098, 3419, 0), new Position(3115, 3418, 0))); add(new WalkLine(new Position(3098, 3419, 0), new Position(3104, 3431, 0))); add(new WalkLine(new Position(3089, 3433, 0), new Position(3098, 3419, 0))); add(new WalkLine(new Position(3089, 3433, 0), new Position(3093, 3446, 0))); add(new WalkLine(new Position(3104, 3431, 0), new Position(3093, 3446, 0))); add(new WalkLine(new Position(3093, 3446, 0), new Position(3086, 3461, 0))); add(new WalkLine(new Position(3086, 3461, 0), new Position(3086, 3464, 0))); add(new WalkLine(new Position(3086, 3464, 0), new Position(3098, 3464, 0))); add(new WalkLine(new Position(3098, 3464, 0), new Position(3098, 3482, 0))); add(new WalkLine(new Position(3098, 3482, 0), new Position(3087, 3489, 0))); add(new WalkLine(new Position(3087, 3489, 0), new Position(3093, 3492, 0))); add(new WalkLine(new Position(3115, 3418, 0), new Position(3115, 3418, 0))); add(new WalkLine(new Position(3115, 3418, 0), new Position(3125, 3414, 0))); add(new WalkLine(new Position(3125, 3414, 0), new Position(3137, 3415, 0))); add(new WalkLine(new Position(3137, 3415, 0), new Position(3154, 3416, 0))); add(new WalkLine(new Position(3154, 3416, 0), new Position(3165, 3425, 0))); add(new WalkLine(new Position(3165, 3425, 0), new Position(3177, 3428, 0))); add(new WalkLine(new Position(3177, 3428, 0), new Position(3210, 3427, 0))); add(new WalkLine(new Position(3209, 3377, 0), new Position(3179, 3370, 0))); add(new WalkLine(new Position(3238, 3305, 0), new Position(3239, 3329, 0))); add(new WalkLine(new Position(3152, 3194, 0), new Position(3113, 3221, 0))); add(new WalkLine(new Position(3113, 3221, 0), new Position(3088, 3228, 0))); add(new WalkLine(new Position(3088, 3228, 0), new Position(3080, 3248, 0))); add(new WalkLine(new Position(3080, 3248, 0), new Position(3093, 3247, 0))); add(new WalkLine(new Position(3109, 3293, 0), new Position(3089, 3289, 0))); add(new WalkLine(new Position(3089, 3289, 0), new Position(3065, 3276, 0))); add(new WalkLine(new Position(3080, 3248, 0), new Position(3065, 3276, 0))); add(new WalkLine(new Position(3065, 3276, 0), new Position(3058, 3274, 0))); add(new WalkLine(new Position(3058, 3274, 0), new Position(3032, 3275, 0))); add(new WalkLine(new Position(3032, 3275, 0), new Position(3008, 3277, 0))); add(new WalkLine(new Position(3008, 3277, 0), new Position(2980, 3274, 0))); add(new WalkLine(new Position(2980, 3274, 0), new Position(2945, 3302, 0))); add(new WalkLine(new Position(2945, 3302, 0), new Position(2923, 3293, 0))); add(new WalkLine(new Position(2933, 3318, 0), new Position(2945, 3302, 0))); add(new WalkLine(new Position(2980, 3274, 0), new Position(2952, 3240, 0))); add(new WalkLine(new Position(2980, 3274, 0), new Position(2977, 3238, 0))); add(new WalkLine(new Position(2952, 3240, 0), new Position(2931, 3216, 0))); add(new WalkLine(new Position(2952, 3240, 0), new Position(2954, 3210, 0))); add(new WalkLine(new Position(2977, 3238, 0), new Position(2954, 3210, 0))); add(new WalkLine(new Position(2977, 3238, 0), new Position(2983, 3232, 0))); add(new WalkLine(new Position(2983, 3232, 0), new Position(3004, 3239, 0))); add(new WalkLine(new Position(2983, 3232, 0), new Position(2995, 3191, 0))); add(new WalkLine(new Position(2995, 3191, 0), new Position(2991, 3172, 0))); add(new WalkLine(new Position(2991, 3172, 0), new Position(3007, 3152, 0))); add(new WalkLine(new Position(2995, 3191, 0), new Position(3008, 3176, 0))); add(new WalkLine(new Position(3008, 3176, 0), new Position(3007, 3152, 0))); add(new WalkLine(new Position(2995, 3191, 0), new Position(3004, 3239, 0))); add(new WalkLine(new Position(3004, 3239, 0), new Position(3022, 3241, 0))); add(new WalkLine(new Position(3022, 3241, 0), new Position(3033, 3243, 0))); add(new WalkLine(new Position(3033, 3243, 0), new Position(3040, 3252, 0))); add(new WalkLine(new Position(3040, 3252, 0), new Position(3032, 3275, 0))); add(new WalkLine(new Position(3040, 3252, 0), new Position(3061, 3254, 0))); add(new WalkLine(new Position(3061, 3254, 0), new Position(3065, 3276, 0))); add(new WalkLine(new Position(3061, 3254, 0), new Position(3046, 3246, 0))); add(new WalkLine(new Position(3046, 3246, 0), new Position(3040, 3252, 0))); add(new WalkLine(new Position(3040, 3242, 0), new Position(3046, 3246, 0))); add(new WalkLine(new Position(3040, 3242, 0), new Position(3040, 3235, 0))); add(new WalkLine(new Position(3040, 3235, 0), new Position(3027, 3234, 0))); add(new WalkLine(new Position(3027, 3234, 0), new Position(3027, 3212, 0))); add(new WalkLine(new Position(3027, 3212, 0), new Position(3027, 3202, 0))); add(new WalkLine(new Position(3027, 3202, 0), new Position(3037, 3202, 0))); add(new WalkLine(new Position(3027, 3202, 0), new Position(3009, 3198, 0))); add(new WalkLine(new Position(3009, 3198, 0), new Position(2995, 3191, 0))); add(new WalkLine(new Position(2991, 3172, 0), new Position(2999, 3129, 0))); add(new WalkLine(new Position(2999, 3129, 0), new Position(2990, 3112, 0))); add(new WalkLine(new Position(3302, 3117, 0), new Position(3302, 3108, 0))); add(new WalkLine(new Position(3081, 3419, 0), new Position(3041, 3426, 0))); add(new WalkLine(new Position(3041, 3426, 0), new Position(3010, 3433, 0))); add(new WalkLine(new Position(3010, 3433, 0), new Position(2990, 3431, 0))); add(new WalkLine(new Position(2990, 3431, 0), new Position(2982, 3415, 0))); add(new WalkLine(new Position(2982, 3415, 0), new Position(2966, 3412, 0))); add(new WalkLine(new Position(2966, 3412, 0), new Position(2948, 3424, 0))); add(new WalkLine(new Position(2948, 3424, 0), new Position(2944, 3449, 0))); add(new WalkLine(new Position(2944, 3449, 0), new Position(2925, 3449, 0))); add(new WalkLine(new Position(2925, 3449, 0), new Position(2911, 3455, 0))); add(new WalkLine(new Position(2911, 3455, 0), new Position(2897, 3455, 0))); add(new WalkLine(new Position(2897, 3455, 0), new Position(2895, 3463, 0))); add(new WalkLine(new Position(2895, 3463, 0), new Position(2897, 3479, 0))); add(new WalkLine(new Position(2897, 3479, 0), new Position(2911, 3500, 0))); add(new WalkLine(new Position(2911, 3500, 0), new Position(2919, 3522, 0))); add(new WalkLine(new Position(2919, 3522, 0), new Position(2927, 3533, 0))); add(new WalkLine(new Position(3008, 3277, 0), new Position(3006, 3302, 0))); add(new WalkLine(new Position(3006, 3302, 0), new Position(3004, 3327, 0))); add(new WalkLine(new Position(3004, 3327, 0), new Position(3006, 3334, 0))); add(new WalkLine(new Position(3006, 3334, 0), new Position(3004, 3362, 0))); add(new WalkLine(new Position(3004, 3362, 0), new Position(2973, 3377, 0))); add(new WalkLine(new Position(2973, 3377, 0), new Position(2964, 3380, 0))); add(new WalkLine(new Position(2964, 3380, 0), new Position(2966, 3412, 0))); add(new WalkLine(new Position(2953, 3146, 0), new Position(2940, 3146, 0))); add(new WalkLine(new Position(2907, 3152, 0), new Position(2940, 3146, 0))); add(new WalkLine(new Position(2907, 3152, 0), new Position(2886, 3144, 0))); add(new WalkLine(new Position(2907, 3152, 0), new Position(2889, 3166, 0))); add(new WalkLine(new Position(2907, 3152, 0), new Position(2898, 3166, 0))); add(new WalkLine(new Position(2898, 3166, 0), new Position(2903, 3176, 0))); add(new WalkLine(new Position(2903, 3176, 0), new Position(2904, 3189, 0))); add(new WalkLine(new Position(2886, 3144, 0), new Position(2865, 3149, 0))); add(new WalkLine(new Position(2865, 3149, 0), new Position(2842, 3144, 0))); add(new WalkLine(new Position(2842, 3144, 0), new Position(2822, 3151, 0))); add(new WalkLine(new Position(2822, 3151, 0), new Position(2818, 3167, 0))); add(new WalkLine(new Position(2818, 3167, 0), new Position(2816, 3181, 0))); add(new WalkLine(new Position(2816, 3181, 0), new Position(2803, 3181, 0))); add(new WalkLine(new Position(2803, 3181, 0), new Position(2800, 3176, 0))); add(new WalkLine(new Position(2800, 3176, 0), new Position(2802, 3156, 0))); add(new WalkLine(new Position(2800, 3176, 0), new Position(2782, 3178, 0))); add(new WalkLine(new Position(2782, 3178, 0), new Position(2770, 3182, 0))); add(new WalkLine(new Position(2770, 3182, 0), new Position(2761, 3177, 0))); add(new WalkLine(new Position(2761, 3177, 0), new Position(2757, 3161, 0))); add(new WalkLine(new Position(2757, 3161, 0), new Position(2762, 3148, 0))); add(new WalkLine(new Position(2762, 3148, 0), new Position(2773, 3138, 0))); add(new WalkLine(new Position(2773, 3138, 0), new Position(2775, 3123, 0))); add(new WalkLine(new Position(2757, 3161, 0), new Position(2745, 3150, 0))); add(new WalkLine(new Position(2803, 3181, 0), new Position(2801, 3198, 0))); add(new WalkLine(new Position(2801, 3198, 0), new Position(2788, 3208, 0))); add(new WalkLine(new Position(2788, 3208, 0), new Position(2771, 3214, 0))); add(new WalkLine(new Position(2771, 3214, 0), new Position(2771, 3226, 0))); add(new WalkLine(new Position(2770, 3182, 0), new Position(2755, 3186, 0))); add(new WalkLine(new Position(2755, 3186, 0), new Position(2755, 3201, 0))); add(new WalkLine(new Position(2755, 3201, 0), new Position(2771, 3214, 0))); add(new WalkLine(new Position(2927, 3533, 0), new Position(2920, 3542, 0))); add(new WalkLine(new Position(2920, 3542, 0), new Position(2909, 3546, 0))); add(new WalkLine(new Position(2909, 3546, 0), new Position(2897, 3544, 0))); add(new WalkLine(new Position(2897, 3544, 0), new Position(2880, 3547, 0))); add(new WalkLine(new Position(2919, 3522, 0), new Position(2905, 3523, 0))); add(new WalkLine(new Position(2905, 3523, 0), new Position(2898, 3530, 0))); add(new WalkLine(new Position(2898, 3530, 0), new Position(2891, 3537, 0))); add(new WalkLine(new Position(2891, 3537, 0), new Position(2897, 3544, 0))); add(new WalkLine(new Position(2897, 3455, 0), new Position(2883, 3445, 0))); add(new WalkLine(new Position(2883, 3445, 0), new Position(2888, 3434, 0))); add(new WalkLine(new Position(2888, 3434, 0), new Position(2886, 3424, 0))); add(new WalkLine(new Position(2886, 3424, 0), new Position(2874, 3426, 0))); add(new WalkLine(new Position(2874, 3426, 0), new Position(2864, 3443, 0))); add(new WalkLine(new Position(2864, 3443, 0), new Position(2862, 3460, 0))); add(new WalkLine(new Position(2862, 3460, 0), new Position(2855, 3469, 0))); add(new WalkLine(new Position(2855, 3469, 0), new Position(2855, 3482, 0))); add(new WalkLine(new Position(2855, 3482, 0), new Position(2860, 3494, 0))); add(new WalkLine(new Position(2860, 3494, 0), new Position(2859, 3504, 0))); add(new WalkLine(new Position(2859, 3504, 0), new Position(2851, 3508, 0))); add(new WalkLine(new Position(2851, 3508, 0), new Position(2839, 3505, 0))); add(new WalkLine(new Position(2839, 3505, 0), new Position(2840, 3495, 0))); add(new WalkLine(new Position(2840, 3495, 0), new Position(2848, 3485, 0))); add(new WalkLine(new Position(2848, 3485, 0), new Position(2849, 3478, 0))); add(new WalkLine(new Position(2849, 3478, 0), new Position(2846, 3472, 0))); add(new WalkLine(new Position(2846, 3472, 0), new Position(2840, 3464, 0))); add(new WalkLine(new Position(2840, 3464, 0), new Position(2847, 3450, 0))); add(new WalkLine(new Position(2847, 3450, 0), new Position(2853, 3443, 0))); add(new WalkLine(new Position(2853, 3443, 0), new Position(2854, 3436, 0))); add(new WalkLine(new Position(2854, 3436, 0), new Position(2845, 3432, 0))); add(new WalkLine(new Position(2845, 3432, 0), new Position(2838, 3435, 0))); add(new WalkLine(new Position(2838, 3435, 0), new Position(2808, 3435, 0))); add(new WalkLine(new Position(2808, 3435, 0), new Position(2808, 3440, 0))); add(new WalkLine(new Position(2808, 3435, 0), new Position(2802, 3433, 0))); add(new WalkLine(new Position(2802, 3433, 0), new Position(2803, 3419, 0))); add(new WalkLine(new Position(2802, 3433, 0), new Position(2789, 3433, 0))); add(new WalkLine(new Position(2789, 3433, 0), new Position(2776, 3447, 0))); add(new WalkLine(new Position(2776, 3447, 0), new Position(2762, 3466, 0))); add(new WalkLine(new Position(2762, 3466, 0), new Position(2742, 3478, 0))); add(new WalkLine(new Position(2742, 3478, 0), new Position(2725, 3484, 0))); add(new WalkLine(new Position(2725, 3484, 0), new Position(2724, 3489, 0))); add(new WalkLine(new Position(2789, 3433, 0), new Position(2776, 3427, 0))); add(new WalkLine(new Position(2776, 3427, 0), new Position(2756, 3425, 0))); add(new WalkLine(new Position(2756, 3425, 0), new Position(2740, 3416, 0))); add(new WalkLine(new Position(2740, 3416, 0), new Position(2731, 3432, 0))); add(new WalkLine(new Position(2731, 3432, 0), new Position(2730, 3442, 0))); add(new WalkLine(new Position(2730, 3442, 0), new Position(2741, 3442, 0))); add(new WalkLine(new Position(2730, 3442, 0), new Position(2726, 3455, 0))); add(new WalkLine(new Position(2726, 3455, 0), new Position(2720, 3466, 0))); } private void addPasses() { add(new ShantayPassLine(new Position(3302, 3117, 0), new Position(3302, 3108, 0))); } private void addShortcuts() { add(new AlKharidGateShortcut(new Position(3265, 3227, 0), new Position(3269, 3222, 0))); add(new AgilityShortcut(new Position(3235, 3336, 0), new Position(3239, 3329, 0)));//Kingdom of Misthalin thingy add(new KaramjaShip(new Position(3027, 3212, 0), new Position(2953, 3146, 0))); } Might be usefull for start ->
  13. sneaky jagex moved selected slot to other class for 44 its: ClassLoader loader = client.instance.getClass().getClassLoader(); Class clazz = Class.forName("client", false, loader); Class clazz2 = Class.forName("v", false, loader); selectedItemCheck = clazz.getDeclaredField("im"); selectedItemCheck.setAccessible(true); selectedSlotId = clazz2.getDeclaredField("ii"); selectedSlotId.setAccessible(true); int slotId = (int) selectedSlotId.get(null) * 1661960989;
  14. Donator - "Become an important person at OSBot" This made my day.
  15. Learn fully C,Java, ASM. Then write write write, and you are proper software engineer.
  16. String[] array = {"s","n","d"}; String s = Arrays.toString(array); System.out.println(s.replaceAll(", ","\",\"").replace("[","(").replace("]",")").replace("(","(\"").replace(")","\");")); } Idk it works but it should
  17. String[] array = {"s","n","d"}; String s = Arrays.toString(array); System.out.println(s.replaceAll(", ","\",\"").replace("[","(").replace("]",")").replace("(","(\"").replace(")","\");")); } Idk it works but it should
  18. Its not efficient, guys just use hook its few seconds to find those fields.
  19. RIP low cpu users http://osbot.org/forum/topic/33026-checking-if-item-is-selected-rev-35/
  20. someone asked me for update so : private final String selectedItemCheckFieldName = "id", selectedSlotIdFieldName = "gc" Mod: -1160674909
  21. /** * @author PolishCivil */ public class Data { public static class LeatherWorkingData { public static final int NEEDLE_ITEM_ID = 1733, THREAD_ITEM_ID = 1734; public static final int WORKING_ANIMATION = 1249; public enum ELeatherType { SOFT_LEATHER("Leather", 1741, 154, new CraftingItem("Armour", 1129, 1, 114), new CraftingItem("Gloves", 1059, 1, 108), new CraftingItem("Boots", 1061, 1, 109), new CraftingItem("Vambraces", 1063, 1, 110), new CraftingItem("Chaps", 1095, 1, 111), new CraftingItem("Coif", 1069, 1, 112), new CraftingItem("Cowl", 1067, 1, 113) ), HARD_LEATHER("Hard leather", 1743, 309, new CraftingItem("Hardleather body", 1131, 1, 6) ), GREEN_DRAGON_LEATHER("Green d-leather", 1745, 304, new CraftingItem("Green body", 1135, 3, 2), new CraftingItem("Green vambraces", 1065, 1, 3), new CraftingItem("Green chaps", 1099, 2, 4) ), BLUE_DRAGON_LEATHER("Blue d-leather", 2505, 304, new CraftingItem("Blue body", 2499, 3, 2), new CraftingItem("Blue vambraces", 2487, 1, 3), new CraftingItem("Blue chaps", 2493, 2, 4) ), RED_DRAGON_LEATHER("Red d-leather", 2507, 304, new CraftingItem("Red body", 2501, 3, 2), new CraftingItem("Red vambraces", 2489, 1, 3), new CraftingItem("Red chaps", 2495, 2, 4) ), BLACK_DRAGON_LEATHER("Black d-leather", 2509, 304, new CraftingItem("Black body", 2503, 3, 2), new CraftingItem("Black vambraces", 2491, 1, 3), new CraftingItem("Black chaps", 2497, 2, 4) ),; private final String itemName; private final int itemId; private final int interfaceId; private final CraftingItem[] itemsToMake; private ELeatherType(String itemName, int itemId, int interfaceId, CraftingItem... itemsToMake) { this.itemName = itemName; this.itemId = itemId; this.interfaceId = interfaceId; this.itemsToMake = itemsToMake; } public int getItemId() { return itemId; } public CraftingItem[] getItemsToMake() { return itemsToMake; } public String getItemName() { return itemName; } public int getMakeInterfaceId() { return interfaceId; } public static class CraftingItem { private final String name; private final int itemid; private final int leatherAmount; private final int interfaceChildId; private CraftingItem(String name, int itemid, int leatherAmount, int interfaceChildId) { this.name = name; this.itemid = itemid; this.leatherAmount = leatherAmount; this.interfaceChildId = interfaceChildId; } public int getItemid() { return itemid; } @Override public String toString() { return name; } public String getName() { return name; } public int getLeatherAmount() { return leatherAmount; } public int getInterfaceChildId() { return interfaceChildId; } } } } public static class SpinningData { public static int SPIN_INTERFACE_ID = 459; public static int SPIN_ANIMATION_ID = 894; public enum SpinningItem { WOOL("Wool", 1737, 100, 5), FLAX("Flax", 1779, 95, 15), MAGIC_ROOTS("Magic roots", 6051, 107, 15), SINEW("Sinew", 9436, 114, 30); private final String itemName; private final int itemId; private final int childInterfaceChild; private final int exp; SpinningItem(String itemName, int itemId, int childInterfaceChild, int exp) { this.itemName = itemName; this.itemId = itemId; this.childInterfaceChild = childInterfaceChild; this.exp = exp; } public int getExp() { return exp; } public int getInterfaceChild() { return childInterfaceChild; } public int getItemId() { return itemId; } public String getItemName() { return itemName; } } } public static class GemCuttingData { public static int CUT_INTERFACE_ID = 309; public static int CUT_INTERFACE_CHILD_ID = 2; public static int CHISEL_ITEM_ID = 1755; public static int[] GEM_CUTTING_ANIMATIONS = new int[]{886, 886, 887, 888, 889, 887, 886, 885, 2717 }; public enum EGemType { JADE(1627), OPAL(1625), SAPPHIRE(1623), EMERALD(1621), RUBY(1619), DIAMOND(1617), DRAGONSTONE(1631), ONYX(6571); private final int gemItemId; private EGemType(int gemItemId) { this.gemItemId = gemItemId; } public int getGemItemId() { return gemItemId; } } } public static class TannerData { public static final int TANNING_INTERFACE = 324; public enum HideType { SOFT_LEATHER(100, 1, 1739, 1741), HARD_LEATHER(101, 3, 1739, 1743), GREEN_DRAGON_HIDE(104, 20, 1753, 1745), BLUE_DRAGON_HIDE(105, 20, 1751, 2505), RED_DRAGON_HIDE(106, 20, 1749, 2507), BLACK_DRAGON_HIDE(107, 20, 1747, 2509); private final int childId; private final int cost; private final int rawMaterialItemId; private final int hideItemId; /** * Hide type data for @see{AIOCrafter} * * @param childId - make child id in tanning interface. * @param cost - cost of tanning. * @param materialItemId - itemId used to be made ie cowhide. * @param hideItemId - return itemId id ie harDRAGON_LEATHER. */ private HideType(int childId, int cost, int materialItemId, int hideItemId) { this.childId = childId; this.cost = cost; this.rawMaterialItemId = materialItemId; this.hideItemId = hideItemId; } public int getChildId() { return childId; } public int getCost() { return cost; } public int getHideItemId() { return hideItemId; } public int getRawMaterialItemId() { return rawMaterialItemId; } } } public static class JewelleryData { public static final int JEWELLERY_INTERFACE_ID = 446; public static final int GOLD_BAR_ITEM_ID = 2357; public static final int SMELTING_ANIMATION_ID = 899; public static final int SAPPHIRE_GEM_ITEM_ID = 1607; public static final int RUBY_GEM_ITEM_ID = 1603; public static final int DIAMOND_GEM_ITEM_ID = 1601; public static final int EMERALD_GEM_ITEM_ID = 1605; public enum JewelleryType { RING(1592, new JewelleryItem("Gold ring", 1635, new int[]{GOLD_BAR_ITEM_ID}, 7), new JewelleryItem("Sapphire ring", 1637, new int[]{GOLD_BAR_ITEM_ID, SAPPHIRE_GEM_ITEM_ID}, 8), new JewelleryItem("Emerald ring", 1639, new int[]{GOLD_BAR_ITEM_ID, EMERALD_GEM_ITEM_ID}, 9), new JewelleryItem("Ruby ring", 1641, new int[]{GOLD_BAR_ITEM_ID, RUBY_GEM_ITEM_ID}, 10), new JewelleryItem("Diamond ring", 1643, new int[]{GOLD_BAR_ITEM_ID, DIAMOND_GEM_ITEM_ID}, 11) ), NECKLACE(1597, new JewelleryItem("Gold necklace", 1654, new int[]{GOLD_BAR_ITEM_ID}, 20), new JewelleryItem("Sapphire necklace", 1656, new int[]{GOLD_BAR_ITEM_ID, SAPPHIRE_GEM_ITEM_ID}, 21), new JewelleryItem("Emerald necklace", 1658, new int[]{GOLD_BAR_ITEM_ID, EMERALD_GEM_ITEM_ID}, 22), new JewelleryItem("Ruby necklace", 1660, new int[]{GOLD_BAR_ITEM_ID, RUBY_GEM_ITEM_ID}, 23), new JewelleryItem("Diamond necklace", 1662, new int[]{GOLD_BAR_ITEM_ID, DIAMOND_GEM_ITEM_ID}, 24) ), AMULET(1595, new JewelleryItem("Gold amulet", 1673, new int[]{GOLD_BAR_ITEM_ID}, 32), new JewelleryItem("Sapphire amulet", 1675, new int[]{GOLD_BAR_ITEM_ID, SAPPHIRE_GEM_ITEM_ID}, 33), new JewelleryItem("Emerald amulet", 1677, new int[]{GOLD_BAR_ITEM_ID, EMERALD_GEM_ITEM_ID}, 34), new JewelleryItem("Ruby amulet", 1679, new int[]{GOLD_BAR_ITEM_ID, RUBY_GEM_ITEM_ID}, 35), new JewelleryItem("Diamond amulet", 1681, new int[]{GOLD_BAR_ITEM_ID, DIAMOND_GEM_ITEM_ID}, 36) ), BRACELET(11065, new JewelleryItem("Gold bracelet", 11069, new int[]{GOLD_BAR_ITEM_ID}, 44), new JewelleryItem("Sapphire bracelet", 11072, new int[]{GOLD_BAR_ITEM_ID, SAPPHIRE_GEM_ITEM_ID}, 45), new JewelleryItem("Emerald bracelet", 11076, new int[]{GOLD_BAR_ITEM_ID, EMERALD_GEM_ITEM_ID}, 46), new JewelleryItem("Ruby bracelet", 11085, new int[]{GOLD_BAR_ITEM_ID, RUBY_GEM_ITEM_ID}, 47), new JewelleryItem("Diamond bracelet", 11092, new int[]{GOLD_BAR_ITEM_ID, DIAMOND_GEM_ITEM_ID}, 48) ),; private final int mouldItemId; private final JewelleryItem[] jewelleryItems; private JewelleryType(int mouldItemId, JewelleryItem... jewelleryItems) { this.mouldItemId = mouldItemId; this.jewelleryItems = jewelleryItems; } public int getMouldItemId() { return mouldItemId; } public JewelleryItem[] getJewelleryItems() { return jewelleryItems; } } public static class JewelleryItem { private final String itemName; private final int jewelleryItemId; private final int[] itemsNeeded; private final int jewelleryIterfaceChildId; public JewelleryItem(String itemName, int jewelleryItemId, int[] itemsNeeded, int jewelleryIterfaceChildId) { this.itemName = itemName; this.jewelleryItemId = jewelleryItemId; this.itemsNeeded = itemsNeeded; this.jewelleryIterfaceChildId = jewelleryIterfaceChildId; } @Override public String toString() { return itemName; } public String getItemName() { return itemName; } public int getJewelleryItemId() { return jewelleryItemId; } public int[] getItemsNeeded() { return itemsNeeded; } public int getJewelleryIterfaceChildId() { return jewelleryIterfaceChildId; } } public static int getJewelleryInterfaceId() { return JEWELLERY_INTERFACE_ID; } } public static class GlassblowingData { public static final int GLASSBLOWING_INTERFACE_ID = 542; public static final int GLASSBLOWING_PIPE_ITEM_ID = 1785; public static final int MOLTEN_GLASS_ITEM_ID = 1775; public static final int GLASSBLOWING_ANIMATION_ID = 884; public enum GlassItem { BEER_GLASS("Beer Glass", 104, 1919), CANDLE_LANTERN("Candle Lantern", 105, 4527), OIL_LAMP("Oil lamp", 106, 4525), VIAL("Vial", 102, 229), FISH_BOWL("Fish Bowl", 108, 6667), ORB("Orb", 113, 567), LANTERN_LENS("Lantern Lens", 93, 4542), DORGESHUUN_LIGHT_ORB("Dorgeshuun light orb", 140, 10973),; private String itemName; private final int childId; private final int itemId; /** * Glass item constructor. * * @param itemName - item name (interface) of glass item. * @param childId - child id on glassblowing interface. * @param itemId */ private GlassItem(String itemName, int childId, int itemId) { this.itemName = itemName; this.childId = childId; this.itemId = itemId; } /** * Gets item name (interface) of this glass item. * * @return */ public String getItemName() { return itemName; } /** * Gets child id os glassblowing interface. * * @return */ public int getChildId() { return childId; } /** * Gets item id of this glass item. * * @return */ public int getItemId() { return itemId; } } } } My crafter is based on this data, it might be usefull, so I share
×
×
  • Create New...