Jump to content

Reveance

Members
  • Posts

    108
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Reveance

  1. I should expect the bot to be down at thursdays? awesome
  2. Upon adding a bot immediately gives a 'Bot initialization error' with no additional information in the log
  3. You switched one param as mean is the second one, but correct :P... so gRandom(10, 50, 0, 100). This will result in the heigest chance to roll between 40 and 60. 99.7% of the values will lie between 20 and 80. It might be easier to use gRandomBetween though, this automatically calculates the mean and deviation so that the above example would be equivalent to gRandomBetween(20, 80) with the difference of having a cap between 20, 80 instead of 0, 100
  4. Correct, however overloading his method won't work in this case since he'll first need to cast to whatever more specific object it is first, before calling the method, in order for that to work. I think the easiest solution, especially as you only have like 3 or 4 instances to check, would be to use instanceof. I doubt you'd want something fancier in this case...
  5. Entity is an interface...so you could easily check what object you're dealing with: entity instanceof Player entity instanceof RS2Object But why are you getting entities in the first place? Why not use the Players, Objects classes to get the entities you want instead?
  6. It doesn't click because you're wasting your index on moving to the slot :P then the next loop it will come in the first else again, moving to the next...but the first if statement never gets executed... for (i = 0; i < 28; i++) { if (InventorySlotDestination.getSlot(i).contains(getMouse().getPosition())) { //...never gets in here, because this is the next slot...why would the mouse already be there? } else { //...always executes this to move to the next } } so basically you want something like for (i = 0; i < 28; i++) { if (!InventorySlotDestination.getSlot(i).contains(getMouse().getPosition())) { Rectangle rect = InventorySlotDestination.getSlot(i); if (getMouse().move(rect.x + (rect.width / 2), rect.y + (rect.height / 2))) { sleep(random(100, 125)); } } if (InventorySlotDestination.getSlot(i).contains(getMouse().getPosition())) { if (getMouse().click(false)) { // i++; this one isn't necessary unless you want to skip // items sleep(random(100, 125)); } } } But anyways, as Stimpack already said, it's easier to let the osbot api do all that for you by using getMouse().click(getInventory().getMouseDestination(i))
  7. gRandom is broken, if you want to use a random with normal distribution you can use But yeah, gRandom uses normal distribution which is one random distribution that very simplified basically gives more chance to numbers around the center (mean) and the deviation says how wide the field of more chance is :p. Normal random uses uniform distribution which means there's an even chance for every number
  8. The most important thing to understand with threads is that they run concurrently. Imagine you have a program that has a GUI with a button in it. If the button is pressed and you'd execute some heavy calculation (or wait for something) in the same thread (the GUI is running on and being repainted in) ... the whole application would go unresponsive. By using another thread to do the calculation it will keep responsive. It's generally much better to work with Runnables instead of threads as it's much more flexible. Also look up ExecutorService to run them properly.
  9. Yes, if you want to communicate with multiple accounts you should have one server application that is using ServerSocket, like Token said. You can then use Socket to connect to that server application (hosted on some server) in which you wanna have logic that can relay a message to the client you want. E.g. Client1 -> Server -> Client2. I'd probably use some small framework though, that already handles all connections etc. otherwise it's pretty time consuming to write. You could use kryonet for this in which you want to send with TCP, or you can use another protocol entirely, called websocket (which is especially useful if you ever want to build a webinterface around it): https://github.com/TooTallNate/Java-WebSocket
  10. Why does everybody assume to know what the logic behind that status is? From a still picture no less :P?
  11. Ah okay, I thought you were only talking about casting the ints since you only mentioned the integer methods and because tbh what else is there? :"D The only thing left then is the min max check
  12. It's not really unnecessary though...your between methods return integers outside of the min and max values specified. But tbh I think I just don't really understand why you posted it in the first place then
  13. I wouldn't recommend using that code since basically all the important stuff from the class I posted is stripped off... Your command regarding the 68-95-99.7 rule doesn't make sense, since the rule is only used for capping the value, which your method does not do. In theory you could get an infinite wait with your method which you do not want in regards to botting. Then the way in which you convert to int by casting is horrible in this scenario...since casting a double to an int is always rounding down, so 5.9 will become 5. This means you will have a more likely chance to get min and you'll almost never get max since it has to be exactly max as a double.
  14. Awesome, you might have fixed a whole lot with that discovery
  15. This is a class containing the 'what would have been' gRandom's replacement that was mostly created by @Alek following my bug report. I figured I'd share it as a snippet so it's easier to find in case people need it, since Alek just announced a new release in which it is deprecated because of it not functioning correctly and too many dependencies on it to fix. Code: Usage:
  16. Yeah alright, that's true and I do try to design my logic in such ways .. but I was hoping I could still use some api methods :'D I mean it doesn't do too much and if it fails it's still quite easy to manage that. But I suppose that there's indeed something overlooked...will just wait until that thread gets updated for now :p
  17. Idk, it might be in this case...but That is literally one method call to the API displaying the same behaviour. Is there a way to execute something on the game thread? I don't think Script#paint runs on the game thread does it?
  18. Sorry yeah I think Task-based is correct. I believe they also used to call it Node-based or sth a while back
  19. What Apaec said :p the way I do this is by making some state based classes that have a condition and an execute method which are evaluated and if true, run, in the script loop, then doing it like pretty much like this: BankWalker condition -> !inventory.contains("Coins") && !Banks.LUMBRIDGE_UPPER.contains(script.myPosition()) execute -> script.getWalking().webWalk(Banks.LUMBRIDGE_UPPER); BankOpener condition -> !inventory.contains("Coins") && Banks.LUMBRIDGE_UPPER.contains(script.myPosition()) && !bank.isOpen() execute -> bank.open(); sleep until open BankHandler condition -> bank.isOpen() && bank.contains("Coins") execute -> bank.withdrawAll("Coins"); ScriptStopper -> bank.isOpen() && !bank.contains("Coins") && !inventory.contains("Coins") execute -> script.stop(false); That way you can also easily add other 'States' that take priority over others and I believe it's generally less error prone But even though this might be the cause in this case, the GrandExchange#buyItem does also have some issues that are almost identical to this in terms of repetition and weird behaviour :p
  20. I have to leave a review here since I recently came back to OSBot and this is the first script I bought :P...this script has come a long way since late 2014 when I bought it (sorry for never replying back on your request back then :\)! Great job on this Apaec it hasn't gotten stuck once since I started using it a few weeks ago, pretty much flawless ty!
  21. You're already in your script loop, so I think the best thing to do would be to make solid conditions for that step to be executed, and if the timeout expires and it didn't get the sleep condition to true, you should return and the next iteration of the script loop would go to that method again since the conditions for that 'task' are still true as it didn't finish it. But for this it would also be better to add a failsave :P so it doesn't keep continuing the whole time
  22. But it could, because there's no timeout and that's not something you really want :p The ConditionalSleep has the same behaviour, is well tested and adds a timeout. But anyways OT: I doubt it has something to do with the conditional sleeps and stuff, since I think we can expect the API to use those aswell... there's all sorts of weird stuff happening when low CPU, but maybe Apaec has the pointed the right direction? Could it be that when low FPS, the thread that handles the conditions gets called multiple times causing multiple things to queue up of the same thing in the eventexecutor or sth?
  23. Always exactly 3? That's interesting since it's also a problem with GrandExchange#buyItem when on low CPU mode or if there's little CPU resource available
  24. I have no proof however injection or reflection isn't that hard to detect, so it can really only be an improvement in that aspect... Also I doubt that they'd put all the time in developing such a system (creating and maintaining it) aside their injection, without it being a (substantial) improvement in terms of detectability. But I suppose it mostly depends on what you want to do with it; botting an important account -> you can't really lose by botting it on mirror mode compared to the other methods. The only thing is that it's more resource hungry and it seems to have troubles with some stuff. Should Jagex ever get a more absolute id of the client (I heard they do know if you're playing on modified client) then at least you are on a different ID as most of the gold farmers, who generally don't want to waste resources on the chance of that to come true :P
  25. Mirror mode is definitely no standard Java reflection but yeah, I don't think OSBot supports that. But mirror mode is safer than reflection or injection anyways, so why the specific need for reflection?
×
×
  • Create New...