-
Posts
410 -
Joined
-
Last visited
-
Days Won
2 -
Feedback
100%
Everything posted by dreameo
-
https://osbot.org/forum/topic/156505-dream-server/ Try to use that - if it's to difficult then you are most likely not at the right level to try this. It's better to learn some more fundamentals. And don't use a database to do inter-process communication.
-
1. there are 256^3 (~16 million) possible colors. Of course the one you pick (even if it's closely resembles) will not match. It must be exact! 2. Color color = getColorPicker().colorAt(yourX, yourY); You must import java.awt.color; https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html
-
And just like a NPE, this thread is dead, don't try to access it
-
Interesting to see if anyone can create a nice protocol. Word of advice, the client should be the driver for the protocol. The server is the central place where information is held and decisions are returned to the client should they ask for direction.
-
Here's a very nice and easy to use Client/Server program. You must define you're own protocol and modify the onMessage functions to then support your protocol. MessageParser.java and Message.java must be altered to reflect your protocol (such that you can extract the required data). Note: Not fully tested, could be some problems. Let me know. https://gist.github.com/DreamLean/61b215bad3c8f839ac4c84536d67c804
-
I looked quickly but just 2 quick comments: Your task class could extend methodProvider instead of passing the reference throughout all the sub-classes. Your util to grab the cost of an item is probably costly (guessing a second or so). There's a json api that lets you grab the costs - https://osbot.org/forum/topic/146793-ge-data/
-
Remember the position of where you placed the box and only look at those positions in regards to your box interactions.
-
Don't listen to czar, he's the biggest noob in osbot. You might be missing the script manifest: @ScriptManifest(logo = "", version = 0.01, info = "", name = "AIO FM", author = "Dream") public class Main extends Script {...} If you're unsure about a jars contents, there's a cmd that can return classes found in the jar I believe to verify. oh just realized there was more pics in that imgur link, rip. Are you using java 11? Hard to tell but you need java 8
-
There's a misconception regarding the use of randoms. Doing all these complicated randoms and nested randoms all boil down to a single probability. For example: (random(0,4) would generate numbers from 0-3 with 0 being inclusive and 4 being exclusive) Example 1: random(0,4) generates 4 numbers: 0,1,2,3. The odds of landing on any one number is 25%. Example 2: if(random(0,4) == 1) { if(random(0,10) == 1) { // I see this often } } Now the probability of this also boils down to a single probability. Lets do the math: 25% to get 1 on the first "if" statement, 10% chance to get 1 on the second "if" statement. This gives you a total probability of (.25 * .10) 2.5% chance. So this means Example 2 is a tautology of: random(1,40). The probability of this occurring is also 2.5% but I don't need nested randoms. Example 3: random(random(0,2), random(2,4) We have randoms within randoms, juicy: Our lower bound generates numbers from 0-1 and upper bound generates numbers from 2-3. What are the odds of any particular number? I've picked a particular small range to prove that any one number will have an exact probability of occurring. Lets write out the cases: Ranges of: 0-2 0-3 1-2 1-3 There's a 25% chance any one of these ranges will be generated: 0-2- 50% chance for 0 or 1 - (12.5% overall to pick 0 or 1) 0-3- 33.3% chance for 0,1,2 (8.325% overall to pick 0,1,2) 1-2- 100% of 1 (25% overall to pick 1) 1-3 - 50% of 1,2 (12.5% overall to pick 1 or 2) Lets add the totals: odds to pick 0: 12.5 + 8.325 = 20.825% odds to pick 1: 12.5 + 8.325 + 25 + 12.5 = 58.325% odds to pick 2: 8.325 + 12.5= 20.825% Total = ~100 This means that: random(random(0,2), random(2,4) is a tautology of: (a bit more difficult to produce these odds with using a simple random but this example below will do) odds of 0 occurring: random(0,100) < 21 odds of 1 occurring: random(0,100) < 59 odds of 2 occurring: random(0,100) < 21 As you can see, all cases of these randoms will deduce to a single flat probability. In life, most things follow a bell curve distribution. If you want to apply that randomness, then you will want to make use of Gaussian random. And if you want more information on that, I could possibly extend this.
-
Hmm I haven't used async sockets but my guess would be is that since it's nonblocking (not sure if this is true), you're making a request and reading that request instantaneously when it isn't ready. Try putting a Thread.sleep(1000) in between the request and the read in the client side and see if you get a valid response then.
-
[LF HELP] - Task based script, changing used variables
dreameo replied to Mephisto's topic in Scripting Help
Looking at apaec's repo is probably gonna be difficult for you. One thing i'd say is that if you wanted to make multiple classes, make use of extending rather than passing reference to method provider. The second part to that is that you have to exchangeContext() of your classes with the bot. This won't make sense until you come to actually doing it. -
You want to do a conditional sleep on the opening of the store: if(shopKeeper.interact("Trade"){ sleep.SleepUntil(../*getStore.isOpen()*/..); getStore().buy("Spade", 5); } The issue I believe is that when the "getStore.isOpen()" call is made, the shop has not already opened (perhaps a few ms delay). You could also try throwing a regular sleep inbetween if you didn't want to do a conditional sleep.
-
Make sure the names of the item, "shrimp" and the interaction, "eat" is exactly how it's written in the game. If that's fine, then just remove everything and put the "eat" code in the on loop and see if that works. If it does, then it should indicate that something else is the issue.
-
lol wth, just give them life time n00b
-
Got banned, with this script. Tell me how I can improve it.
dreameo replied to Floglet's topic in Scripting Help
There's a lot of code that is blocking so in reality, the onLoop isn't actually running 1/10th of a second. Gaussian random is also nothing special, you can use it freely but in terms of a reduction in bans, it probably is insignificant. nextGaussian() is the method you would be looking for in the Random class (Java lib). And if someone is not familiar, you would have to actually learn what it is and then learn how to use it in terms of setting the standard deviation and average. -
I didn't look through much of this but here are important things that can fix a lot of your problems. 1. You're using conditional sleeps wrong. RS2Object object; if(object.interact("something")){ new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } ".interact()" is a boolean method. It returns true or false depending on the outcome of the interaction. If the interaction is a success, it returns true otherwise it returns false. In this example, if we do interact, we wait up to 5 seconds (which halts all execution) OR continue execution once the condition of "my player is animating becomes true". 2. Logic is flawed a bit. For example, your conditional sleep regarding the "picking up" interaction is very flawed. The execution of code should only continue until it reaches the timeout or until the item is actually picked up. "Actually picked up" means that we have one more copy in our inventory then we did before when we hit "take". GroundItem object; if(object.interact("take")){ int currentInventoryCnt = getTotalCount(object.getName()); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return currentInventoryCnt != getTotalCount(object.getName()); } }.sleep(); } So here's an example. ("getTotalCount" is a made up method which would return the total count of an item within inventory)
-
Null pointer Exception when executing a webwalkevent
dreameo replied to redgar72's topic in Scripting Help
try getBot.execute() -
So logically you have this: if(8 <= 15) // true - setDef() if(18 <= 15 OR 18 <= 5) // false - don't execute if(18 <= 15 OR 18 <= 5) // false - don't execute It looks fine but using if-else might be useful. if(..){ }else if(...){ else { ... }
-
But it's and not and nor will it ever be. You're just doing whatever you can to protect your taco sales which is fine, but don't mislead people.
-
This is not just to op but for all noobs: Your code is not special, stop trying to obfuscate and/or do everything you can to keep your code from being public. It's code that can be easily remade by anyone. In the case of putting it on the SDN, like everyone said, you aren't required to release the code. I've once removed my public code because I got tired of going to the scripting help section and seeing noobs just copy and paste other people's code and ask for help
-
This is a good quest bot, would recommend using.
-
Make an account and download it. Java 8 is the most prominent version being used world wide.
-
https://imgur.com/a/tRrp84B https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
-
Keep the reference of the object saved within your code.
-
Script termination in the middle of a while loop
dreameo replied to DylanSRT's topic in Scripting Help
Are you running more than one thread? What you're saying shouldn't happen in a single thread.