Jump to content

Explv

Scripter II
  • Posts

    2314
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    100%

Everything posted by Explv

  1. More updates: Added region grid Added region id labels Region id labels may not be so useful for you guys, more for client developers.
  2. Explv

    xboge

  3. I've never used bluej, it seems like it's good for learning the basics I guess, not really a proper IDE for software development. Just put up with it bro, surely it's only for one module / part of the course?
  4. Looks cancerous. I'm very surprised your university is restricting you to a specific IDE, what course are you studying? Just learn your own way, use your own choice of IDE, and do the assignments in the way they want you to do them. I'm sure you could always just write code in another IDE and then import to bluej? If they actually want you to learn the specifics of bluej, then that's retarded, but you don't have a choice. Would recommend Intellij IDEA for Java development.
  5. I was intending to implement a scheduling system, but never got round to it. I haven't looked at this project for a while, I'll certainly do this when I have time.
  6. The devs do
  7. Welcome bossman
  8. What Chris said, or if you only need one of keyTyped, keyPressed or keyReleased: getBot().getCanvas().addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { super.keyTyped(e); } }); I'm not sure if canvas is the correct place to add the listener, but if it works, it works I guess.
  9. Here is an example I came up with. Note that this is completely untested, but hopefully should help you understand what I meant in my previous comment. import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Explv", name = "Example", info = "", logo = "", version = 0.1) public final class ExampleScript extends Script { /* This is getMap().getBaseX() and getMap().getBaseX() when the player is standing in boat at the start of Pest Control in the instance when all Positions and Areas were collected */ private static final int BOAT_REGION_BASE_X = 1234; private static final int BOAT_REGION_BASE_Y = 1234; // This position was collected in the same instance as the above base x and base y private static final Position PORTAL_POSITION = new Position(1, 2, 0); // This area was collected in the same isntance as the above base x and base y private static final CustomArea EXAMPLE_AREA = new CustomArea(1, 2, 3, 4); // These are the offsets from the current instance positions and the above positions private int offsetX = 0; private int offsetY = 0; // Determines if we have updated the above offsets in the current instance private boolean offsetsUpdated = false; @Override public int onLoop() throws InterruptedException { if (inPestControlGame()) { if (!offsetsUpdated) { offsetX = BOAT_REGION_BASE_X - getMap().getBaseX(); offsetY = BOAT_REGION_BASE_Y - getMap().getBaseY(); offsetsUpdated = true; } } else { offsetsUpdated = false; } if (!getInstancedArea(EXAMPLE_AREA).contains(myPosition())) { getWalking().walk(getInstancedArea(EXAMPLE_AREA)); } return 600; } private boolean inPestControlGame() { // Maybe check a widget exists or something return true; } private Position getInstancedPosition(final Position position) { return position.translate(offsetX, offsetY); } private Area getInstancedArea(final CustomArea area) { return area.translate(offsetX, offsetY); } } // Creating a CustomArea class so that we can store the start and end position // and also add a handy translate method class CustomArea extends Area { private Position startPosition, endPosition; public CustomArea(int x1, int y1, int x2, int y2) { super(x1, y1, x2, y2); startPosition = new Position(x1, y1, 0); endPosition = new Position(x2, y2, 0); } @Override public Area setPlane(final int z) { super.setPlane(z); startPosition = new Position(startPosition.getX(), startPosition.getY(), z); endPosition = new Position(endPosition.getX(), endPosition.getY(), z); return this; } public Area translate(final int offsetX, final int offsetY) { return new Area(startPosition.translate(offsetX, offsetY), endPosition.translate(offsetX, offsetY)); } }
  10. Like Fruity said you could use your local position in the region: myPosition().getLocalX() myPosition().getLocalY() As those coordinates will always be the same. To get the actual in game position, you would then add the local position to the region's start position: int actualX = getMap().getBaseX() + localX int actualY = getMap().getBaseY() + localY However a region isn't that big, I think 104 x 104 tiles, and I'm not sure if PC spans multiple regions, it might do. You could just store the baseX and baseY of the region where you spawn in PC, I think you always spawn in the same place right? And then when you start a game of PC you just get the baseX and baseY in the current instance, calculate the offset and apply it to all your stores positions and areas: final int baseXStartRegion = 1234; final int baseYStartRegion = 1234; int offsetX, offsetY; // When new PC game starts offsetX = baseXStartRegion - getMap().getBaseX(); offsetY = baseYStartRegion - getMap().getBaseY(); Then when you want to walk somewhere just apply the offsets to the destination position: Position getInstancedPosition(Position position) { return position.translate(offsetX, offsetY); } I *think* that should work.
  11. Explv

    Debugging?

    Make sure you refresh the script list in the client after building the .jar so that it picks up your new code
  12. Explv

    Debugging?

    Your first issue isn't an issue, it shows that warning but the jar is still replaced. As for your second issue, I'm not sure, there's probably a way, but there isn't that much value in debugging an OSBot script in the traditional sense. Best way to debug is just to run the script and see if it works
  13. Consider reading this https://docs.oracle.com/javase/tutorial/java/javaOO/thiskey.html Essentially all it is doing is passing a reference to the current instance (which is of type MethodProvider) as a parameter to the constructor of DropTask An alternative method, instead of passing around a instance of MethodProvider to access the API, would be to just make your other classes extend MethodProvider, and then exchangeContext: public class SomeScript extends Script { SomeOtherClass someOtherClass; @Override public void onStart() { someOtherClass = new SomeOtherClass(); someOtherClass.exchangeContext(getBot()); } } class SomeOtherClass extends MethodProvider { }
  14. Did you install Java 8 or Java 9? OSBot only works with Java 8 currently. You can confirm your Java version by typing: java -version It should show something along the lines of 1.8 etc.etc.
  15. Personally I just do a long ass sleep until either: The player has levelled up / in dialogue There are no more bars to smelt For example: if (clicked widget or whatever) { new ConditionalSleep(60_000, 600) { @Override public boolean condition() { return !canSmeltBar() || getDialogues().isPendingContinuation(); } }.sleep(); } Where canSmeltBar() just returns whether or not the inventory contains the required ores to smelt a bar.
  16. I believe there is a chatbox message you could listen for? Override the onMessage method or add a message listener etc. Or just divide XP gained by xp per log. XP gained can be obtained from the ExperienceTracker
  17. I don't think it would make much difference, it only takes a quick google search to figure out how to change your mac address. Lucky you, I have encountered the issue dozens of times with my mobile network provider. Maybe
  18. Banning random ip addresses permanently is a pretty innefective solution to stopping users from accessing the site, and is extremely annoying when you try to access OSBot on your phone and get the message that "You are banned". I'm not sure how many ips you've banned but I have encountered this issue too frequently. Banning mobile ip addresses is even more pointless, seeing as the user can just restart their phone's networking and get assigned a new ip. Most people are given dynamic ips by their ISP, and so their ip will change eventually and they will regain access to the site. Or they can just use a proxy or VPN to circumnagivate their "ban". Banning a user's account, and temporarily banning their ip works fine to boot them from the site and prevent the casual user from creating a vader account quickly, but can we please have ip addresses unbanned after a period of time? You can still keep a log of the ip to associate with future "vader" accounts, although again this isn't really that helpful, due to the points I listed previously.
  19. Surely nothing happens when you alt-tab out of the client. For example if your cursor is over a tree, when you alt-tab out and start doing other things, your cursor will still be on the tree. When you alt tab back in the cursor might move to wherever your mouse is, not sure. Really though, what you should be doing is purchasing a tin foil hat and wrapping your router in cling film to disrupt the evil Jagex signals.
  20. Well then ask them to, it's not like posting here is going to let them know, or help you at all Also I can imagine the vast vast majority of people will pay via PayPal, or just with their credit card, which is much easier than crypto, so they probably don't give a shit. Same with OSBot.
  21. Explv

    Free F2P Walker!

    Chill fam it's cool, gz on release
  22. Explv

    Free F2P Walker!

    smh
  23. Explv

    Explv's Walker

    Client needs updating
  24. Explv

    Explv's Walker

    Yep, planning to do that
×
×
  • Create New...