Everything posted by FrostBug
-
Little question
The exception is telling you that the message of the widget is empty ("" in other words). So you probably have the incorrect widget; or the number was never in the message field of the widget in the first place. Try using the widget value debugger to find the correct widget/field.
-
Little question
Widgets#get(int, int, int) will return null if the widget is not found. So when you call getMessage on a null reference, you get an NPE
-
Little question
I don't think so. Just check your nulls properly and you'll be fine :E
-
Gambling / Dicing Bot - Need Help Coding
Java is pretty similar to C# actually, so you shouldn't have much trouble 1. To detect user input, you will need to implement the onMessage method in your class that extends Script. Method overriding works the same in Java as it does in C#. The onMessage method will be called whenever a new message (be it a game message or a player message) appears in your chatbox. 2. To parse the inputted string, you could simply break the message into parts. Given your example "!58x2", you could first check if the message starts with "!" ( stringMsg.startsWith("!") ) Then you could proceed to split the remainder of the string on the "x" delimiter, and read each value. To generate a random number, you can use the built in osbot method MethodProvider.random(minValue, maxValue) 3. To let your character write stuff in the chat, you can use the OSBot keyboard API. example: getKeyboard().typeString("You rolled a " + num); Note that the getKeyboard method is located in the MethodProvider class, so it may only be used from the Script class, since Script inherits from MethodProvider
-
Little question
The NPE is probably thrown in your getState method when the widget is unavailable.
-
Fruity Barrows (Frost Barrows)
Version 1.4.3 - Updated trident attack styles to work with defensive casting again (After yesterdays update)
-
Fruity Barrows (Frost Barrows)
Probably neither. Judging by the error, it looks like one or more of your equipment configurations are unset or contain errors. Please try going thru your equipment configuration for every brother + tunnel creeps, and try again
-
Everyone wants him!
Wut... did you set up a packet filter just for that ?
-
Ban rate on herblore and fletching?
Interesting idea. I could indeed see this being useful (particularly for new members). It might be worth noting that these numbers should be considered to have an error margin of up to 0.02%. This of course is due to the rotational velocidensity of the client and its resources.
-
Ban rate on herblore and fletching?
Since they're both bankstanding skills, their ban rates are quite similar. Their ban rates this morning were: Herblore: 6.981 m3/s Fletching: 7.210 m3/s
- Hovering entity's option
-
RS2Object.interact() returns false
Is that "Get's here" being logged to the console? Have you been able to debug the problem at hand? (eg. is the problem related to the Rock instances still, or is the canMine boolean inconsistent?) EDIT: Also be aware that if "interacted" is false (eg. the interaction misclicked or whatever, and you ended up not mining the rock) you still set "canMine" to false. Since you're not mining, this variable will now be permanently false.
-
Fruity Barrows (Frost Barrows)
Open client console
-
RS2Object.interact() returns false
A new boolean value; not a new RS2Object representing the rock. You have to use the filter again
-
Scripting Template with Basic Paint
You could clean it up a bit by using the ExperienceTracker class already implemented for you It contains methods such as getElapsed, getGainedXP, getGainedXPPerHour, getTimeToLevel, getGainedLevels etc.
-
Fruity Barrows (Frost Barrows)
It does recharge it. I listed my preference/recommended items in the FAQ; check it out
-
RS2Object.interact() returns false
The problem is that when you mine a rock, The game object changes to an entirely different object; so next time you try to interact with the old instance of the game object, it no longer exists, and nothing happens.
- happy b
-
Fruity Barrows (Frost Barrows)
If doing short runs I'll often use dharok/torag/guthan armor for the def bonus However, more often so I'll be using bandos or dragon armor to avoid the repair hassle
-
Fruity Barrows (Frost Barrows)
Started both.
-
Fruity Barrows (Frost Barrows)
You must have a hotkey set for the following tabs: Quest, Inventory, Equipment, Combat, Prayer, Magic You can get a 24 hour trial; let me know when you want it started (PM preferable)
-
Obtaining a list of InteractableObjects
import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.InteractableObject; import org.osbot.rs07.api.model.RS2Object; /** * Get InteractableObjects * @author FrostBug */ public class InteractableFilter implements Filter<RS2Object> { @Override public boolean match(RS2Object v) { return v instanceof InteractableObject; } } List<RS2Object> interactableObjs = getObjects().filter(new InteractableFilter());
-
Multiple path walking
+1 Flamezzz' solution. Simple and effective You could probably make use of LocalWalker#walkPath instead; or maintain a global value to keep track of progress in your path walking. The first is probably the better way (tho I haven't actually tried it myself)
-
Minotaur Fighter script - questions
This is a nice and efficient approach, since it avoids filtering the NPCs redundantly in every cycle. But be sure to not rely on an interaction completing successfully like it does in this particular example (failing to attack = stuck forever) private NPC npc; public int onLoop() throws InterruptedException { if (npc == null || !npc.exists() || npc.getHealth() == 0) { //find new npc NPC minotaur = getNpcs().closest("Minotaur"); //minotaur checks npc = minotaur; } else if(myPlayer().getInteracting() != npc) { npc.interact("Attack"); } }
-
Fruity Barrows (Frost Barrows)
That I do. Will start yours now