Advertisement
OSRSMargins

Untitled

Sep 9th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. @Override
  2. public void onConfig(int id, int value) throws InterruptedException {
  3. if (runes.size() == 3) {
  4. if (id == 1139) {
  5. /*
  6. * Gets the quantities of runes in rune pouch from configs
  7. */
  8. long con = (long) value; // getConfigs().get(1139);
  9. long config = con < 0 ? Integer.MAX_VALUE + (Integer.MAX_VALUE - Math.abs(con)) : con;
  10.  
  11. if (config > 0) {
  12. int first = 0, second = 0, third = 0;
  13.  
  14. int slotConfig = getConfigs().get(1140);
  15. if (slotConfig > 0) {
  16. if (slotConfig >= 16385) {
  17. third = (int) Math.floor(slotConfig / 16384);
  18. slotConfig = slotConfig % 16384;
  19. }
  20.  
  21. if (slotConfig > 0) {
  22. second = slotConfig;
  23. }
  24. }
  25.  
  26. int a = ((int) Math.floor(config / 4096));
  27. first = (int) Math.floor(a / 64);
  28. // f = f % 64;
  29.  
  30. // Rune runeC = Rune.forValue(f);
  31. // config = config % 4096;
  32. addRune((Rune) runes.keySet().toArray()[2], third);
  33.  
  34. // e = (int) Math.floor(config / 64);
  35. // Rune runeB = Rune.forValue(e);
  36. // config = config % 64;
  37. addRune((Rune) runes.keySet().toArray()[1], second);
  38.  
  39. // Rune runeA = Rune.forValue((int) config);
  40. addRune((Rune) runes.keySet().toArray()[0], first);
  41. } else {
  42. runes = new LinkedHashMap<>();
  43. }
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement