Jump to content

TheScrub

Members
  • Posts

    1130
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by TheScrub

  1. Will be playing against osbot members in funorb chess Scrub V.S Acerd ~ Scrub Win Gilgad vs JLaw ~ Gilgad win Gilgad vs JLaw ~ Gilgad win Gilgad vs Asuna ~ Gilgad win Gilgad vs Crazy ~ Gilgad win Gilgad vs Jack44 ~ Gilgad win Gilgad vs Megaman ~ Gilgad win Gilgad vs Zezurge ~ Gilgad win Gilgad vs Gotenks ~ Gilgad win mustard vs scrub ~ mustard win If you want to challenge me/ have a match post something below
  2. the osbot 1 emulator is working pretty good
  3. being a script developer and have used the osbot 2 client i don't think it will be ready for public release soon..
  4. TheScrub

    Prayer API

    the data there is fine just need to do the bitwise operations for selection
  5. TheScrub

    Prayer API

    package prayer; import java.util.ArrayList; import java.util.List; import org.osbot.script.Script; import org.osbot.script.rs2.skill.Skill; import org.osbot.script.rs2.ui.RS2InterfaceChild; public class Prayers { private Script script; public Prayers(Script script) { this.script = script; } enum Prayer { THICK_SKIN(1, 1, 1, "Thick Skin"), BURST_OF_STRENGTH(4, 2, 2, "Burst of Strength"), CLARITY_OF_THOUGHT(7, 4, 3, "Clarity of Thought"), SHARP_EYE(8, 262144, 4, "Sharp Eye"), MYSTIC_WILL( 9, 524288, 5, "Mystic Will"), ROCK_SKIN(10, 8, 6, "Rock Skin"), SUPERHUMAN_STRENGTH( 13, 16, 7, "Superhuman Strength"), IMPROVED_REFLEXES(16, 32, 8, "Improved Reflexes"), RAPID_RESTORE(19, 64, 9, "Rapid Restore"), RAPID_HEAL( 22, 128, 10, "Rapid Heal"), PROTECT_ITEM(25, 256, 11, "Protect Item"), HAWK_EYE(26, 1048576, 12, "Hawk Eye"), MYSTIC_LORE( 27, 2097152, 13, "Mystic Lore"), STEEL_SKIN(28, 512, 14, "Steel Skin"), ULTIMATE_STRENGTH(31, 1024, 15, "Ultimate Strength"), INCREDIBLE_REFLEXES(34, 2048, 16, "Incredible Reflexes"), PROTECT_FROM_MAGIC(37, 4096, 17, "Protect from Magic"), PROTECT_FROM_MISSILES(40, 8192, 18, "Protect from Missiles"), PROTECT_FROM_MELEE(43, 16384, 19, "Protect from Melee"); private int requiredPrayerLevel; private int configValue; private int slot; private String prayerName; Prayer(final int requiredPrayerLevel, final int configValue, final int slot, final String prayerName) { this.requiredPrayerLevel = requiredPrayerLevel; this.configValue = configValue; this.slot = slot; this.prayerName = prayerName; } public int getRequiredPrayerLevel() { return requiredPrayerLevel; } public int getConfigValue() { return configValue; } public int getSlot() { return slot-1; } public String getName() { return prayerName; } } public boolean hasRequiredPrayerLevel(Prayer p) { return script.client.getSkills().getLevel(Skill.PRAYER) >= p .getRequiredPrayerLevel(); } public boolean isSet(Prayer p) { return p != null && getSelectedPrayers().contains(p); } public List<Prayer> getSelectedPrayers() { List<Prayer> selectedPrayers = new ArrayList<Prayer>(); for (Prayer p : Prayer.values()) { if ((script.client.getConfig(83) & (1 << getReversedPower(2, p.getConfigValue()))) != 0) { selectedPrayers.add(p); } } return selectedPrayers; } public List<Prayer> getSelectedQuickPrayers() { List<Prayer> selectedPrayers = new ArrayList<Prayer>(); for (Prayer p : Prayer.values()) { if ((script.client.getConfig(84) & (1 << getReversedPower(2, p.getConfigValue()))) != 0) { selectedPrayers.add(p); } } return selectedPrayers; } public boolean isSetQuickPrayer(Prayer p){ return p != null && getSelectedQuickPrayers().contains(p); } public boolean isQuickPrayerMenuOpen(){ return getChild(77,4) !=null; } private RS2InterfaceChild getChild(int parent, int child) { if (script.client.getInterface(parent) != null) { RS2InterfaceChild c = script.client.getInterface(parent).getChild(child); if (c != null && c.isVisible()) { return c; } } return null; } /* * Used to figure out how many shifts are needed.. */ private int getReversedPower(int powerOfNumber, int endNumber) { for (int i = 1; i < 31; i++) { if (Math.pow(powerOfNumber, i) == endNumber) { return i; } } return 0; } } the slot class to return the slots like such.. package prayer; import java.awt.Point; import java.awt.Rectangle; import org.osbot.script.Script; import org.osbot.script.mouse.RectangleDestination; import org.osbot.script.rs2.ui.RS2InterfaceChild; import org.osbot.script.rs2.ui.Tab; import prayer.Prayers.Prayer; public class PrayerSlot { private Script script; private Prayers prayers; public PrayerSlot(Script script) { this.script = script; prayers = new Prayers(script); } private final int START_WIDTH = 553; private final int START_HEIGHT = 218; private final int WIDTH = 37; private final int HEIGHT = 37; private Point getPoint(int slot) { int column = slot / 5; int row = slot % 5; int x = (int) (START_WIDTH + (row * WIDTH)); int y = (int) START_HEIGHT + (column * HEIGHT); return new Point(x, y); } public Rectangle getRectangle(int slot) { Point p = getPoint(slot); return new Rectangle(p.x, p.y, 30, 27); } public void togglePrayerOn(Prayer p) throws InterruptedException { if (p != null && !prayers.isSet(p)) { Rectangle interactionSlot = getRectangle(p.getSlot()); if (script.currentTab() != null && interactionSlot != null) { if (!script.currentTab().equals(Tab.PRAYER)) { script.openTab(Tab.PRAYER); } if (script.currentTab().equals(Tab.PRAYER)) { interact(interactionSlot, "Activate"); } } } } public void togglePrayerOff(Prayer p) throws InterruptedException { if (p != null && prayers.isSet(p)) { Rectangle interactionSlot = getRectangle(p.getSlot()); if (script.currentTab() != null && interactionSlot != null) { if (!script.currentTab().equals(Tab.PRAYER)) { script.openTab(Tab.PRAYER); } if (script.currentTab().equals(Tab.PRAYER)) { interact(interactionSlot, "Deactivate"); } } } } public void toogleQuickPrayerOn(Prayer p) throws InterruptedException { if (p != null && !prayers.isSetQuickPrayer(p)) { Rectangle interactionSlot = getRectangle(p.getSlot()); if (script.currentTab() != null && interactionSlot != null) { if (!script.currentTab().equals(Tab.PRAYER)) { script.openTab(Tab.PRAYER); } if (script.currentTab().equals(Tab.PRAYER)) { interact(interactionSlot, "Toggle"); } } } } public void toogleQuickPrayerOff(Prayer p) throws InterruptedException { if (p != null && prayers.isSetQuickPrayer(p)) { Rectangle interactionSlot = getRectangle(p.getSlot()); if (script.currentTab() != null && interactionSlot != null) { if (!script.currentTab().equals(Tab.PRAYER)) { script.openTab(Tab.PRAYER); } if (script.currentTab().equals(Tab.PRAYER)) { interact(interactionSlot, "Toggle"); } } } } public void confirmQuickPrayers() throws InterruptedException { if (script.currentTab() != null && prayers.isQuickPrayerMenuOpen()) { if (!script.currentTab().equals(Tab.PRAYER)) { script.openTab(Tab.PRAYER); } if (script.currentTab().equals(Tab.PRAYER)) { interact(getChild(77,4).getRectangle(),"Done"); } } } public void openQuickPrayerMenu() throws InterruptedException{ //548,85 if (getChild(548,85) !=null){ interact(getChild(548,85).getRectangle(),"Setup"); } } public void activateQuickPrayers() throws InterruptedException{ if (getChild(548,85) !=null){ getChild(548,85).interact("Activate"); } } private RS2InterfaceChild getChild(int parent, int child) { if (script.client.getInterface(parent) != null) { RS2InterfaceChild c = script.client.getInterface(parent).getChild(child); if (c != null && c.isVisible()) { return c; } } return null; } private boolean interact(Rectangle rec, String action) throws InterruptedException { return script.selectOption(null, new RectangleDestination(rec), action); } } updated it again a little
  6. reworking it got my web hosting pasting new pictures...
  7. this snippet is pretty old and is only used by me in osbot 2 related stuff as the api doesn't contain an AREA class
  8. omni bad news my paint has a mistake on it from you didn't notice it says thesrub instead of thescrub
  9. a megaman type of game like owata would be fun to make owata for anyone who hasn't played link not working... dagobah.net/flash/owata.swf
  10. you press add script find the script press file transfer and your done.
  11. TheScrub

    Trade API

    just updated the class added the methods to return the rectangles for the trade and renamed stuff
  12. TheScrub

    v1.7.77-79

    -edit made a thread in scripter section
  13. TheScrub

    v1.7.77-79

    my suggestion got added in
  14. presuming those are cammy tabs (math related guess) if he managed to sell those at 1k ea. I would presume the profit to be in margin of 20-21m give or take 1m this is 116 hrs which is 16% more than 100hrs a little more than just past
  15. TheScrub

    Trade API

    you would need to check if your in a trade and if your in a trade check if they have put up the money and press accept
  16. smart but i just relised you can easily use math to click along the to the correct spot..
  17. good idea but also this will be a good open source to teach people how to use scroll bars in relation to runescape this can be useful for other stuff
  18. i don't like the scrolling so i'm going to make it not fail scrolling but it's going to click the little buttons so it will be alil slow
  19. acerd is right here is most of the items that ankous drop that you would need to add items with # at the end are stackables
  20. need to make scrolling methods public boolean bankIsOpen() { if (script.client.getInterface(12) != null) { RS2InterfaceChild c = getChild(12,21); if (c != null && c.isVisible()) { return true; } } return false; } private RS2InterfaceChild getChild(int parent, int child) { if (script.client.getInterface(parent) != null) { RS2InterfaceChild c = script.client.getInterface(parent).getChild( child); if (c != null && c.isVisible()) { return c; } } return null; } public int getScrollHeight() { if (!bankIsOpen()) { return -1; } return getChild(12, 6).getScrollPosition(); } public int getColumn(int slot) { return slot / 8; } public int getRow(int slot) { return slot % 8; } // you can view the first 6 columns at the height of 0 public int getMinScrollHeightNeeded(int slot) { return getColumn(slot) > 5 ? (getColumn(slot) - 5) * 37 : 0; } public int getMaxScrollHeightNeeded(int slot) { return getMinScrollHeightNeeded(slot) + (37 * 5); } public boolean slotVisable(int slot) { return (getScrollHeight() >= getMinScrollHeightNeeded(slot) && getScrollHeight() <= getMaxScrollHeightNeeded(slot)); } public boolean needToScrollUp(int slot) { return !slotVisable(slot) && getScrollHeight() > getMaxScrollHeightNeeded(slot); } public boolean needToScrollDown(int slot) { return !slotVisable(slot) && getScrollHeight() < getMinScrollHeightNeeded(slot); } public boolean needToScroll(int slot) { return needToScrollDown(slot) || needToScrollUp(slot); } public boolean contains(String item) { Item[] items = getBankItems(); if (items != null && items.length > 0) { for (Item i : items) { if (i != null && i.getName() != null && i.getName().equalsIgnoreCase(item)) { return true; } } } return false; } public boolean contains(int item) { Item[] items = getBankItems(); if (items != null && items.length > 0) { for (Item i : items) { if (i != null && i.getId() > 0 && i.getId() == item) { return true; } } } return false; } public int getSlotForName(String name) { if (bankIsOpen()) { Item[] array = getBankItems(); for (int i = 0; i < array.length; i++) { if (array[i] != null) { if (array[i].getName() != null) { if (array[i].getName().equalsIgnoreCase(name)) { return i; } } } } } return -1; }
  21. Creating gold in the form of java

  22. nah to make safe spotting it's alot of effort
  23. if it's not in the snippet section it doesn't count. enough said
×
×
  • Create New...