Jump to content

Foulwerp

Members
  • Posts

    9
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Foulwerp

  1. Sorry if I misunderstood your other posts say you are new with java but didn't mention prior experience. Having perfect xp rates for long or sometimes even short periods of time is a red flag for your account. I personally take random afk breaks in my scripts to break up the pattern and perfectness of the script and sacrifice a lot of xp to that to try to ensure longevity of the account. It seems to work for me, or I may just be lucky, but I have made scripts with perfect xp rates and those accounts didn't last nearly as long as accounts that sacrifice some xp. I understand you are on a throwaway account but even sacrificing some xp to ensure that your account live long enough to produce for you will greatly help and you can get more produced albeit slower but if they last longer they can produce more for you. I don't know what you are doing with the accounts seems like producing gold from the scripts.
  2. I guess I could of wrote my response a little more elegantly. He needs to learn how to utilize the loop and returning from the loop before he starts trying all these other things. He is using voids, doing everything and then just returning a default 700 after every action. Where if he puts the code in the loop he can tweak the returns and randomize them after each action. Does an action need to wait x millis before going back into the loop ect. The way he was doing it with voids ect works sure but he would be better suited at his level sticking to the loop till he learns how it works and gets more comfortable with the loop. Once he has a firm grasp of the logic and how it work he can move forward onto more complex things. While we could drop him head first in to task based scripts and push him to learn it before hes really ready and he could succeed and do well. The logic on those is the same as if you were to just put it in the loop itself and he probably would have less headaches with trying to figure out the java side of it as he has a very basic understanding of java.
  3. First off putting everything into methods then just calling that method is a terrible way to do this while it works it isn't pretty. I would just put it all into your loop directly. Typically you want to do only 1 action a loop. With the banking you could make it return from the loop after every withdraw but I cba to do that. Remember when you return from the loops that's how long it will wait in milliseconds before going back into the loop so you'll have to tweak the returns how you want I made everything 1 second. @Override public int onLoop() throws InterruptedException { if (!Banks.GRAND_EXCHANGE.contains(myPlayer())) { walking.webWalk(Banks.GRAND_EXCHANGE); return 1000; } if (inventory.getAmount("Giant seaweed") == 3 && inventory.getAmount("Bucket of sand") == 18) { if (bank.isOpen()) { bank.close(); return 1000; } getMagic().castSpell(Spells.LunarSpells.SUPERGLASS_MAKE); new ConditionalSleep(1000, 100) { @Override public boolean condition() { return getInventory().contains("Molten glass"); } }.sleep(); return 1000; } if (bank.isOpen()) { if (inventory.contains("Molten glass")) { bank.depositAll(); return 1000; } if (bank.getAmount("Giant seaweed") < 3 || bank.getAmount("Bucket of sand") < 18) { bank.close(); stop(); } bank.withdraw("Giant seaweed", 1); bank.withdraw("Giant seaweed", 1); bank.withdraw("Giant seaweed", 1); bank.withdraw("Bucket of sand", 18); return 1000; } bank.open(); return 1000; }
  4. NP I did edit my post to explain a little more about what I did and why.
  5. import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(info = "", name = "Chickens", logo = "", version = 1.00, author = "Foulwerp" ) public class Chickens extends Script { public int onLoop() { if (myPlayer().getInteracting() != null) { //This check at the start saves resources, because you don't do useless things like find new npcs while in combat return random(500, 1000); } NPC chicken = npcs.closest(new Filter<NPC>() { public boolean match(NPC npc) { //Multiple checks using a filter to find the best npc to attack. I guess, optimizing this to do the least //resource intensive checks first, leading up the the most intensive. If one of the first checks returns //false, you didn't waste a bunch of resources. If you check if the npc is reachable first you would waste a lot //of resources on an A* algorithm on a mob you may not even want to attack. This is because you are polling //all the mobs till one of these returns true to all checks. return npc.getName().equals("Chicken") && npc.getHealth() > 0 && npc.isAttackable() && map.canReach(npc); } }); if (chicken == null) { //If chicken is null just return so you wait for one to spawn return random(500, 1000); } if (!chicken.isOnScreen() { //Try to get the chicken on the screen by turning to it camera.toEntity(chicken); //Returning after doing an action return (500, 1000) } //Attack the chicken then return net iteration should see that I'm interacting which is the first check chicken.interact("Attack"); //Default return but again returned after I completed an action return random(500, 1000); } } I know how hard it can be to learn when you have no reference so I decided to give you one, and a few tips. Once you learn how to use filters life will be a lot easier. You can use multiple checks to find the perfect npc to attack, and not just the closest one to you. Filters can be applied to not only npcs but items, ground items, etc. Instead of checking if your player is moving or animating check if it is interacting with something. In most cases if it is your player is in combat. Try to write your code logically so that you don't have to use sleep. If you return it's better and what you return is how long in milliseconds it waits till it enters the loop again. When your script runs through the loop you want it to do 0 to 1 action and return. So every loop iteration should either have no actions done meaning the default is returned, or do 1 action in which you return a specified amount. Not action sleep another action sleep then return. In a sense returning is sleeping, but a much better way allowing the bot to do what it needs to before you enter the loop again. Randoms aren't a big deal on oldschool but returning allows the bot to check for them and do other background things, sleeping doesn't.
  6. Item food = inventory.getItem(new Filter<Item>() { public boolean match(Item item) { return item != null && Arrays.asList(item.getActions()).contains("Eat"); } }); Easier way to eat any food, because wont have to enter food name. It will eat anything that contains the action "Eat", which in almost all cases is food.
  7. I would look in the tutorial section... You would find the OSBot folder on your computer, in there will be a folder named Scripts. You then put the jar file in there and it will appear on the list of scripts you can run. Made quite few updates let me know if there are any bugs or issues with the new stuff that was implemented.
  8. I know very poor programming it was put in just so that I could see that the list was actually logging the names, wasn't meant to stay. I guess I could of used list.get(i). I'm a little rusty havn't written any code in about 4 years. Thanks for the info though..
  9. SIMPLE COMBAT by Foulwerp What it does: Kills any monsters added to the list by name Eats anything with the action of "Eat" meaning almost all foods Will now stop if you are out of food and reach the low health Loots items put on list by name I made this due to the lack of decent combat scripts on this site. Most are broken or very poorly written. I'm releasing this open source so hopefully people can use it, learn from it, and add to it. If you use any part of it in your own script all I ask is that you give credit where credit is due. Change Log 1.1 Updated GUI. You can now press enter to after typing name in text box to add it to the list, or click the add button. If you click a name in the list it will remove it. Added Eating it will eat almost any food. As well as logging out when out of food. Not an optional feature. Added a simple paint to just show how much EXP was earned, and how much you are getting an hour. 1.2 Added Item Pickup by name only. Made it so that it shouldn't attack mobs if they are unreachable, such as outside a closed gate/door, or other side of a wall. You can keep GUIs open, allowing you to edit mobs and pickup items while the script is running. Download SimpleCombat.jar Source
×
×
  • Create New...