Jump to content

Deathimminent

Trade With Caution
  • Posts

    44
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Deathimminent

  1. Feedback is welcome. This class allows you to easily create setups for your inventory, gear, or whatever, and check if you have those items. I mainly created this class to create setups where you can just specify items to add and it match for a range of charges or doses for the same item. Example: you want to match a glory with a charge of (1), (2), (3). Instead of doing if (item.getId() == 1 || item.getId() == 1 || item.getId() == 3) You would add the item to List<RequiredItem> reqItems reqItems.add(new RequiredItem("Amulet of glory (1), 1, 3); when you call ItemRequirement.getMissingItems(Item[] items) it will match at least one Amulet of glory(1), (2), and (3). I didn't bother making an actual script for demonstration, but maybe this will make the usage clearer: Source:
  2. Are we allowed to link and use .jars other than osbot in our project libraries? I am having no issue using the library outside of osbot.
  3. Well, it's not "truth", as we don't have any proof that anti ban is useless. Everyone has their own beliefs about it. I personally don't think it matters, but if someone is paying me to write a script for them and anti ban implementation is one of their specifications, then I'll add it.
  4. Kinda is kinda isn't. Most people who request scripts seem to have "anti ban" as a requirement.
  5. I haven't been able to test anything, as I wrote this while the client is currently down. It works based on a weight system. Each action has a specific weight. The higher the weight, the more likely that action is to be performed. I only made 3 actions, but it's very simple to implement your own. Feedback is welcome. Adding your own action: Say you want to add an action to...check your woodcutting exp. You would add to the Action enum constants the name of the action and the default weight, like such: public enum Action { MOVE_MOUSE(3), ROTATE_CAMERA(7), RIGHT_CLICK_RANDOM_OBJECT(1), CHECK_WC_EXP(60); // <--------- int weight; Action(int weight) { this.weight = weight; } public int getWeight() { return weight; } public void setWeight(int weight) { this.weight = weight; } } Then you would add your method that performs the action to the switch statement in the execute() method, like so: switch (action) { case MOVE_MOUSE: script.log("[ANTI BAN:] Moving mouse."); moveMouseRandomly(); break; case ROTATE_CAMERA: script.log("[ANTI BAN:] Rotating camera."); rotateCameraRandomly(); break; case RIGHT_CLICK_RANDOM_OBJECT: script.log("[ANTI BAN:] Right-clicking an object"); rightClickRandomObject(); break; case CHECK_WC_EXP: script.log("[ANTI BAN:] Good luck JAGEX"); checkWcExp(); break; } Basic usage: import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "", info = "", logo = "", name = "Test", version = 0.1) public class Test extends Script { AntiBan antiban = new AntiBan(this, 30000, 180000); @Override public int onLoop() throws InterruptedException { if (antiban.shouldExecute()) { antiban.execute(); } return 500; } } Using a custom action list: import java.util.ArrayList; import java.util.List; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import test.AntiBan.Action; @ScriptManifest(author = "", info = "", logo = "", name = "Test", version = 0.1) public class Test extends Script { AntiBan antiban; @Override public void onStart() { List<Action> actionList = new ArrayList<>(); // create an action with default weight Action action1 = Action.MOVE_MOUSE; // create an action and change its weight Action action2 = Action.ROTATE_CAMERA; action2.setWeight(20); // add actions to list actionList.add(action1); actionList.add(action2); // create antiban object with custom action list antiban = new AntiBan(this, 30000, 180000, actionList); } @Override public int onLoop() throws InterruptedException { if (antiban.shouldExecute()) { antiban.execute(); } return 500; } } Source:
  6. Depending on where you got your proxy, some services require you to use a specific port for Socks5. Check to make sure that isn't the case. If that's not the problem, then it's probably an issue with authentication. If you authenticate via IP make sure you have the correct IP authorized in the service's settings. If you auth via user/pass obviously make sure that's correct. That's all I know. Good luck.
  7. Yeah there are usually multiple solutions to a problem. I just assumed Client.isLoggedIn() would return false if I'm not logged in.
  8. I'm trying to figure out if my character is logged out. I have tried: getClient().isLoggedIn() and if (getClient().getLoginState() == Client.LoginState.LOGGED_OUT) {} They both return true when I'm logged in and return nothing when I'm logged out.
  9. Is there a way to change the speed you select the action with interact("") ? Currently it's near instant from right clicking and selecting the action.
  10. Error: [ERROR][Bot #1][06/29 01:40:25 PM]: Error executing event : org.osbot.rs07.event.WalkingEvent@1fe58a java.lang.IllegalStateException: Could not identify minimap interface child! Please report to developers. at org.osbot.rs07.api.util.GraphicUtilities.IiIiiiiiiiiI(ae:505) at org.osbot.rs07.api.util.GraphicUtilities.getMinimapScreenCoordinate(ae:738) at org.osbot.rs07.api.map.Position.isOnMiniMap(dh:518) at org.osbot.rs07.event.WalkingEvent.IiiIIiiiIiii(el:670) at org.osbot.rs07.event.WalkingEvent.execute(el:246) at org.osbot.rs07.event.EventExecutor$2.run(xe:230) at org.osbot.rs07.event.EventExecutor.execute(xe:101) at org.osbot.rs07.script.MethodProvider.execute(vk:519) at org.osbot.rs07.api.Walking.walk(bi:258) at test.TEST.onLoop(TEST.java:22) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(yl:161) at java.lang.Thread.run(Unknown Source) [INFO][Bot #1][06/29 01:40:25 PM]: Terminating script TEST... [INFO][Bot #1][06/29 01:40:25 PM]: Script TEST has exited! Code: package test; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(logo = "", author = "kj", name = "TEST", version = 0.1, info = "") public class TEST extends Script { @Override public int onLoop() throws InterruptedException { getWalking().walk(Banks.YANILLE); return 1000; } }
  11. Weird. Yeah I'm currently a free user atm, but I figured it was the client's mouse crosshair since it changes locations and I can't interact with it in any way. It appears when there isn't even an ad.
  12. All scripts. I only had one local script, but I just created a skeleton script to test and it shows on that one as well.
  13. Is there a way to toggle the visibility of the client's mouse's crosshair?
  14. Figured it out. myPlayer() can only be called from one of the overriden methods. Assuming that's the case for all methods inherited from MethodProvider? When do the objects from MethodProvider get created? During onStart()?
  15. I am trying to retrieve my player's name and print it to the screen. Why doesn't this work? I try to start the script and nothing happens. import java.awt.Graphics2D; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Death", info = "", logo = "", name = "GetPlayerName", version = 0) public class GetPlayerName extends Script { String myName = myPlayer().getName(); @Override public int onLoop() throws InterruptedException { return random(400,800); } @Override public void onPaint(Graphics2D g) { g.drawString("My Name: " + myName, 11, 280); } }
×
×
  • Create New...