Jump to content

Explv

Scripter II
  • Posts

    2314
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    100%

Everything posted by Explv

  1. You'll probably have to handle the cross ditch part yourself. Just make web walking stop when it gets to the ditch, handle the ditch, then resume web walking.
  2. If it is on the SDN you will need to add the actual source code of the external library
  3. This is extremely overcomplicated. The only time you ever really need the closest bank is if you want to walk there. If you pass multiple areas to the web walking method it will automatically walk to the closest one, and will take into account actual path distance, rather than straight line distance which your method uses: getWalking().webWalk(bankAreas);
  4. Just use cd to navigate to the directory where the .jar is and run java -jar "OSBot whateveritis.jar" obviously replacing whateveritis with the OSBot version number
  5. Why don't you just not use "states"
  6. There are already tonnes of GUI tutorials and examples online, the way you do it in OSBot is no different. Just Google Swing Tutorials
  7. If you can't connect the dots then you need to revisit the basics of Java. In particular OOP, assuming your GUI is in a separate class. I would recommend you don't use a GUI builder, so you can actually learn how it works.
  8. Perhaps there is another widget with the sprite? You could alternatively use the Spell Name attribute.
  9. You will find these warnings frequently with the OSBot API, just ignore them.
  10. Sorry I meant && getMouse().isOnCursor(obj)
  11. Pretty sure you can just filter objects using getObjects().closest() and the method isOnCursor() Sorry on phone but: getObjects().closest(obj -> obj.hasAction("Chop") && obj.isOnCursor())
  12. You could try moving the lobby button check inside of the isLoggedIn check: @Override public final int execute() throws InterruptedException { if (!getBot().isLoaded()) { return 1000; } else if (getClient().isLoggedIn()) { if (getLobbyButton() != null) { clickLobbyButton(); } else { getBot().getScriptExecutor().resume(); setFinished(); } } else if (!getBot().getScriptExecutor().isPaused()) { getBot().getScriptExecutor().pause(); } else if (isOnWorldSelectorScreen()) { cancelWorldSelection(); } else if (!isPasswordEmpty()) { clickCancelLoginButton(); } else { login(); } return random(100, 150); }
  13. Alternative method (again i'm not that familiar with C#) would be to create a custom Comparer and then use the built in List sort method https://msdn.microsoft.com/en-us/library/234b841s(v=vs.110).aspx
  14. Shouldn't the pointsPerCharacter be a Dictionary<char, int> ? You could remove that .ToString() call if it was. Also i'm not sure you need to call .ToCharArray(), can't you just do: foreach (char c in word) { points += pointsPerCharacter[c]; } I'm sure you could make your code even more succinct using Linq, but i'm not really super familiar with C#.
  15. Do you have at least excel 2007? What version of excel are you running? Maybe the workbook is corrupted? You could try: File -> Open In the Open dialog box select the corrupted workbook. Click the arrow next to the Open button and click Open and Repair
  16. If the event is async, it is non-blocking, therefore wouldn't onLoop() keep executing even while logged out if you don't pause the script executor? I didn't really test this much.
  17. Did you update your LoginEvent to exactly what is in the thread? I added more than just setAsync
  18. Probably. You would want to handle the cases where I call setFailed in some other way, e.g. if the account is banned then stop the script. If the script fails to enter input, just retry instead of failing. I will write an example later today if I have time
  19. Firstly your Lumbridge bank area is incorrect, I would recommend you use the constant Banks.LUMBRIDGE_UPPER instead. Secondly your logic in general seems weird. I would recommend not using the state pattern because it just confuses things.
  20. Yeah, you could either create your own separate thread that executes a LoginEvent when necessary, or you could modify the LoginEvent to be an asynchronous event that is always running (never calls setFinished())
  21. Not sure if there is a better way but you could have a login event always running in the background, it would do nothing if the player is logged in, but when the player logs out it would pause the script executor, log back in, and then resume the script executor. Consider looking at the code in the original post, shouldn't be hard to modify.
  22. Updated the code on the thread, should probably fix.
  23. Explv

    Wilderness API

    Good job my sweet friend
×
×
  • Create New...