Jump to content

House

Trade With Caution
  • Posts

    510
  • Joined

  • Last visited

  • Feedback

    97.4%

Everything posted by House

  1. What does this code do? It generates an area with specified dimensions spread outward. Why is it useful? can be used to generate locations to walk to near an object. Code: Examples:
  2. Using my logic from my previous post my monitor is outside
  3. I code with my window open, does that make my room outside?
  4. What is this? A class which manages timers for delayed actions in a script with a fancy name including SIMULATOR! Why is it useful? Ease of implementation. Flaws? It can only be treated as one timer at a time and can not track multiple delays at a time unless the code is expanded. This is pretty meh but its useful and maybe someone will find it useful when they start out scripting. In tasks such as smithing or other highly afk tasks i think that reaction time to notice inventory completion is important to simulate human like behavior to reduce bans. This sort of "anti-ban" if they even do anything helps break patterns that could be detectable, then again if you have a shitty method to interact with things in the world then it won't save you. Also note that humans are not as random as you think they are and everyone has habits! [updated using suggestions by @PolishCivil] public class HHumanSimulator { //Default time in seconds to wait. private static final int default_min_reaction_time = 5; private static final int default_max_reaction_time = 15; //While active the script will be idle. private static boolean active = false; //Time is saved in milliseconds in here every time a new simulation start. private static long start_time; //The randomly generated wait time in milliseconds in stored here. private static long current_reaction_time; //Check if you can do the task. public static boolean check() { if (!active) { start_time = System.currentTimeMillis(); current_reaction_time = randomReactionTime(default_min_reaction_time, default_max_reaction_time); active = true; } if (System.currentTimeMillis() - start_time > current_reaction_time) active = false; return !active; } //Same as above however this method lets you add your own custom times rather than default. public static boolean check(int new_min_reaction_time, int new_max_reaction_time) { if (!active) { start_time = System.currentTimeMillis(); current_reaction_time = randomReactionTime(new_min_reaction_time, new_max_reaction_time); active = true; } if (System.currentTimeMillis() - start_time > current_reaction_time) active = false; return !active; } //Same as above however lets you set a % chance for it to trigger or not. public static boolean check(int new_min_reaction_time, int new_max_reaction_time, int trigger_chance) { if (!active && trigger(trigger_chance)) { start_time = System.currentTimeMillis(); current_reaction_time = randomReactionTime(new_min_reaction_time, new_max_reaction_time); active = true; } if (System.currentTimeMillis() - start_time > current_reaction_time) active = false; return !active; } //Returns a boolean based on a % chance. private static boolean trigger(int chance) { int rand = ThreadLocalRandom.current().nextInt(101); return rand <= chance; } //Returns the time left till simulation is done. public static long debugTimeLeft() { return current_reaction_time - (System.currentTimeMillis() - start_time); } //Generates a random long between two values. private static long randomReactionTime(int min, int max) { int random_reaction_time = ThreadLocalRandom.current().nextInt((max - min) + 1) + min; return random_reaction_time * 1000L; } } Example Usage: if (!inventory.contains(gold_bar_id)) { if (HHumanSimulator.check(5, 15, 50)) GoldSmither.setState(State.BANK); return; }
  5. err, getSlotBounds() just generates the rectangle that the item in the inventory takes up, then it just moves the mouse to the first items area, simulates a mouse button press, moves into the target area, simulates a mouse release. moveItem(0,27); Example moves from first first slot in the top left to the very bottom right. I do recommend using Th3's version though, its the same thing however it uses api methods that serve the same purpose, this means its easier to implement interrupts in the evaluate method as well.
  6. inb4 TSA thinks this is an ISIS communications forum.
  7. This explains how I got 77 smiting with cannonballs in less than a week on multiple accounts xD
  8. Didn't know a bunch of that stuff existed. My similar approach ghetto version: public void moveItem(int start_slot, int end_slot) { Rectangle start_slot_bounds = getSlotBounds(start_slot); Rectangle end_slot_bounds = getSlotBounds(end_slot); Mouse mouse = getMouse(); mouse.move(new RectangleDestination(getBot(), start_slot_bounds)); getBot().getMouseEventHandler().generateBotMouseEvent(MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0, (int) mouse.getPosition().getX(), (int) mouse.getPosition().getY(), 0, false, 0, true); mouse.move(new RectangleDestination(getBot(), end_slot_bounds)); getBot().getMouseEventHandler().generateBotMouseEvent(MouseEvent.MOUSE_RELEASED, System.currentTimeMillis(), 0, (int) mouse.getPosition().getX(), (int) mouse.getPosition().getY(), 0, false, 0, true); } public Rectangle getSlotBounds(int slot_id) { int min_x = 563; int min_y = 213; int item_dimension = 31; int gap_x = 11; int gap_y = 5; int column = (int) Math.floor(slot_id / 4); int row = slot_id % 4; int slot_y = min_y + (item_dimension * column) + (gap_y * column); int slot_x = min_x + (item_dimension * row) + (gap_x * row); return new Rectangle(slot_x, slot_y, item_dimension, item_dimension); }
  9. This all takes like 10 hours max lol. Defo not worth 30m
  10. PC if i were the nigerian prince
  11. Please pc level 70 and 80 Smithing accounts with the Dwarf Cannon quest completed as well. Would they be worth anything? (Addy and Rune bars at BF)
  12. You can set it to auto-dismiss random events in the settings of the client.
  13. I'm not directly stating its what you are going to teach, my point is to teach you have to know the proper way and not just the way that works!
  14. Make sure you teach stuff that is correct / conventional and not ghetto osbot scripter equivalent
  15. int itemCount = (int) getScript().getInventory().getAmount("Beer"); public int getIncrease(String name) { int count = 0; for (Item item : getScript().getInventory().getItems()) { if (item == null) break; if (item.getName().equals(name)) count++; } int increaseAmount = count - itemCount; itemCount = count; return increaseAmount; } Don't forget to handle when you bank and the increase becomes negative
  16. Just in case you're not sure what "alphanumeric" means. Anything that's numbers and letters.
  17. I know all this, Just if plebs see posts like this they will be like "omg Realist is ".
  18. I cant decipher @Zerker 's intentions, he memes with Realist but then also fucks him over by posting it.
  19. Can't wait till it tries to hop to a DMM world or a PVP world
  20. Untested: boolean hop = false; int oldWorld = -1; if (hop) { if (getStore().isOpen()) { getStore().close(); return 300; } getWorlds().hopToP2PWorld(); if (oldWorld != getWorlds().getCurrentWorld()) hop = false; return 300; } if (!getStore().isOpen()) { // open store return 300; } String item1Name = "Item1"; String item2Name = "Item2"; Item item1 = getStore().getItem(item1Name); Item item2 = getStore().getItem(item2Name); if (item1 != null && getStore().getAmount(item1Name) > 0) { getStore().buy(item1Name, 5); return 300; } if (item2 != null && getStore().getAmount(item2Name) > 0) { getStore().buy(item2Name, 5); return 300; } hop = true; oldWorld = getWorlds().getCurrentWorld(); Hope you get the gist of it Also use HHopper
×
×
  • Create New...