Welcome to TRiBot Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Divinius

Registered
  • Content count

    53
  • Joined

  • Last visited

  • Feedback

    0%

Community Reputation

5 Neutral

About Divinius

  • Rank
    Botter
  • Birthday 07/30/1993

Personal

  • Sex
  • Location
    The Netherlands
  • Bio
    Have you been thinking of selling your script for a few Dollars but you don't know how to distribute your script? Or perhaps you simply cannot afford to set up a server to handle the processes, or maybe you know nothing of PHP? Well, you do not need to!

    ...read more: https://tribot.org/forums/showthread.php?tid=4042
  1. This means that System.out is null. In other words, you've probably been modifying it.
  2. public int[] getDimensions () { return (new int[]{topLeftX, topLeftY, bottomRightX, bottomRightY}); } OUCH Edit: not to mention: public static HashMap prayers = new HashMap(); static { for (Prayer p : Prayer.values()) { prayers.put(p.getId(), p); } }
  3. You just made yourself look like a complete retard.
  4. idiot.
  5. No. There was an error posting your reply: The message is too short. Please enter a message longer than 5 characters.
  6. Don't ignore me: you're losing all of your script writers this way.
  7. It's temp.jar; not temp.exe It's placed there simply because TRiBot doesn't allow me to actually use anything but the .tribot folder; otherwise I would have used the temporary appdata directory. Furthermore, TRIBot doesn't allow scripts to delete files, for I would have made the loader delete the jar after extracting otherwise. Don't be so paranoid next time.
  8. Hustl3r also cannot access the forums because of an incorrect IP ban.
  9. You have not even tested it and you are asking for our feedback?
  10. You should have mentioned that this would only work in Lite mode.
  11. I have written a nice PDF tutorial, if you want to apply for Script Writer I highly insist you read and obey these rules. http://sjbijzitter.info/book/Java%20Conventions.pdf
  12. The pieces of code posted are trash.
  13. O i just saw there's also books? I'll edit that in Code (which includes handling of books): http://paste.strictfp.com/37607/1db6bbf7ad6800efcb843fa8b8810dae package scripts;import org.tribot.api2007.GameTab;import org.tribot.api2007.Interfaces;import org.tribot.api2007.Inventory;import org.tribot.api2007.types.RSInterface;import org.tribot.api2007.types.RSItem;import org.tribot.script.Script;public class LampSolver extends Script { private enum SkillChoice { AGILITY(10), ATTACK(3), HITPOINTS(8), CONSTRUCTION(24), COOKING(18), CRAFTING(13), DEFENSE(7), FARMING(23), FIREMAKING(19), FISHING(17), FLETCHING(21), HERBLORE(11), HUNTER(25), MAGIC(6), MINING(15), PRAYER(9), RANGED(5), RUNECRAFTING(14), SLAYER(22), SMITHING(16), STRENGTH(4), THIEVING(12), WOODCUTTING(20); private static final int INTERFACE_PARENT = 134; private static final int INTERFACE_CONFIRM_CHILD = 26; private final String name; private final int interface_child_id; private SkillChoice(final int interface_child_id) { this.name = toTitle(toString()); this.interface_child_id = interface_child_id; } private String getName() { return name; } private int getInterfaceChildID() { return interface_child_id; } } private final int[] reward_ids = {2528, 11640}; //reward, book private final String[] actions = {"Rub", "Read"}; //I have no idea what the actions are, I'm just guessing. private final SkillChoice choice = SkillChoice.values()[getSelectedRewardIndex()]; //where getSelectedRewardIndex() returns the index of the selected reward from the JComboBox in the account manager @Override public void run() { if (!isInventoryOpen()) { return; //We do not want to force the script to open the inventory } if (hasHandledInterfaces()) { return; //Solved } if (!hasHandledReward()) { return; //We miss-clicked or the interface didn't show up, better luck next time. } if (hasHandledInterfaces()) { return; //Solved } } private boolean isInventoryOpen() { return GameTab.getOpen().equals(GameTab.TABS.INVENTORY); } private RSItem getRewardItem() { final RSItem[] lamps = Inventory.find(reward_ids); return lamps.length > 0 ? lamps[0] : null; } private RSInterface getSkillInterfaceChild() { return Interfaces.get(SkillChoice.INTERFACE_PARENT, choice.getInterfaceChildID()); } private RSInterface getConfirmInterfaceChild() { return Interfaces.get(SkillChoice.INTERFACE_PARENT, SkillChoice.INTERFACE_CONFIRM_CHILD); } private boolean hasHandledInterfaces() { final RSInterface skill_interface = getSkillInterfaceChild(); final RSInterface confirm_interface = getConfirmInterfaceChild(); if (skill_interface != null && confirm_interface != null) { println("Trying to select '" + choice.getName() + "' as experience reward..."); if (skill_interface.click("Select") && confirm_interface.click("Confirm")) { sleep(400, 500); } println("Successfully selected the reward."); return true; } return false; } private boolean hasHandledReward() { final RSItem reward = getRewardItem(); final String action = actions[indexOf(reward.getID(), reward_ids)]; if (reward != null && reward.click(action)) { for (int i = 0; i < 10; i++, sleep(150, 200)) { if (getSkillInterfaceChild() != null) { return true; } } } return false; } private static int indexOf(final int val, final int...array) { for (int i = 0; i < array.length; i++) { if (array[i] == val) { return i; } } return -1; } private static String toTitle(final String string) { final StringBuilder sb = new StringBuilder(); for (String s : string.split("_")) { sb.append(Character.toUpperCase(s.charAt(0))); sb.append(s.substring(1, s.length()).toLowerCase()); sb.append(" "); } return sb.toString().trim(); }}
  14. (edit: fixed typo >.<) Of course I am not going to be an ass saying a solver is poorly programmed without showing how I would do it: Formatted version (reads much easier): http://paste.strictfp.com/37605/e3d8bdedf8b8f492c82f82669c03b159 Or the raw code if you do not trust that site: package scripts;import org.tribot.api2007.GameTab;import org.tribot.api2007.Interfaces;import org.tribot.api2007.Inventory;import org.tribot.api2007.types.RSInterface;import org.tribot.api2007.types.RSItem;import org.tribot.script.Script;public class LampSolver extends Script { private enum SkillChoice { AGILITY(10), ATTACK(3), HITPOINTS(8), CONSTRUCTION(24), COOKING(18), CRAFTING(13), DEFENSE(7), FARMING(23), FIREMAKING(19), FISHING(17), FLETCHING(21), HERBLORE(11), HUNTER(25), MAGIC(6), MINING(15), PRAYER(9), RANGED(5), RUNECRAFTING(14), SLAYER(22), SMITHING(16), STRENGTH(4), THIEVING(12), WOODCUTTING(20); private static final int INTERFACE_PARENT = 134; private static final int INTERFACE_CONFIRM_CHILD = 26; private final String name; private final int interface_child_id; private SkillChoice(final int interface_child_id) { this.name = toTitle(toString()); this.interface_child_id = interface_child_id; } private String getName() { return name; } private int getInterfaceChildID() { return interface_child_id; } } private final int[] lamp_ids = {2528}; //Allows to easily add multiple lamp ids if ever needed private final SkillChoice choice = SkillChoice.values()[getSelectedRewardIndex()]; //where getSelectedRewardIndex() returns the index of the selected reward from the JComboBox in the account manager @Override public void run() { if (!isInventoryOpen()) { return; //We do not want to force the script to open the inventory } if (hasHandledInterfaces()) { return; //Solved } if (!hasHandledLamp()) { return; //We miss-clicked or the interface didn't show up, better luck next time. } if (hasHandledInterfaces()) { return; //Solved } } private boolean isInventoryOpen() { return GameTab.getOpen().equals(GameTab.TABS.INVENTORY); } private RSItem getLampItem() { final RSItem[] lamps = Inventory.find(lamp_ids); return lamps.length > 0 ? lamps[0] : null; } private RSInterface getSkillInterfaceChild() { return Interfaces.get(SkillChoice.INTERFACE_PARENT, choice.getInterfaceChildID()); } private RSInterface getConfirmInterfaceChild() { return Interfaces.get(SkillChoice.INTERFACE_PARENT, SkillChoice.INTERFACE_CONFIRM_CHILD); } private boolean hasHandledInterfaces() { final RSInterface skill_interface = getSkillInterfaceChild(); final RSInterface confirm_interface = getConfirmInterfaceChild(); if (skill_interface != null && confirm_interface != null) { println("Trying to select '" + choice.getName() + "' as experience reward..."); if (skill_interface.click("Select") && confirm_interface.click("Confirm")) { sleep(400, 500); } println("Successfully selected the reward."); return true; } return false; } private boolean hasHandledLamp() { final RSItem lamp = getLampItem(); if (lamp != null && lamp.click("Rub")) { for (int i = 0; i < 10; i++, sleep(150, 200)) { if (getSkillInterfaceChild() != null) { return true; } } } return false; } private static String toTitle(final String string) { final StringBuilder sb = new StringBuilder(); for (String s : string.split("_")) { sb.append(Character.toUpperCase(s.charAt(0))); sb.append(s.substring(1, s.length()).toLowerCase()); sb.append(" "); } return sb.toString().trim(); }}