Jump to content

BravoTaco

Scripter II
  • Posts

    237
  • Joined

  • Last visited

  • Feedback

    100%

About BravoTaco

Profile Information

  • Gender
    Male
  • Location:
    United States

Recent Profile Visitors

2493 profile views

BravoTaco's Achievements

Steel Poster

Steel Poster (4/10)

84

Reputation

  1. Hello all, I've been out of the scripting scene for a little bit now and was wanting to get back into it, so if anyone wants a particular script created then you can reply here or message me with the details and I'll make it for you. I will most likely attach a link to the source code and compiled .jar file on my GitHub after completion for others to look at and or use. Script complexities will vary based off of how much time I have available to work on it and I may have to turn down some scripts as I don't want to create a free version of something that another scripter has a paid version for.
  2. I am willing to help you out with anything you need, scripting related, all though I won't be able to talk through things on Discord as my current employment requires me to travel around a fair bit. I can however respond to messages, so feel free to reach out whenever you have questions.
  3. If you are not needing an entire GUI, you could use the JOptionPane class, it allows you to bring up a modal input dialog box with just one line of code. String monsterID = JOptionPane.showInputDialog("Please enter the monster ID.");
  4. Sure! No problem! // Basic code to chop a regular tree, with a conditional sleep, when the player is not animating. if (!myPlayer().isAnimating()) { RS2Object tree = getObjects().closest("Tree"); if (tree != null && tree.interact("Chop down")) { // The conditional sleep returns true or false. // True being returned if the condition is met. IE. The player is animating. // False being returned if the condition is not met, and the max sleep time is met. // The sleep time is in milliseconds so 15000 == 15 seconds. if (ConditionalSleep2.sleep(15000, () -> myPlayer().isAnimating())) { log("Player is chopping the tree."); } } }
  5. @mrdukesilver Without having knowledge of the code inside of the other methods, this will be rather hard to debug. Try executing only the worldHop1 method without executing any other code to see if it functions as expected. I also recommend to look into the ConditionalSleep classes. Standard ConditionalSleep class new ConditionalSleep(maxSleepTime, checkInterval) { @Override public boolean condition() throws InterruptedException { return condition; } }.sleep(); Non-Standard ConditionalSleep class - I personally recommend using this one, as it is more straightforward. ConditionalSleep2.sleep(maxSleepTime, () -> condition)
  6. @CheckingItOut You are missing the import for the Message class. I would recommend giving this a look, https://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-or-cannot-resolve-symbol-error-mean It will help explain the error in detail. Adding this to your imports, should fix this though; import org.osbot.rs07.api.ui.Message;
  7. Not at the moment. Don't have the requirements on any account (That I'm willing to bot on) to use.
  8. any luck on any other diary script? im willing to help test

  9. I believe the difference is that completeDialogueU is surrounded in a try-catch, while the other is not. So you can use completeDialogueU without having to catch the exception yourself.
  10. I wrote up a quick example script. Not everything is implemented I left the buyItem() method blank so that you can implement that. It uses an Array of strings for the different items to alch, and a HashMap<String, Integer> that holds the alched count for each item. If you have any questions let me know. Also this code is untested. So it may be broken public class UCAlcher extends Script { private BotState botState; // This is used to keep track of how many of each item that can be alched, has been alched. private final HashMap<String, Integer> alchsMap = new HashMap<>(); // The different items you want to alch. private final String[] itemNames = new String[]{"Rune 2h Sword", "Rune platebody", "Rune platelegs"}; // This value represents how many items will be alched/bought for each item. private int alchLimitForEachItem = 2; private String currentAlchItemName; @Override public void onStart() throws InterruptedException { // Initialize the HashMap with the values from the itemNames array. for (String s : itemNames) { alchsMap.put(s, 0); } } @Override public int onLoop() throws InterruptedException { botState = setBotState(); if (botState != null) { switch (botState) { case ALCH_ITEM: { alchItem(); } case BUY_ITEM: { buyItem(); } } } else { warn("The botState is null."); stop(false); } return random(800, 3600); } private BotState setBotState() { currentAlchItemName = null; // for (Item item : getInventory().getItems()) { if (item != null && alchsMap.containsKey(item.getName()) && alchsMap.get(item.getName()) < alchLimitForEachItem) { currentAlchItemName = item.getName(); return BotState.ALCH_ITEM; } } // If the currentAlchItemName is null here than that means we need to possibly buy a new item to alch // or we need to reset the alch count on each item. if (currentAlchItemName == null) { for (String s : alchsMap.keySet()) { if (alchsMap.get(s) < alchLimitForEachItem) { currentAlchItemName = s; return BotState.BUY_ITEM; } } } // If the currentAlchItemName is still null than that means we have bought and alched all items. // So now we have to reset the alch count on each item and set the currentAlchItemName to the first index in the itemNames array. if (currentAlchItemName == null) { for (String s : alchsMap.keySet()) { alchsMap.replace(s, 0); } currentAlchItemName = itemNames[0]; return BotState.BUY_ITEM; } return null; } private void buyItem() { // Implement the buying of the item here. } private void alchItem() throws InterruptedException { Item alchItem = getInventory().getItem(currentAlchItemName); if (alchItem != null) { if (getMagic().canCast(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) { if (getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) { if (sleepUntil(() -> alchItem.interact("cast"), 5000, 20)) { alchsMap.replace(currentAlchItemName, alchsMap.get(currentAlchItemName) + 1); } else { warn("Unable to alch item."); } } } else { warn("Unable to cast high level alchemy. Stopping script."); stop(false); } } else { warn("The inventory does not contain the required item to alch. Something must have gone wrong when calculating the botState."); } } private boolean sleepUntil(BooleanSupplier condition, int maxTime, int checkInterval) throws InterruptedException { long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < maxTime) { if (condition.getAsBoolean()) { return true; } Thread.sleep(checkInterval); } return false; } private enum BotState { BUY_ITEM, ALCH_ITEM } }
  11. Yeah you are correct, you are essentially setting the pathToBank as a pointer to the pathToAltar so when accessing the pathToBank variable you are actually just accessing the value stored in the pathToAltar. Subsequently if you were to change the pathToAltar value than you would also essentially be changing the value of pathToBank since it is a pointer to that value.
  12. When you added your positions, you may have added them in a reversed order. Try recreating the array/list with the current positions reversed. Or you could do it through code at runtime with a quick Java call. Collections.reverse(pathToAltar); Edit: Just tested the current list you have and it seems to walk correctly from the bank to the air altar, if that is what you are intending. If so than you may have an issue with another part of your script somewhere. Is their more to this script or is it just executing the walking from above?
  13. Generally, you should always use getters/setters for variables contained in other classes, if one is provided as they may be doing more than just returning the variable. In example, calling getInventory() instead of just calling the variable could actually be verifying that it is returning the most up-to-date Inventory state, instead of the one that is currently cached.
  14. You are calling the Player class. To use methods that are within that class you must first set a Player variable. Also getSkullIcon() does not return a boolean value, it returns an integer. Player player = getPlayers().closest("Bob"); Then once you have set the Player variable you can than call those methods. Player player = getPlayers().closest("Bob"); if (player != null) { int enemyPlayerSkullIcon = player.getSkullIcon(); int enemyCombatLevel = player.getCombatLevel(); }
×
×
  • Create New...