-
Posts
410 -
Joined
-
Last visited
-
Days Won
2 -
Feedback
100%
Everything posted by dreameo
-
Here is how you can multi thread. Why would you want to? Sometimes you want to be doing x and y at the same time. In a single thread, you can only do one thing at a time. Note: There are different ways to multi thread and this isn't some kind of perfect way to do it. In this example there are two classes: Main Thread Demo thread (where we run our second thread) Demo Thread The most important thing for the demo thread is that you implement Runnable. The second most important thing is the boolean, 'run'. We need to tell the thread when to stop running because in this case, we are in a loop. Had there been no loop and we just began the thread, it would be like any other execution, it runs once and then ends. In that case, we wouldn't need to worry about storing a boolean. So here is the Demo Thread Example: edit: added volatile keyword to boolean - important! Main Thread We need to do one extra thing before we can start with our thread. Since I extended method provider, I need to exchange context (First line after the onStart method). Now the actual multithreading part you've been waiting for: haha, just create a new thread and run your instance of runnable . Yeah that's it.. Only thing we have to do is make sure we stop our new thread once we stop our script. If we don't, the additional thread we made will keep running even if we stop the bot. If you start and stop the bot several times, you'll have a number of threads (demo threads that we made) running. We created a flag that tells the thread when to 'stop' executing. In the onExit method, just use the stop method we build which sets the flag to false (stop running). Here's just a snippet of the output from the log: You don't have to multi thread and a lot of times, you can probably find solutions in a single thread instead of multi threading. Good luck
-
Only thing that could be considered slow is finding a path to FM. Everything else should be fair game.
-
Based off your script, it seems like the spell is selected while waiting which is good. What you can do next is make the cursor hover over the area where the wine gets spawned. On top of that, you could save the time when the wine was last available and then take that time + spawn rate time + 50 ms and just click in that area. (Try it, not sure how well it works) Edit: Look at my post for an explanation on conditional sleep https://osbot.org/forum/topic/142349-how-do-i-stopprevent-an-action/?tab=comments#comment-1659505
-
You need to realize that most interactions are booleans. You need to take advantage of that. getInventory().interact("Use", "Green dragon leather") This should be an if statement where the code inside the block would be a conditional sleep. A conditional sleep looks like this: new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return !getInventory().contains("Coins"); } }.sleep(); 5000 <-- Timeout threshold in ms If the condition: getInventory().contains("Coins") is not met, then after 5 seconds, your program continues executing. However if the condition is met, then the program continues to execute. You would want to use, 'return my player is animating'. There's a lot of random stuff that you're doing. If you want to continue writing gibberish go ahead, else read up on some beginner java or just programming in general. Basics overlap in all languages.
- 1 reply
-
- 2
-
?
-
Meh, at least you got the decency to say that your gonna use it. It's meant to be public anyhow.
-
Here you can use this: https://pastebin.com/5TWTBqNh Usage would be: ItemData.get("Cannonball","ID") You can include another level of cache via map if you want but, the way it's now is fine. Other properties can also be retrieved, check inside the code.
-
How would i go about grabbing the value of items in my inventory?
dreameo replied to shaba123's topic in Scripting Help
Only problem with that is it will constantly' open and close the site' to read from. Most likely would notice some slowness. -
Testing each part is a great way to go. Good habit too.
-
Hmm no. If anything, I could do an AIO FM that lets you FM anywhere (nothing anytime soon).
-
Why does it still open the bank anywhere? (Beginner)
dreameo replied to Pokerstar's topic in Scripting Help
Haha what's with all the newbies lately. Learn some basic Java first and then try to script. Not the other way around, it doesn't work to well regardless of the outcome. -
"Anti-bans" are meant to mimic human interactions. Problem is, a lot of anti-ban is similar. However, human interactions vary greatly across different people. Perhaps the idea of "anti-ban" is fine however, how it's being implemented is poor. The idea is to create anti-ban that could resemble an instance of a person, instead of a few generic actions. Alek mentions not to play more then x amount of hours daily and y hours weekly but, many real players exceed those hours and aren't falsely banned. Their actions/interactions are being identified as a human. Jagex looks at a large number of factors and uses these (I believe) in neural networks. The NN decide if all the actions you've done is bot like or not. The longer you play, the more data it has and easier it's to make a decision.
-
you don't need the filter, just "Bank booth" is fine.
-
https://imgur.com/a/R4nUFP7 Grats man!
-
Bruh you should look into some java tutorials. Then you would know that walkPath accepts a list of positions and not an array.
-
haha i only tried it once before and someone said extending it wont work.
-
He's getting a null pointer exception xD You can't extend MP. You need to keep an active reference of MP across all classes and then do exchangeContext. I believe this is the only way. extending MP would be great but don't think it can be done.
-
You should have 2 levels of cache. First one pulls all the prices and you store it in some data structure. The second one would be this ^. You don't want to make an x number of GET requests while botting.
-
Have you tried it outside of onStart? I read before the gc methods should be avoided? null referencing should be fine
-
hmm you can try this: create a webwalkevent and use setsourcepos(Position p) <-- I believe this sets the starting pos? then do prefretchreq on event and true/false should let you know if it's reachable.
-
yes guys be careful, as soon as you hit start, you will get banned.
-
whose mans this
-
neural networks have been trained to decide a bot vs a person, this is why they've only been getting better - said from someone can't recall. ^ Makes sense though and is very realistic
-
List<java.lang.String> getMessages(Chatbox.MessageType messageType) try that (chatbox class)
-
dis nonsense