Everything posted by Explv
-
better way to track mobs killed?
What d0zza said, or preferably make it a private int with a public getter method. Side note: I would recommend staying away from the task system people here use. It is overcomplicated, messy and counter-intuitive. Considering you are writing a chicken killer I don't know why you wouldn't just put this all in a single class. However if you want multiple classes, there are better ways to achieve it. Also you could remove a lot of duplicate code from your onPaint with a simple for loop.
-
better way to track mobs killed?
Check if the NPC you are fighting has 0 health, or no longer exists. If that is the case, increment your kill counter by 1 and look for a new NPC to fight.
-
any1 know a csgo triggerbot like silentaim?
Hacks are for losers Git gud scrub
-
Shudsy's InfiniteWalker
You disgust me
-
Shudsy's InfiniteWalker
The timeRan variable should be local to the onPaint function. The Runescape area should be private, final, and start with a lowercase first letter, as per standard Java conventions. There should be a new line in between each method for better readability. The class should start with an uppercase first letter, as per standard Java conventions. Version number is 2, is this really version 2 though? info and logo in the @ScriptManifest attribute are severely lacking. You don't need to check that your player isn't moving before calling web walk. The indentation is completely fucked in some places. onExit method is unnecessary, and definitely misleading as it prints "Hello" to the logger when the script is in fact exiting. The methods and class should be final just in case someone in Lumbridge tries to override them. Do you really need to sleep for 100ms in between loops, when all you are doing is calling getWalking().webWalk()? Otherwise, good job!
-
Tracking which fighting style is active
I think your way would still work, as long as you figure out what type of weapon they are using (ranged, mage or melee) and disregard the 4th combat option
-
Tracking which fighting style is active
Still won't necessarily work for all melee weapons. Check this combat options page http://2007.runescape.wikia.com/wiki/Combat_Options "Melee weapons vary in their attack styles. Some have four options, with either a controlled option or an alternative aggressive attack with a different action, while others have only three options. Players intending to remain a pure with no Defence need to take care when using the third option (alternative aggressive), as switching weapons may result in controlled or defensive becoming selected, often only spotted when an unwanted Defence level is gained." So the 4th option might be Strength XP or it might be Attack, Strength and Defence
-
Tracking which fighting style is active
It can vary for different weapons though I think
-
Can somebody please eli5 "sanitizing input" for me with a Java exemplar
An example of a post-test loop would be a do while loop. For example: do { // some stuff } while(some condition is true); // check this after The contents of this loop will execute at least once, because the condition is checked after the loop completes NOT before. This is different from a while loop where the condition is checked first: while (some condition is true) { // Check this first // some stuff } An example use of this is sanitizing input because you may want to get some input from the user THEN check it, and only exit the loop if some condition is matched. Consider this trivial example: Scanner scanner = new Scanner(System.in); String input; do { input = scanner.nextLine(); // Read a line of input } while (!input.equals("Hello")); // Only exit the loop if the input matches "Hello"
-
Tracking which fighting style is active
I don't think there is a config for what skill you are / will gain xp in, only for which of the attack styles is selected.
-
Testing local scripts issues
Have you verified that the .jar is not empty? You have to make sure you add the "compiled output" to your .jar in the artifact settings (by moving it to the left hand side) like in this image (sorry not OSBot specific because I'm on my phone)
-
Testing local scripts issues
If you are rebuilding the same artifact it will work fine. Intellij states that there is an error, something along the lines of unable to delete .jar, but it still works. Just make sure you press refresh in the script selector on OSBot. Why are you dragging the .jar file to the scripts folder? In the artifact settings just set the path to the scripts folder. In what way do you think that it is not working? Have you tried doing something simple like, changing the script name in the script manifest attribute, rebuilding the artifact, then refreshing the script list in OSBot and seeing if the script name changes?
-
Explv's OSBot Manager
The "No Randoms" option is not for dismissing randoms.
-
Get Widget Hover Text
I wrote something similar for someone before, you need to hover the widgets: //Credits to Explv //Main class private Skill currentAttStyle; private void setAttackStyle(final Skill attackStyle) { Event attStyleEvent = new AttackStyle(attackStyle.toString()); execute(attStyleEvent); if (attStyleEvent.hasFinished()) { currentAttStyle = attackStyle; } } //AttackStyle class public class AttackStyle extends Event { private final int attackStyleParent = 593; private final int[] attackStyleChildren = {3, 7, 11, 15}; private final String xpType; private int attackStyleToCheck = 0; public AttackStyle(final String xpType) { this.xpType = xpType; } @Override public int execute() throws InterruptedException { if (getTabs().getOpen() != Tab.ATTACK) { getTabs().open(Tab.ATTACK); return 0; } RS2Widget attackStyleWidget = getWidgets().get(attackStyleParent, attackStyleChildren[attackStyleToCheck]); if (attackStyleWidget == null) { setFailed(); return 0; } if (!attackStyleWidget.hover()) { return 0; } sleep(random(500, 600)); if (getWidgets().singleFilter(attackStyleParent, widget -> widget.getMessage().matches(".*\\(" + xpType + " XP\\)$")) == null) { attackStyleToCheck++; if (attackStyleToCheck >= attackStyleChildren.length) { setFailed(); } return 0; } Rectangle widgetBounds = attackStyleWidget.getBounds(); double colorX = widgetBounds.getMinX() + 5; double colorY = widgetBounds.getMinY() + 5; if (getColorPicker().colorAt((int) colorX, (int) colorY).getRed() > 100) { log("Already selected"); setFinished(); return 0; } if (attackStyleWidget.interact()) { setFinished(); } return 0; } }
- Bank locations
-
Bank locations
https://osbot.org/api/org/osbot/rs07/api/map/constants/Banks.html
-
QUESTION: Changing drop order
Seems like a duplicate of this question: https://osbot.org/forum/topic/121176-osbot-dropping-bot-like/?do=findComment&comment=1376627
-
'Custom' Break
Such as? I just tested it, and it works fine
-
General CLI Questions
Only if you want to get the script parameters that the user has set. You can get the script parameters using getParameters() The script parameter format will be set by the script writer. It will likely be on the script thread, if not you will have to ask them. It may be the case the script has no parameters at all, in which case you can just set the script parameters to "none". You cannot set breaks using CLI. Not sure exactly sure what you mean by automatically close down a bot from the command line, do you mean when the script exits, or after x amount of time?
-
Level up widget
Just sleep until either the inventory does not contain flax, or the dialog is pending continue: return !getInventory().contains("Flax") || getDialogue().isPendingContinuation();
-
Fletching script
You should read some tutorials, there are loads on this website, and learn basic Java if you have not done that yet.
-
Hitting an API on exit?
Not really sure what you mean. If you want to do something when the script exits, override the onExit method in the Script class: @Override public void onExit() { }
-
Why is it good practice to make everything private?
https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)
-
Check if GroundItem is noted/stackable
If an item is stackable, it's noted id will be -1. Here is a test example: // Fire rune (stackable) log("Fire rune noted id: " + ItemDefinition.forId(554).getNotedId()); // Cannonball (stackable) log("Cannonball noted id: " + ItemDefinition.forId(2).getNotedId()); // Yew logs (not stackable) log("Yew logs noted id: " + ItemDefinition.forId(1515).getNotedId()); Output: [INFO][Bot #1][05/03 10:17:00 PM]: Fire rune noted id: -1 [INFO][Bot #1][05/03 10:17:00 PM]: Cannonball noted id: -1 [INFO][Bot #1][05/03 10:17:00 PM]: Yew logs noted id: 1516 So to check if a ground item is stackable: groundItem.getDefinition().getNotedId() == -1
-
Check if GroundItem is noted/stackable
Have you tried this to check if it is noted: groundItem.getDefinition().isNoted()