Jump to content

Mr def nerd

Members
  • Posts

    1363
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    84.2%

Everything posted by Mr def nerd

  1. You have to create a new instance of it with bot as a parameter
  2. Personally I just use this if I am walking any normal paths without any obstacles: The walk method is simply walking a MinimapTileDestination. The code simply finds the best tile (It requires that the destination is at the end of the array, you can always reverse it yourself ), then if it manages to click the tile and the destination is somewhat close to the tile you wanted to walk, it will sleep until you are 5 tiles away from it (You can always randomize it) public boolean walkPath(Position[] path) { for (int i = path.length - 1; i >= 0; i--) { final Position pos = path[i]; if (pos != null && pos.distance(ctx.myPosition()) <= 16 && ctx.getMap().canReach(pos)) { if (walk(pos) && ctx.getMap().getDestination().distance(pos) <= 2) { ctx.sleep(new Condition() { @Override public boolean evaluate() { return pos.distance(ctx.myPosition()) > 5; } }, 3500); return true; } else { return false; } } } return false; } You would also need some sort of conditional sleeping method for this to work. You can also create a new instance of the LocalPathFinder which will allow you to generate a path between two points using A* (I am pretty sure its using A*)
  3. It indeed is, I am experiencing this issue aswell when my runecrafter is trying to empty its pouches, it simply right clicks, but fails to select any menu option
  4. This script will be released this weekend. There are probably things I have to change to make it even more user friendly, but currently there are just a few things you have to have in the back of your mind when you are creating scripts with this script. 1. When you add conditions to a bundle, ALL of the conditions you add have to be met for the actions to be executed (The script will execute these actions cronologicly). 2. If you want to create a script that for example alchs, you dont need to add any conditions only actions, because the script will always execute the bundle if there are no conditions attached to it. 3. If you want to make an advanced script, split the script up into pieces. E.g: If you want to make a druid killer. Make a seperate bundle for walking to druids, walking to bank, attacking, loot and eating. This way the script will be very stable and very safe. (Please note that if you split the script this much, you must make sure that they dont have conditions that overlap eachother (E.g you must make the script attack NPCs only if there are no loots available, then you must make the script loot only if there are loots available)
  5. All of my scripts has been off the SDN for quite a long time, which means that there will be no refunds. Although I wont stop updating them for quite a while
  6. I am still updating them, but I am not really sure if I want to add them to the store again. I am certain that I wont add the woodcutter back, but I will only add the miner back if I rewrite the whole script
  7. Awesome! Thanks Thank you I have now added a couple more methods and done a few small changes. The script will soon be ready for release
  8. There is a reason to why it has not been released yet. So there is no point stating the rules. I asked for my own OSD demotion due to the fact that I didn't have time to maintain my scripts, the time I now have
  9. Yep, it supports casting spells on entities (objects, npcs, grounditems etc), so therefore it should be able to telegrab wines Thansk It will hopefully be released soon!
  10. If what you are saying is true, that you didnt even talk then I assume you have to be flagged
  11. Its not completely done yet, but once it is I'll let you try
  12. Thanks. I had it laying around so I thought I might aswell fix it up and release it :P
  13. I have been sitting on this script for quite a while, and I guess its time for it to be released. It allows you to make almost all kinds of scripts. The whole point of the script is that the user is able to make almost any scripts that they preffer. So far I have created a few woodcutters with ent support, a flesh crawler killer with banking, eating and looting, a hill giants script, a fletcher and a couple of other scripts Below is an example of the script in action: In this video I used the path walking with obstacle handler which allows the script to walk a specified path that you create, then it uses the obstacle handler to grab and interact with the required obstacles The script maker consists of something called bundles. A bundle is a container that contains both actions and conditions. An action is anything from clicking attack on an NPC or walking a specific path (Will come back to this). A condition is anything from checking if the inventory contains certain items to see if a specific skill level is above/below/equals to a speicific number. A bundle can contain an unlimited amount of conditions and actions. In order for the bundle to execute its actions all of the conditions linked to the bundle has to be true. As an example we can look at a bundle that will attack a guard then sleep for 700 seconds. The conditions linked to this bundle is that the player has to be out of combat and the player is not facing any NPC. If those two conditions are met, it will attack the guard then sleep. Since it now is in combat it will no longer execute the actions in the bundle. Below is an image of the UI itself: As you can see above the script contains four bundles: Thieve, Eat, Bank and Walk to bank. You can also see that every bundle contains one set of actions and one set of conditions. To the right you can see it showing all of the actions linked to the bundle thieve, NOTE: This is a picture of the script when the actions was called strategies, this has now been changed. The image above shows the conditions of the bundle thieve. You can see that in order to execute the actions linked to thieve the player has to have atleast one of the item with the id 385 (shark), the guard also has to exist and the hitpoints level has to be above 60. When you for example click add condition/action as seen above you will be prompted with a specified input box for that condition/action. This box has to be correctly filled in in order to have the action/condition added to the bundle. Below is an example of such a box: As you can see the Cast spell on items box is selected in the combobox to the left. You can see that a new window with a combobox that contains all the spells and the possibility to add the id(s) of the items you want to cast the spell on This is the basics of the script. With this setup you can split the actions into many small fractions making the script capable of doing advanced things. Below you can see a list of a few conditions and actions. Actions: There are also some default methods that comes with the script: You will be able to record a path and use the obstacle handler with this script. This means you can walk a path without having to worry about the obstacles on the way The script has a built in interface handler which handles interfaces such as the ones you see in the stronghold of security I will post a video guide on how to use this script later This script will probably be free for a long time as it would require a lot of testing to find if any of the conditions/actions are broken etc Proggies
  14. Well, in that case you won't be able to save the respawn time of the certain item/object you want. I guess HashMap with a class that stores the respawn time and uses the world as a key would work. You could use a simple for loop to go through every value in the hashmap and then if one of them has reached the respawn time you simply hop to the world with the id of that key
  15. Yep, but its not really needed if you know what objects you are interacting with (lets say a specific door)
  16. If you are using the code for one specific door at a specific location you could create a class to hold the name and position, such as this: package com.scripts.mrsdefnerd.dnfishcooker.utils; import org.osbot.script.rs2.map.Position; import org.osbot.script.rs2.model.RS2Object; import com.scripts.mrsdefnerd.dnfishcooker.core.Main; public abstract class ObstacleObject { private String name; private Position location; public ObstacleObject(String name, Position location) { this.name = name; this.location = location; } public final String getName() { return name; } public final Position getLocation() { return location; } public final RS2Object get(Script ctx) { for (RS2Object object : ctx.closestObjectListForName(getName())) if (object != null && object.getPosition().equals(getLocation())) return object; return null; } public abstract boolean validate(Script ctx); } Declare this somewhere (I guess you can just declare it at the top of the class): ObstacleObject door; Then you can do something like this in you startup method: door = new ObstacleObject("Door", new Position(2816, 3438, 0)) { @Override public boolean validate(Script ctx) { return this.get(ctx) != null && !this.get(ctx).getDefinition().getActions()[1].toLowerCase().contains("close"); } } What the above code does is that it overrides the validate method to your custom prefference (it will check if the object at that position is not null, and make sure that the object does not have an action that contains close). EDIT: The "Door" is the name of the object, the new Position() is the position of the object, and the validate is the requirements for the object to retrieved (This way you can support most objects) This is probably a bit overdone, but if you have to handle alot of different objects I guess its a good way to do it. To use the code simply do (I am assuming you are calling the door class from the class that extends script): RS2Object doorObject = door.get(this);
  17. Anyone wants to trade scripts for likes :3?
  18. @Toastedmeat won my fighter competition with this proggie a while ago (it equals about 6 days)
  19. I took a look at your AIOWalker and saw that you actually generate the edges. Wouldn't this be very bad if you create paths through cities that has nodes on both sides of a wall (will make it try to walk through the wall)? I created a web walker a little while ago and I did this to begin with before I realized it would be way better to actually create the edges aswell
  20. You have to subtract by one, the length of an array with one object is 1, while the object index is 0. If the random method returns the length of this array it will give you a nullpointer as the object that has the index of the length doesnt exist (in short words: the lenght of an array is its total objects +1)
  21. what time today? Once Alek gets online, if he gets online
  22. Okay, this script is getting released today. If you used this script previously you will find quite a few improvements; - Faster and more accurate attacking - Full saving of presets, not only some parts - GUI is easier to use, alot of the things you had to fill out in the previous GUI is now decided by the bot - Will track your profit - Better obstacle handler Comming: - NPC handler, the bot itself will understand if it should speak to an NPC or if it should click an object (Metal dragons?)
×
×
  • Create New...