-
Posts
181 -
Joined
-
Last visited
-
Feedback
100%
Posts posted by Solzhenitsyn
-
-
I have a question about sorting in a stream. When sorting using a single comparator, o is an RS2Object and the reference to realDistance is found.
objects.getAll().stream.sorted(Comparator.comparingInt(map::realDistance)).findFirst();
When I try to use a second comparator to tie-break, o is an object and the reference to realDistance and bar are not found.
objects.getAll().stream.sorted(Comparator.comparingInt(map::realDistance).thenComparingInt(foo::bar).findFirst();
I am also unable to reverse the result of the sort.
objects.getAll().stream.sorted(Comparator.comparingInt(map::realDistance).reversed()).findFirst();
What is the correct way to tie-break a sort in a stream?
-
On 7/23/2018 at 8:44 AM, myOSBaccount said:
why don't we just implement machine learning in osbot? certainly it should be simple enough with how far technology has come
4 hours ago, Supamen said:I mean, I'm sure we could get a plethora of people here to run patterns for OSBot, then we can use that data and randomise the path? I'm no programmer (I'm a Web Developer/Designer) so I could be well and truly off. Couldn't we use that data and then randomise the path?
In fact, I'm on YouTube getting a better understanding of Machine Learning right now - so stop me there if I'm talking some serious shit.
It would be much easier to use ML to classify behaviour as bot-like or human-like than for it to generate human-like behaviour.
-
@Butters
If I replace the `ConditionalSleeps` with `while-pred-sleep`, everything else works.
edit: derp no markdown
-
When I try to construct an instance of the ConditionalSleep class, OSBot throws a ClassNotFound exception:
Caused by: java.lang.ClassNotFoundException: ConditionalSleep at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 more
Example usage:
new ConditionalSleep(10000) { public boolean condition() throws InterruptedException { return !myPlayer.isAnimating() } }.sleep();
Originally I tried to wrap it in a function to improve the semantics, but since I can't even construct an instance of the class I don't know if it works. If anyone knows what's wrong, I'd appreciate it if you shared.
Wrapped in a function (untested):
public void conditionalSleep(BooleanSupplier predicate, int timeout) { new ConditionalSleep(timeout) { public boolean condition() { return predicate.getAsBoolean(); } }.sleep(); }
-
Would you accept $25?
-
If your class requires that you use it, then you have to use it.
Not much that you can do other than suck it up if you are trying to do well. If you're learning about classes and objects, you're probably still in an introductory class anyways so it should be easy anyways.
¯\_ツ_/¯
-
unregistered email?
All but one are unconfirmed.
-
Accounts mostly hand leveled. Agility (and high alching while doing agility) was botted. Small amount of hired power leveling done.2 questions:1. Price for accounts with no wealth and quests nominally completed.2. Price check for account with Zulrah quest line completed + fairy ring access + most of Zulrah BIS gear.Account 1
Account 2
Account 3
Account 4
-
How much?
-
why u guys ignoring the message but yeh its his wish.
boolean death_flag = false; @[member='Override'] public void onMessage(Message message) { if (message.getMessage().contains("dead") && message.getType().equals(Message.MessageType.GAME)) { log("progamerz raped my butthole :feels:"); death_flag = true; } }
my butthole m8
- 1
-
It works, or you can check if your player has the death animation (which might be different now because of the grim reaper)
Checking if your HP is zero, or if your character has played the death animation works, but you shouldn't do it because it will only work if a conditional check is executed while those conditions are true. If your script is executing instructions in a loop when you die, then the animation will play and your health will be full when your conditional statement runs.
Checking to see if you are in the death area is safer, so you shouldn't do either one of those things.
- 2
-
You can also check when hp == 0
Don't do this.
-
-
- Don't use mirror mode. It's a waste of resources, traded for a seemingly negligible increase in security. You can use a VPN to proxy while using the mirror client. I always use injection.
- 1
-
I obviously misread your post, doesn't take a genius to see that.
Do I even know you? I don't think we've ever even talked before lol. Not sure why you're trying to act like such an elitist when you're clearly just the typical "I wrote a binary search algorithm and therefore am a wizard" kid. Get off your high horse before you start making a fool of yourself.
As for your actual question no I don't think it's possible unless you manipulate the game directly. The bots refresh rate is directly correlated to the game because, as I said, the bot does nothing but draw using the same graphics context.
I am totally willing to admit that I know almost nothing about computer science.
What you are not willing to admit is that you don't read threads, often not even the first post in a thread, before posting advice. That's useless, and a waste of space.
So you are correct, I'm no wizard -- but your thoughtless and lazy posts on the threads of myself and others contribute less than virtually any other member who regularly posts on the scripting forums. You obviously know a lot, but withholding that information by teasing only a hint of the solution, or worse yet, delivering nothing at all is far worse than knowing little but making a real attempt to help.
- 1
-
ChopTrees a; // Create in parent frame onStart() { a = new ChopTrees(this) // Initialize in onStart } onLoop() { a.<...> // Access in onLoop }
Edit: If you have no idea what's going on
- 3
-
Swizz, don't take this personally (or do, I don't really care) -- I don't think you've ever said anything useful to me before. Half of the time, I don't even think you've read the post or any of the thread. For that matter, I'm actually trying to think of the last time I've seen you say something useful, period.
My question:
Is there any way to reduce the refresh rate of onPaint (...)?
Your response:
The refresh rate is what's causing the "lag". Typically injection based bots (OSBot?) will hook into the relevant graphics methods to paint over the game buffer before it's drawn to the canvas.
You're going to want to post your code so we can see if there's any optimizations you could do.
The worst part is, your response isn't even correct -- the refresh rate only matters because it contributes to the quadratic explosion (e.g., a high number of vertices versus a high refresh rate).Thanks, @Imateamcape @@House.Here is my solution, which is more resource intensive than House or TC, but reduces it to a manageable level:Filter out 2/3 of the vertices which exist in the mesh:Old:New (increased opacity to compensate for fewer vertices):If anyone knows how to reduce the refresh rate of the paint, I would still like to know so that I can do both. -
The only suggestion I'd have is looking into using an iterative approach rather than a recursive one like you've done here.
Will do.
I will post my own solution tomorrow if you wanna compare
Please, and thanks for your reply. :-)
-
Hi,
I am drawing wireframes of relevant entities while I am debugging, but on my toaster it is causing a lot of lag. Is there any way to reduce the refresh rate of onPaint, or a cheaper way of drawing wireframes?
Drawing tiny rectangles...
-
Well... "Error connecting to server" speaks for itself.
-
I don't get it... O_O can you explain it?
https://en.wikipedia.org/wiki/The_pot_calling_the_kettle_black
-
A suggestion:
Store proxy/bot info, preferred worlds, and local/script names in a json, and allow users to use that information from a drop-down menu during script creation, or to auto-fill fields using settings templates.
Nice project.
-
Yeah, but how does it work? Is it using A*? Because I imagine that the pathfinding is calculated client sided when you issue a movement order, which could potentially be done by hooking the callback and getting the path and then not sending it to the server.
I don't see how this is faster, since it's the difference between locally calculating a path using whichever pathfinding algorithm the OSB team has implemented, and locally calculating a path using whichever pathfinding algorithm Jagex has implemented.
-
go study elsewhere problem solved.
Signed,
Obnoxious/inconsiderate assholes in the library.
Sorting tie-breakers in stream
in Scripting Help
Posted · Edited by Solzhenitsyn
I typed an MCVE by hand, parentheses are not the problem.