Jump to content

Swizzbeat

Members
  • Posts

    7986
  • Joined

  • Last visited

  • Days Won

    58
  • Feedback

    100%

Everything posted by Swizzbeat

  1. Implementation for people to use in their scripts to support quick prayer. Probably a more viable option just to have users select using quick prayers instead of manually selecting/having the bot turn on the prayers they need. import org.osbot.script.Script; import org.osbot.script.rs2.ui.RS2Interface; import org.osbot.script.rs2.ui.RS2InterfaceChild; import org.osbot.script.rs2.ui.Tab; /** * Created with IntelliJ IDEA * User: Anthony * Date: 5/18/2014 */ public class QuickPrayerController { private final Script sI; public QuickPrayerController(final Script sI) { this.sI = sI; } /** * Checks if orbs are currently enabled for the player * * @return whether orbs are enabled or not */ public boolean areOrbsEnabled() { return sI.client.getConfig(1055) == 16; } /** * Toggles data orbs on or off * * @param off whether to toggle off * @return successful or unable to complete operation * @throws InterruptedException */ public boolean toggleOrbs(boolean off) throws InterruptedException { boolean returnValue = false; if (!areOrbsEnabled() == off) { returnValue = false; } else { if (!sI.currentTab().equals(Tab.SETTINGS)) { sI.openTab(Tab.SETTINGS); } if (sI.currentTab().equals(Tab.SETTINGS)) { final RS2Interface parent = sI.client.getInterface(261); if (parent != null) { final RS2InterfaceChild child = parent.getChild(9); if (child != null && child.isVisible()) { returnValue = child.interact(); } } } } return returnValue; } /** * Checks if quick prayer is turned on * * @return whether quick prayer is activated or not */ public boolean isQuickPrayerOn() { return sI.client.getConfig(83) > 0; } /** * Toggles quick prayer on or off * * @param off whether to toggle off * @return successful or unable to complete operation * @throws InterruptedException */ public boolean toggleQuickPrayer(boolean off) throws InterruptedException { boolean returnValue = false; if (!areOrbsEnabled() || !isQuickPrayerOn() == off) { returnValue = false; } else { final RS2Interface parent = sI.client.getInterface(548); if (parent != null) { final RS2InterfaceChild child = parent.getChild(85); if (child != null && child.isVisible()) { returnValue = child.interact(); } } } return returnValue; } }
  2. coming from male with picture of shirtless male in siggy
  3. http://www.runelocus.com/tools/rs-item-id-list/
  4. Awesome, can't wait to see how SSF does
  5. Goodluck, don't kill yourself trying to play this game legit
  6. http://www.microsoft.com/en-us/download/details.aspx?id=10732
  7. Post that video of you with the finger lights!!!
  8. I never realized how good these guys were until I saw this.
  9. Swizzbeat

    Prayer

    Use a bitmask to check if the bit which represents Piety is turned on. You should be able to get it easy checking for config changes (pretty sure the config is 83).
  10. Swizzbeat

    client.blahblah

    Work on your naming conventions.
  11. I'm creating wrapper classes for some stuff, however it seems that for this one at least I'm getting an NPE when I check for whether it exists or not. Here's the (unfinished) wrapper class: package core.utils.wrappers; import org.osbot.accessor.XGroundItem; import org.osbot.script.Script; import org.osbot.script.rs2.model.GroundItem; /** * Created with IntelliJ IDEA * User: Anthony * Date: 5/13/2014 */ public class Loot extends GroundItem { private XGroundItem instance; private Script sI; public Loot(XGroundItem instance, Script sI) { super(instance); this.instance = instance; this.sI = sI; } public void pickUp(boolean loopUntilPickedUp) throws InterruptedException { do { interact("Take"); } while (loopUntilPickedUp && exists()); } public XGroundItem getInstance() { return instance; } } The part where I am getting the NPE is when I declare an object of type Loot and call the #exists() method (could be an issue for other methods but I haven't got past this one yet). I declare the object in a similar fashion to this: Loot loot = new Loot(closestGroundItemForName("whatever").instance, sI); The error message is then logged to the console: [ERROR][05/14/14 08:10:52 AM]: Error on executing script worker! java.lang.NullPointerException at org.osbot.script.rs2.model.GroundItem.getZ(zf:147) at org.osbot.script.rs2.map.Region.contains(dg:154) at org.osbot.script.rs2.model.GroundItem.exists(zf:84) at core.tasks.Looter.execute(Looter.java:41) at core.task_framework.TaskManager.findAndExecuteTaskInCategory(TaskManager.java:22) at core.Main.onLoop(Main.java:133) at org.osbot.hc.run(um:136) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Any help would be appreciated. I feel like I'm doing something incredibly stupid O_o FYI my other wrapper classes work fine.
  12. http://jd.benow.ca/ And you decompile the .java files. If it's obfuscated you'll see random bytecode everywhere as well as weirdly named methods/variables.
  13. Even if a script is broken, it should be helpful just to look at it based on a learning perspective.
  14. Learn the Java programming language. No matter what client you're scripting for you're going to need to know it.
  15. Based on the fact that he said he's new to Java, I doubt hes going to care about what thread his GUI is running on. @OP this would be the correct way to run the GUI though.
  16. That's why I would keep this picture in my pocket at all times to show them:
  17. Imagine just casually talking to some girl and all of a sudden her bra just pops off.
  18. No I 100% meant name changes, but while were discussing additional features for us to have that would be a nice one. ily
  19. Guess employers aren't required to pay their workers if they don't feel like it since it's just a benefit. Also, who cares who's going to even use it or not. We have unlimited tabs and I've used at max two, but that doesn't mean it's suddenly going to be removed. Your arguments are completely pointless and make no logical sense.
×
×
  • Create New...