Jump to content

PolishCivil

Members
  • Posts

    669
  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    100%

Everything posted by PolishCivil

  1. Eclipse: Ctrl + a & Ctrl + Shift + F Intellij: Ctrl + Alt + L Also u can mix it with: package dependencies.api; import dependencies.api.listeners.ATInventoryListener; import org.osbot.script.Script; import java.util.ArrayList; import java.util.Arrays; /** * @author Xavier */ public class ATInventoryTracker implements Runnable { private Script script; private int[] ids, stacks; private int updateRate = 200; private final ArrayList<ATInventoryListener> listeners; private boolean running = true; private boolean ignoreName; public ATInventoryTracker(Script script) { super(); this.script = script; listeners = new ArrayList<>(); } public void start() { new Thread(this).start(); } public void addListener(ATInventoryListener listener) { if (listener != null) { listeners.add(listener); } } public ArrayList<ATInventoryListener> getListeners() { return listeners; } @Override public void run() { do { try { if (ids == null || stacks == null) { ids = script.client.getInterface(149).getChild(0).getInv(); stacks = script.client.getInterface(149).getChild(0).getInvStackSizes(); } else { int[] new_ids = script.client.getInterface(149).getChild(0).getInv(); int[] new_stacks = script.client.getInterface(149).getChild(0).getInvStackSizes(); //forgot about moved :p I just need added atm for (int i = 0; i < ids.length; i++) { if (new_ids[i] == ids[i] && new_stacks[i] == stacks[i]) { continue; } if (new_ids[i] != ids[i]) { if (ids[i] - 1 != -1) { dispatchRemoved(i, ids[i] - 1, stacks[i]); } if (new_ids[i] - 1 != -1) { dispatchAdded(i, new_ids[i] - 1, new_stacks[i]); } } else if (new_stacks[i] != stacks[i]) { int difference = new_stacks[i] - stacks[i]; if (difference > 0) { dispatchAdded(i, ids[i] - 1, Math.abs(difference)); } else { dispatchRemoved(i, ids[i] - 1, Math.abs(difference)); } } } ids = Arrays.copyOf(new_ids, new_ids.length); stacks = Arrays.copyOf(new_stacks, new_stacks.length); sleep(updateRate); } } catch (Exception e) { e.printStackTrace(); } } while (running); } public void stop() { running = false; } public void setIgnoreName(boolean ignoreNames){ ignoreName = ignoreNames; } private void sleep(int updateRate) { try { Thread.sleep(updateRate); } catch (InterruptedException ex) { //ignore } } private void dispatchRemoved(int slot, int id, int stack) { for (ATInventoryListener listener : listeners) { listener.itemRemoved(slot, id, stack); } } private void dispatchAdded(int slot, int id, int stack) { for (ATInventoryListener listener : listeners) { listener.itemAdded(slot, id, stack, ignoreName ? null : script.client.getInventory().getItemForId(id).getName()); } } private void dispatchMoved(int fromSlot, int toSlot, int id, int stack) { for (ATInventoryListener listener : listeners) { // listener.itemMoved(fromSlot, toSlot, id, stack); } } }
  2. Attention to all users xavier is green hippo, because he use crt from nokia
  3. Yea lol... You thought I hold there water to drink? Jeez what a stupid question
  4. XD i bought everything from scripting ;3
  5. Guess how my looked 15 min ago.
  6. Buy atmega8 and make diode blink. (my first code ever created) There is book C for microcontrollers in my country so search for sth like this.
  7. Lol we dont need such much code to know if someone is good scripter/programmer. I don't even need script's code to review. Btw aint you just administrator?
  8. I doubt you write very secret code. Just use proguard or make own asm renamer, mabye some text encoder and thats all you need. You can find ZKM cracked on google.
  9. "being the one that actually can see their source" I bet someone can share piece of code to be OSD.
  10. http://pastebin.com/8ztibTv5 public boolean samePosition(Position one, Position two) { if(one.getX() != two.getX()) return false; if(one.getY() != two.getY()) return false; if(one.getZ() != two.getZ()) return false; return true; } http://pastebin.com/KJc43RXz http://pastebin.com/SsVuJ8q3 MAGIC Now tell me... Honestly.... OSD? He's working for other bot! Demote demote demote!
  11. We are not bitching about 'idea' idea is cool (also copy) but work is... IMO not good (very polite). I really doubt i deserve my rank ;( I cant read it ;(
  12. Yea Dash must be god if he can read all this super tiny class names. IF YOU GUYS ARE NOT ABLE TO READ THIS NAMING, YOU WILL NEVER GET OSD!!!! So yh ;( Nitrousek you loose.
  13. Everyone wins except SSF creator.
  14. Abracadabra let's poll appear.
×
×
  • Create New...