Jump to content

yfoo

Lifetime Sponsor
  • Posts

    175
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Everything posted by yfoo

  1. In a single combat area where NPCs are aggressive to the player. How do I determine which NPC attacked me without attacking back. public static List<NPC> getNpcsAggroed(Bot bot) { MethodProvider methods = bot.getMethods(); return methods.npcs.filter(npc -> npc.getInteracting() != null && npc.getInteracting().equals(methods.myPlayer())); } ^ Above narrows it down to which NPCs instances would attack me. NPCs also don't deaggro just because one attacked me. public static List<NPC> getNPCImInteractingWith(Bot bot) { MethodProvider methods = bot.getMethods(); return methods.npcs.filter(npc -> methods.myPlayer().isInteracting(npc)); } ^ Only gets the npc after player starts attacking it.
  2. I don't think you need to put it in onloop. But you do need to space out the setting changes as they cannot all resolve in one pass. Have you tried doing one then sleeping? setHideRoofs() sleep(1000) setWorldSwitch() sleep(1000) ... Putting them all in onloop means those conditions need to be checked over the script's run session to only run once, minimal impact sure but avoidable nonetheless.
  3. I honestly think the stuff the OG scripters on osbot do is cool AF, and time consuming too. They all have their own thread theme Same for script logos Paint Swing GUI Discord support. Progressive leveling Script queueing, with some effort from the user you can setup your own account builder through chaining together a bunch of khal's scritps.
  4. min order size?, and do you take PYPL G&S or FNF
  5. OSB client issue, scripts don't handle login (the red tint means osb client has taken over), Also I think this just got fixed in new client release.
  6. TY for the trial. Works pretty good. Going to pick up a copy. Some small issues I noticed Portal mode can get stuck due to brawlers in rare circumstances. Understandable, it can be tricky to make an algo to handle them as walker doesn't handle them. They are not classified as a "Map collision" Special Attack needs user to manually input weapon name. When it should be set from a drop down populated by equipped weapon + inventory weapons. NVM i just noticed it using specs even though I don't think I set it. Pathing goofiness' if other players decide to close the gates. Especially if they are doing it purposely. I think Tryhards do it because it prevents shifters from TPing. Be cool if attacking deciding to atk a NPC through a gate and the gate is not broken, path past the gate first. Applicable to range mostly, but melee too if an enemy is right at the gate. I think an straightforward solution is to never use the center to cut across. Tryhards are also the most likely to report you too. Because bots devalue their diligently acquired, hard fought, and painstakingly achieved ingame accomplishments.
  7. "Added support to the login handler for unable to connect and too many login attempts." That guy in discord is now happy.
  8. Unfortunately I don't have an account I can use this on. Main is already 99, and pure is 52. However I am eyeing the Pest control script. Great way to max my CBs and Prayer in leagues. Maybe even convert the 1def pure to a voider. Ill put a comment in the 24hr trial thread in your sig for that script.
  9. At the chaos alter, will the script continuously use bones on the alter to get xp every tick (and subsequently minimize PK exposure) or does it let the game do it automatically?
  10. Take a look at ConditionalSleep's Api docs again, your usage is incorrect. https://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html. You really need to be overriding condition() and using that to determine when to stop sleeping. Right now you are just sleeping and hoping 5000ms is enough if you CS is returning false. Also every ConditionalSleep where you are just returning true imminently does nothing. For example if (tree.interact("Chop down")) { new ConditionalSleep(5000, 2000) { @Override public boolean condition() throws InterruptedException { return false; } }.sleep(); } I think your intention is to attempt to chop down a tree, then sleep until the tree is chopped down. In which case it should be something like... if (tree.interact("Chop down")) { new ConditionalSleep(5000, 2000) { @Override public boolean condition() throws InterruptedException { // As long condition() resolves to false, Conditional sleep will continue sleeping (if it hasn't been 5seconds yet). // When you are woodcutting, myPlayer().isAnimating() returns true. // I want to my script to wait until the woodcutting animation is complete (meaning the tree is chopped down) // so by !myPlayer().isAnimating() (note the ! in the beginning) // The script will wait until your character stops chopping (aka stops animating) before checking for the next tree. return !myPlayer().isAnimating(); } }.sleep(); }
  11. Thanks, goal for now is to have a portfolio of scripts for every skill in RS.
  12. https://github.com/YifanLi5/OttoGrottoFisher ~20k-55k fishing xph, ~2.5-5.5k strength and agility xph. (Lvl Based) Random inventory shift click drop orders. If player stops fishing, may drop fish if inventory is almost full. (Can't AFK much if not many inventory freespace) AFK simulation, different AFK timings every script run session gaussian / random normal distribution / bell curve timings triggered if inventory is full or if the fish npc moved. Dragon Harpoon special (If equipped) Saves Clue bottles Stops on feather/bait shortage https://github.com/YifanLi5/Mark-And-Chop Random inventory shift click drop orders. If player stops chopping, may drop logs if inventory is almost full to prepare for next AFK cycle. Can't AFK much if not many inventory freespace AFK simulation, different AFK timings every script run session gaussian / random normal distribution / bell curve timings triggered if inventory is full or if the tree was chopped down. Dragon axe special (If equipped) Picks up nests Both uses fairly identical code as both activities are the same thing. Interact -> Wait until inventory full or player stops animating -> drop all -> restart... Chopping script can mark/chop any choppable tree, however that doesn't mean it is compatible with all situations or locations. ex: Marking a tree in a valley and one on a cliff. My takeaway from writing the above scripts... 1. I understand why the premium scripts use AREA instead of marking individual trees such as... Because an Area filter on trees (RS2Objects) is much more easier to do. 2. I needed a paint template to speed things along. Grid can display whatever info you want based on the String[][] data argument. See Paint/ScriptPaint.java for usage (Either github project). private void drawGrid(Graphics2D g, String[][] data, int cellWidth, int cellHeight) { g.setFont(font); g.setColor(GRID_BG); //Background Color of Grid int maxNumCols = 0; for (String[] row : data) { maxNumCols = Math.max(maxNumCols, row.length); } if (gridCanvas == null) gridCanvas = new Rectangle(cellWidth * maxNumCols, cellHeight * data.length); g.fill(gridCanvas); g.setColor(Color.WHITE); // Color of Text and Grid lines g.draw(gridCanvas); // draw the horizontal lines for (int i = 0; i <= data.length; i++) { int y = i * cellHeight; g.drawLine(0, y, cellWidth * maxNumCols, y); } for (int row = 0; row < data.length; row++) { int numElementsInRow = data[row].length; for (int col = 0; col < numElementsInRow; col++) { // draw the strings in the right positions int textX = col * (gridCanvas.width / numElementsInRow) + (gridCanvas.width / (numElementsInRow * 2) - g.getFontMetrics().stringWidth(data[row][col]) / 2); int textY = row * (gridCanvas.height / data.length) + (gridCanvas.height / (data.length * 2)) - g.getFontMetrics(font).getHeight() / 2 + g.getFontMetrics().getAscent(); g.drawString(data[row][col], textX, textY); // draw the vertical lines. Dividing each row into {numElementsInRow} sections for (int i = 0; i < numElementsInRow - 1; i++) { int x = col * (gridCanvas.width / numElementsInRow); g.drawLine(x, row * cellHeight, x, row * cellHeight + cellHeight); } } } }
  13. yfoo

    Speedrun Quester

    > To be able to run it successfully do you need to disable world hop? Yes, as some item pickup (such as the iron dagger in lum goblin shack) may hop to a non leagues world. Same setting will need to be set for speedrunning worlds as well. > Also, could you give me more details about this? I tried to get reproduction steps for the leagues issue but it seems like its working now. There wasn't any relevant logs either. Not work investigating as the gamemode is transient and half of the quest will not work unless Asgarnia is unlocked.
  14. yfoo

    Speedrun Quester

    I just picked up a copy. Using it for leagues. Just a quick note, in leagues there is a new section in the quest tab for league stuff. It seems that if this league exclusive section is open, the script will idle. Probably something to do with the related widget being changed. As long as the quest list interface is manually opened everything will function fine.
  15. This is LMS isn't it. Since you want one bot instance to run to another and then kill each other to guarantee points.
  16. Use Kafka? Probably too overkill + Extra dependency. I would write a separate Rest API that all your scripts can call to disseminate information to every other registerd script. Idea is very similar to how a listener works between classes. Don't forget authentication if this is not local. Your script would also need to expose an endpoint that this REST API would use. - POST: Register script instance Pass in your script instance's endpoint - POST: Broadcast message Broadcast whatever it is to all your script instances. Call the script's endpoint that was register before. - POST: Close server Tell all your scripts to shut up. Pretty much a chatroom.
  17. Seems the be the case. I walk away, trigger a load then the hashcode of the instance changes when I come back. [INFO][Bot #1][11/15 09:09:19 PM]: Querying Entity [INFO][Bot #1][11/15 09:09:19 PM]: org.osbot.rs07.api.model.InteractableObject@60beb29d [INFO][Bot #1][11/15 09:09:19 PM]: Optional[org.osbot.rs07.api.model.Model@52697857] Walk and return... [INFO][Bot #1][11/15 09:10:05 PM]: Querying Entity [INFO][Bot #1][11/15 09:10:05 PM]: org.osbot.rs07.api.model.InteractableObject@856ac72 [INFO][Bot #1][11/15 09:10:05 PM]: Optional[org.osbot.rs07.api.model.Model@f00a947] Same situation for if the entity is consumed (Tree chopped)
  18. I think the answer is until I walk far enough to hit a loading screen. The RS would get the set of objects in the newly loaded game area which would then be intercepted by osbot and made available through the api. The instances from the previous area would be available to the JVM for garbage collection. Going to test that hypothesis
  19. Lets say I query for some Entity and store it to a variable. List<RS2Object> visibleTrees1 = objects.filter( new ContainsNameFilter<>("tree"), rs2Object -> !rs2Object.getName().contains("Tree stump") && rs2Object.isVisible() && myPlayer().getPosition().distance(rs2Object.getPosition()) <= 5 ); Rs2Object myReference = visibleTrees.get(0); For how long is that instance (myReference) valid for interaction events? If I leave the area and come back, can I still use the instance I queried before? Or has it gone stale and need to be re-queried?
  20. This works under the assumption that Stage N will be guaranteed to setup the conditions that Stage N + 1 can solve. This will work for some activities but not others. EX: Fletching Logs -> bow (u)s (Works) Stage 1: Open Bank, Deposit (bow (u)s if needed) Stage 2: Withdraw Items. (Assumes that the bank is open) Stage 3: Close Bank Stage 4: use knife on Log, wait until no more logs. Ex: Rooftop Agility (May not work) Stage 1 - N: Do some agility obstacle, Finish at the end. What if at Stage 3 you fall off the rooftop. Stage 4 which expects you to still be on the rooftop now no longer works. You can solve these issues by... Add boolean canRunStage() to Stage interface, implement in all your stages. If canRunStage returns false, loop through your stage, get the first one stage where canRunStage returns true. Start your stages from there. It may be better to have your Stages be in a circular LinkedList instead since you are going to iterate through them again starting at Stage1.
  21. In the client there is a debug section on the right (3 gears) with a bunch of checkboxes. Try enabling/disabling each one of them until the client highlight the area attack. It is likely some kind of of entity (Subclass). Then you can look in the osbot API for the relevant classes to handle detection. ex: If its a NPC, check https://osbot.org/api/org/osbot/rs07/api/NPCS.html.
  22. V2: Now splits up the rows into equal sections based on the corresponding row in String[][] data. private void drawGrid(Graphics2D g, String[][] data, int cellWidth, int cellHeight) { g.setFont(font); g.setColor(GRID_BG); //Background Color of Grid int maxNumCols = 0; for (String[] row : data) { maxNumCols = Math.max(maxNumCols, row.length); } if (gridCanvas == null) gridCanvas = new Rectangle(cellWidth * maxNumCols, cellHeight * data.length); g.fill(gridCanvas); g.setColor(Color.WHITE); // Color of Text and Grid lines g.draw(gridCanvas); // draw the horizontal lines for (int i = 0; i <= data.length; i++) { int y = i * cellHeight; g.drawLine(0, y, cellWidth * maxNumCols, y); } for (int row = 0; row < data.length; row++) { int numElementsInRow = data[row].length; for (int col = 0; col < numElementsInRow; col++) { // draw the strings in the right positions int textX = col * (gridCanvas.width / numElementsInRow) + (gridCanvas.width / (numElementsInRow * 2) - g.getFontMetrics().stringWidth(data[row][col]) / 2); int textY = row * (gridCanvas.height / data.length) + (gridCanvas.height / (data.length * 2)) - g.getFontMetrics(font).getHeight() / 2 + g.getFontMetrics().getAscent(); g.drawString(data[row][col], textX, textY); // draw the vertical lines. Dividing each row into {numElementsInRow} sections for (int i = 0; i < numElementsInRow - 1; i++) { int x = col * (gridCanvas.width / numElementsInRow); g.drawLine(x, row * cellHeight, x, row * cellHeight + cellHeight); } } } } Designed to be universal for all scripts to quickly show data. Functional Examples... https://github.com/YifanLi5/Mark-And-Chop/blob/master/src/Paint/ScriptPaint.java https://github.com/YifanLi5/OttoGrottoFisher/blob/OttoGrottoFisher/src/Paint/ScriptPaint.java Preview: https://imgur.com/a/wx8K77D
×
×
  • Create New...