Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/05/15 in Posts

  1. CzarScripts #1 Bots LATEST BOTS If you want a trial - just post below with the script name, you can choose multiple too. Requirements Hit 'like' on this thread
    4 points
  2. Here I will be covering streams. Streams are great ways to essentially sort through lists. Why should we use streams? Since you can do just about anything with them in a single line of code. There are cases where streams probably aren't the most useful, take this: NPC guard = getNpcs().closest("Guard"); This is our bog standard way of grabbing the closest "Guard" npc. What it would actually be doing behind the scenes would be using a stream like so: public NPC closest(String name) { return getNpcs().getAll().stream().filter(npc -> (npc.exists() && npc.getName().equalsIgnoreCase(name))).min(new Comparator<NPC>() { @Override public int compare(NPC one, NPC two) { return Integer.compare(getMap().distance(one), getMap().distance(two)); } }).orElse(null); } Looks complicated, right? Here's what it would look like if it wasn't all one line: public NPC closest(String name) { Stream<NPC> unfilteredStream = getNpcs().getAll().stream(); Stream<NPC> filteredStream = unfilteredStream.filter(npc -> (npc.exists() && npc.getName().equalsIgnoreCase(name))); Optional<NPC> npc = filteredStream.min(new Comparator<NPC>() { @Override public int compare(NPC one, NPC two) { return Integer.compare(getMap().distance(one), getMap().distance(two)); } }); return npc.orElse(null); } Here's a breakdown of all the functions: (more on comparators in a bit) filter() -> This function will filter out our list for the specified properties that we're looking for in an NPC. In our case, we're looking for an NPC that exists and has a name of our variable "name". Every NPC that is in our region that doesn't suit our needs is discarded. min() -> This is a bit of a complicated function, but what it will do is find the NPC which returns the smallest compare() value. In this scenario, it will return the NPC which is closest to us. orElse() -> This is the same as an if (x) y; else z; statement, however basically what we are saying is if we could not find a suitable NPC, we can return the value inside orElse() (in this case, null). Now, this probably still looks like a bunch of wizardry to you. No worries, streams are scary at first, but after you know how to write them they're great! How to write a stream By now, you're probably itching to write a stream. In this example, we're going to find all the players within a 6 tile radius. To start off, we're going to have a function called getPlayersWithinSix(): public List<Player> getPlayersWithinSix() { return null; //We'll change this soon } Now we're going to begin the filter! To start off, we want to grab all the players, and put it in a Stream<Player>. This is what we will be filtering! public List<Player> getPlayersWithinSix() { Stream<Player> ourStream = getPlayers().getAll().stream(); return null; //We'll change this soon } Now that we have our stream, we can finally begin filtering! In this example, we only want to filter to see if the player is within 6 tiles of our own player. We're going to store the filter in another stream like so: public List<Player> getPlayersWithinSix() { Stream<Player> ourStream = getPlayers().getAll().stream(); Stream<Player> ourFilteredStream = ourStream.filter(player -> (player.exists() && getMap().distance(player) <= 6)); return null; //We'll change this soon } In our filter, we're checking these conditions: Does the player exist? Is the distance of the player within 6 tiles? Finally, we want to turn our Stream into a list so we can use it. We do this like so: public List<Player> getPlayersWithinSix() { Stream<Player> ourStream = getPlayers().getAll().stream(); Stream<Player> ourFilteredStream = ourStream.filter(player -> (player.exists() && getMap().distance(player) <= 6)); return ourFilteredStream.collect(Collectors.toList()); } See how we changed our return to ourFilteredStream.collect();? What that will do is put all of these players we found into a list, and return it. Now, this doesn't look like our streams from before, so to put it all in one line it would look like this: public List<Player> getPlayersWithinSix() { return getPlayers().getAll().stream().filter(player -> (player.exists() && getMap().distance(player) <= 6)).collect(Collectors.toList()); } Comparators, what do they do? A comparator is basically a way we compare two objects. Since the Comparator type is abstract (much like our Filter<T> class), we have to make our own compare() method. An example can be seen in our NPC closest function: new Comparator<NPC>() { @Override public int compare(NPC one, NPC two) { return Integer.compare(getMap().distance(one), getMap().distance(two)); } } What this Comparator does, in essence, is compare the distances of both NPCs (relative to the player). Since getMap().distance() returns an integer, we use Integer.compare to compare both of the distances. You'll most likely be using a Comparator to check for distance. More stream examples Here I'll be writing a few more stream examples to show why they're so useful. Find the furthest away NPC that has the name "Man": getNpcs().getAll().stream().filter(npc -> (npc.exists() && npc.getName().equalsIgnoreCase("man"))).max(new Comparator<NPC>() { @Override public int compare(NPC one, NPC two) { return Integer.compare(getMap().distance(one), getMap().distance(two)); } }).orElse(null); Get all the NPCs in a 10 tile radius that you can attack: getNpcs().getAll().stream().filter(npc -> (npc.exists() && npc.hasAction("Attack") && getMap().distance(npc) <= 10)).collect(Collectors.toList()); Get all the fishing spots where you can cage for lobsters: getNpcs().getAll().stream().filter(npc -> (npc.exists() && npc.hasAction("Cage") && npc.hasAction("Harpoon"))).collect(Collectors.toList()); If I missed anything, let me know
    4 points
  3. Who gives a shit if its botted or not? The only thing that matters is if its got any blackmarks on it. If not then its no different then any other account. I never understood why people freak out over handtrained>botted unless its power leveling or a service it shouldn't matter unless the account has a ban or blackmark.
    3 points
  4. import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "Jards", info = "A Script", name = "Goblin Killer", version = 0.01, logo = "") public class main extends Script { @Override public void onStart() { log("Welcome to gusegger's bot!"); } // all the states we can be in private enum State { IDLE, ATTACKING_GOBLIN, IN_COMBAT, AT_FIELD }; // if player is by the goblin field public boolean atField() { Player player = myPlayer(); int x = player.getPosition().getX(); int y = player.getPosition().getY(); //stating if we're in these positions if ((x > 3242) && (x < 3249) && (y > 3243) && (y < 3249)) { log("x : " + x + " y " + y); log("You're at the goblins son!"); return true; } log("x : " + x + " y : " + y); return false; } // seeing if we're in combat public boolean inCombat() { if(myPlayer().isUnderAttack()) { log("We're in combat!"); return true; } log("We're not in combat yet, punk!"); return false; } public void killingGoblin() { NPC Goblin = npcs.closest("Goblin"); if (Goblin != null && Goblin.getHealth() != 0 && Goblin.isAttackable() && Goblin.getName().contains("Goblin")) { if (map.canReach(Goblin)) { log("Attacking that punk ass goblin!"); Goblin.interact("Attack"); } } else { log("No goblins found!"); } } private State getstate() { // if we are at the field of goblins but not in combat // if we are at the field and in combat, set to in_combat if (atField() && !inCombat()) return State.ATTACKING_GOBLIN; // if we are under attack, set to in_combat if (myPlayer().isUnderAttack()) return State.IN_COMBAT; //if nothing is happening, set to idle return State.IDLE; } @Override public int onLoop() throws InterruptedException { switch (getstate()) { case IN_COMBAT: break; case ATTACKING_GOBLIN: log("Start killing a goblin!"); killingGoblin(); break; } return random(100,300); } @Override public void onExit() { log("Thanks for using gusegger's bot!"); } @Override public void onPaint(Graphics2D g) { //NYI } }
    3 points
  5. Version 1.4 - Script rewritten to work without the now removed clientside information - Dynamic signatures are now updated again - Added some handling for the new loot widget ______ Unfortunately it is no longer possible for the script to simply look up which brother is going to be in the tunnels; this means that I've also had to remove the option to "Always check the correct tomb last". I'll look into alternative ways of re-implementing this in the future
    3 points
  6. User has been IP banned, sorry for your losses.
    2 points
  7. Note: This user has a dispute being made against him, we are just waiting for mods to approve it.
    2 points
  8. You're not going crazy. If you have a wheel mouse, and scroll at all, it will change the zoom settings. Even a slight scroll of the wheel mouse will change the zoom. There isn't a bot here that I have seen that can work unless the zoom is exactly default.
    2 points
  9. Tired of crafting? Angry that there is no free crafting bot for the bs early levels? This shitty, but functional, script made in 7 minutes is the perfect solution. Directions: Make a tab with needles, threads, and hard leathers. Stand in front of a bank chest (I use castle wars bank chest) Start the script Level up Source: import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import java.util.concurrent.TimeUnit; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "Christ1665", info = "Hard Body Maker (use near a bank chest)", name = "Hard Bodies", version = 0, logo = "") public class main extends Script { @Override public void onStart() { } private enum State { BANK, SETTING_UP, WORKING } private State getState() { if (bank.isOpen()) { return State.BANK; } if (!players.inventory.contains("Hard Leather") || !players.inventory.contains("Needle") || !players.inventory.contains("Thread")) { return State.SETTING_UP; } if (players.inventory.contains("Hard Leather") || players.inventory.contains("Needle") || players.inventory.contains("Thread")) { return State.WORKING; } return null; } @Override public int onLoop() throws InterruptedException { switch(getState()) { case BANK: if (!players.getInventory().isEmpty()){ bank.depositAll(); } bank.withdraw("Hard leather", 26); bank.withdraw("Needle", 1); bank.withdraw("Thread", 12); bank.close(); break; case SETTING_UP: Entity bank = objects.closest("Bank Chest"); bank.interact("Use"); break; case WORKING: getInventory().getItem("Hard leather").interact("Use"); getInventory().getItem("Needle").interact("Use"); sleep(random(700, 950)); RS2Widget w = widgets.get(309, 2); if (w != null) w.interact("Make ALL"); sleep(random(20000, 28000)); } return random(500, 800); } @Override public void onExit() { } @Override public void onPaint(Graphics2D g) { } } Jar: http://www.mediafire.com/download/ko4uao5prg1w18d/Christ1665.jar Pic:
    1 point
  10. Just turned 17 as of 10 minutes ago!!! woot!
    1 point
  11. Oh my gosh thanks, that's so cool
    1 point
  12. Forgot to add the logs: [iNFO][bot #1][09/05 06:07:00 PM]: bank_booth sleep [iNFO][bot #1][09/05 06:07:02 PM]: Withdrawn: [Magic logs] x [0]. [iNFO][bot #1][09/05 06:07:03 PM]: bank_deposit sleep [iNFO][bot #1][09/05 06:07:03 PM]: bank sleep [iNFO][bot #1][09/05 06:07:04 PM]: Price added to item [1513]. [iNFO][bot #1][09/05 06:11:34 PM]: Terminating script Perfect Fletcher... [iNFO][bot #1][09/05 06:11:34 PM]: Script Perfect Fletcher has exited! Maybe this could help, and no worries man I love your scripts and I know that u deliver quality scripts ! Thats why I got almost every Perfect # Script..
    1 point
  13. I appreciate the trial (I actually already bought it, but there's some delay from PayPal to you guys I guess?). However, I'm on F2P trying to bank salmon in Edge from Barb and it just runs me in circles, never banking. The fishing portion works great, but just not banking. Your mining tool works great btw.
    1 point
  14. Dude you don't need test . Its FLAWLESS!!!!!!!!!
    1 point
  15. I've placed the user in TWC and let them know of the dispute. Can you post a picture of his skype profile?
    1 point
  16. Shouldn't matter in the example you provided though right? Or does the problem lie in the fact that I create a new Stream<Player>?
    1 point
  17. Stream<Player> ourStream = getPlayers().getAll().stream(); Stream<Player> ourFilteredStream = ourStream.filter(player -> (player.exists(); Keep in mind that you can only consume a stream once. Nice tutorial though
    1 point
  18. I haven't been contacted about any dispute via skype but thanks for the heads up I suppose. Mods can close this until the dispute is over.
    1 point
  19. Try deleting the Goblin.getHealth() != 0. I'm not sure but I think you can only check their health if they are already in combat which is not the case.
    1 point
  20. Not interested but best of luck!
    1 point
  21. i hate the internet sometimes
    1 point
  22. - Script name: AIO RuneCrafter (24h) - Your member number (hover over your name to see it): 66292 I will buy it 100% if i enjoy it. ill try it only for like a 6 hour log and then buy it. rc and slay most complicated scripts and if yours is good you deserve the moneh. EDIT: i don't know how to activate it. its not in my lib
    1 point
  23. inb4 'selling lvl 83 pure, 70 qp' threads influxin
    1 point
  24. I'm in east mode, I usually set my limit for players until world hopping at 7. but sometimes when I come back there will be 9+. sometimes if I do let it run for another 15+ minutes i'll come back and it will have switched worlds but still delay. thanks for fast replying. marcus
    1 point
  25. 1 point
  26. If this is the Norweigan cruise line you won't regret it, went on this cruise this summer of July and holy shit it was the best time I've ever had.
    1 point
  27. old you just had to show the ironman symbol right? how do we know how someone is an ironman?? -they fucking tell you
    1 point
  28. As i re-sold the account and the person put some trust into me i wouldnt mind paying back half if thats fine with peoples. @Fruity
    1 point
  29. This happens for non-mirror users too
    1 point
  30. Thank you very much! One of the capes I've always wanted, but never could afford. Uhm, probably around 30m, depending on potion prices and etc. I cleaned a lot of herbs, since the cost is way lower if you do that, though I got impatient towards the 90+ levels and started to buy unf pots. I'd recommend super attacks, pretty cheap-ish.. 4-5gp/xp. I made a whole lot of unfinished potions myself, since you can sometimes get 700k gp/hr when doing it. Play around with it.. Took me nearly a month to get it, even when I'm always at the PC when botting. Bot with caution!
    1 point
  31. Just to let everyone know: 99 herblore achieved with this script. Thank you, Czar!
    1 point
  32. Had 20m lure teleport out (no tber sadly) but just got a solid 10m lure
    1 point
×
×
  • Create New...