August 15, 20196 yr Hey everyone, heres my first script. There was no combat script I could find which fought cows and banked their hides so I made one. Lemme know your thoughts I'd like to get this on the SDN https://github.com/cbartram/AeroCows
August 15, 20196 yr 1 hour ago, aerodude30 said: Hey everyone, heres my first script. There was no combat script I could find which fought cows and banked their hides so I made one. Lemme know your thoughts I'd like to get this on the SDN https://github.com/cbartram/AeroCows Excellent job, love seeing professionalism especially in regard to scripting - open source (check), readme.md file (check) and the license (check)
August 18, 20196 yr Looking good! In your AttackCow code, you're finding a suitable cow on the activate method and on the execute method. Perhaps create a cow variable up top and reuse the same cow? Also, you could filter out any cows that are being attacked by other players: private boolean isCow(NPC npc) { return npc.getName().equals("Cow") && npc.getAnimation() != Cow.DYING.getAnimation() && (ctx.myPlayer().equals(npc.getInteracting()) || npc.getInteracting() == null); // So either we're the dude the cow's focused on OR the cow's not focused on anybody right now } NPC cow = ctx.getNpcs().singleFilter(ctx.getNpcs().getAll(), (Filter<NPC>) this::isCow); Also, you could make your Task a little easier to use by having it extend MethodProvider and then exchanging the context. You can find it under the MethodProvider section here: Edited August 18, 20196 yr by liverare
August 18, 20196 yr I looked quickly but just 2 quick comments: Your task class could extend methodProvider instead of passing the reference throughout all the sub-classes. Your util to grab the cost of an item is probably costly (guessing a second or so). There's a json api that lets you grab the costs - https://osbot.org/forum/topic/146793-ge-data/
Create an account or sign in to comment