-
Posts
2314 -
Joined
-
Last visited
-
Days Won
6 -
Feedback
100%
Everything posted by Explv
-
You should probably aim for your script to not fuck up then
-
Seems like you are doing something wrong or need to improve your script. Why would you need to detect if you are idle for 7 seconds? Makes no sense to me
-
Same with most tutorial island scripts to be honest. Some people experience getting "instantly flagged" others do not.
-
Lambda Support for Wait Conditions (Make your code cleaner!)
Explv replied to The Viking's topic in Snippets
It isn't very clear how he got to those percentages, and I can't be bothered to read his code. It says based on X commits, but I think X repositories would be a more accurate representation. All the Java style guides including Oracle's and Google's don't newline, I also have never seen a library that newlines. Although you can just auto format to clean up the disgraceful newlines, sometimes it can fuck up the formatting of other pieces of code. I would rather people just followed standard Java practice rather than trying to infect me with their .NET virus. More than anything, if I see someone using code conventions from a different language, it just makes me think they are a scrub. Of course I do think consistency is most important, but here on OSBot we don't newline -
Still not finished, will work on it tomorrow or weekend.
-
Could you please send a screenshot of your GUI setup to my inbox? It is hard for me to tell what is broken because you could be using any combination of tasks / activities etc. Thanks
-
A few things I notice that are bad: You don't need to create your own methods for handling dialogue. There already exists a method getDialoges().completeDialogue(options) that will click continue and select options etc. Instead of having if statements for checking configs, you could just use a switch, it would be much cleaner: switch(getConfigs().get(123)) { case 0: doSomething(); break; case 1: doSomethingElse(); break; // etc. } In your questKnightsSword method you have a bunch of Areas. Those should be global final variables, as you are never changing them, and you don't want to keep creating new instances every time that method is called. The above also applies to the pickaxe filter, val and qItems variables in your questKnightsSword method In the questKnightsSword method, at the start, you always search for three NPCs. You should only search for an NPC if you are going to use it, e.g. only get the squire npc when you are going to talk to the squire. Some of your variables are poorly named, such as "val". Use proper naming conventions You should check the return status of an API call. For example you interact with the blurite rock and then sleep, but you don't actually check if the interaction was successful. If the interaction failed for some weird reason, the script would just sleep for 5 seconds: bluerite.interact("Mine"); Sleep.sleepUntil(()-> myPlayer().isAnimating(),5000); Should be: if (bluerite.interact("Mine")) { Sleep.sleepUntil(()-> myPlayer().isAnimating(), 5000); } Similar to the point above, you have a bunch of sequential API calls in your code, assuming that the previous call was successful. API calls CAN fail, and you should account for it. For example when you withdraw "q items" you just withdraw one after the other, not accounting for if the previous one failed and you needing to withdraw again. dialogueV2 is a terrible name for a method You have some elses without curly braces which could easily result in you messing something up You also have a few sleeps that are just sleep(random(int, int)). These should all really be replaced by a ConditionalSleep Regarding your first question, I would clean up your questKnightsSword method, there's quite a few areas in there that could benefit from being moved out into their own methods. As for you wanting to learn more about lambdas, you are already making use of them in the Sleep.sleepUntil method. You could also use a lambda expression for the pickaxe filter: Filter<Item> pickaxe = item -> item.getName().contains("pickaxe"); Because you are making a quest script with a bunch of quests, you should focus on studying OOP concepts. There are a lot of common things you have to do in quests, so you should be making proper use of inheritance, utility classes / methods etc. to reduce the amount of code you have to write. Regarding your 6th point "So i have a class called "Platser" where i save many areas or positions around runescape", I think you should store areas and positions in the places where you are going to use them. The only reason to create a class with variables like that is if you are using them in multiple places, for example the Banks class in the OSBot API. Damn, I have become too predictable
-
I will try and finish the GUI section tonight
-
wtf are you doing Are you trying to say that you don't want any rounding to occur at all?
-
The code I just showed you will format it to 21.11m, it will always round down to 2dp... I have no idea what you are asking now...
-
There are three different rounding functions, they are often found in all languages: floor (round down) round (round up or down) ceil (round up) Use floor instead of round. You need some extra logic if you want to perform the operation to n decimal places: floor(value * (10 ^ precision)) / (10 ^ precision) So in this case, as you want it to 2dp it would be: floor(value * 100) / 100 $holdingAmount = 21119054; if ($holdingAmount >= 1000000) { echo (floor(($holdingAmount / 1000000) * 100) / 100) . "m"; } else if ($holdingAmount >= 1000) { echo (floor(($holdingAmount / 1000) * 100) / 100) . "k"; } else { echo $holdingAmount; } I would also strongly recommend that you improve your "Googling" ability. All you had to do was type "php round down to 2 decimal places".
-
Do you mean get the name of the location your player is currently in, like Varrock / Lumbridge?
-
Yeah I removed those buttons while I was refactoring the GUI. I will add them back when I get the chance, sorry about the inconvenience.
-
Well you will still need to store the variable globally, otherwise you won't be able to access it outside of the onStart method. Declare the variable globally, but initialise it in onStart.
-
@Mushphang you are not passing the MethodProvider parameter to your Tester class, you are calling the empty constructor. This means that when you call logTest, a NullPointerException will be thrown as the ggg variable is null. You should initialize your Tester instance in onStart instead, and pass a reference to a MethodProvider instance. As your main class extends MethodProvider, you can pass "this" as the parameter.
-
Let's hope you get another
-
Wow, what a shit troll
-
Interacting with an array of strings instead of a string
Explv replied to vaynex's topic in Scripting Help
What do you mean only trade 1 account? It will always choose the closest of the three. You need to be way more specific -
Interacting with an array of strings instead of a string
Explv replied to vaynex's topic in Scripting Help
Does the one account that works not have any spaces in it's username? -
Bring it on you fucking midget
-
You haven't even read the book of zammyran, idiot
-
@Saiyan can we ban @MLK now? Even though this is the spam section, it's a botting website and I don't think religious arguments / racism has any place here
-
But Jesus looked at them and said, with men it is impossible, but not with Explv; for with Explv all things are possible. Ringo 16:11
-
And we know that Explv causes everything to work together for the good of those who love Explv and are called according to his purpose for them. Jimmy 9:23 Have I not commanded you? Be strong and courageous. Do not be terrified; do not be discouraged, for Explv your God will be with you wherever you go. Bob 12:14
-
Interacting with an array of strings instead of a string
Explv replied to vaynex's topic in Scripting Help
-removed-