Hayase Posted June 23, 2017 Share Posted June 23, 2017 (edited) When someone talks about task based script or enum based scripts there's always that other guy: Just use onloop bro! What does that mean though? Well first off you can think of it as normal scripting--it's not new! For an example take a look at this onloop() /** * Just use onLoop() bro * * @return the loop interval * @throws InterruptedException if something fucks up */ @Override public int onLoop() throws InterruptedException { if (!inventory.isFull() && cows.cowsNearby()) { status = "At work--picking up bones and hides..."; bone.pickupBones(); hide.collectHides(); hideCount = hide.getHideCount(); boneCount = bone.getBonerCount(); } else if (inventory.isFull()) { status = "Time to bank"; goToBank.walkToBank(); } else if (!cows.cowsNearby() && inventory.isEmpty()) { status = "Walking to cows for more loot"; cows.walkToCows(); } return random(200, 300); } It's small and concise. One could read it and understand what is going to be happening. Start from the top and work your way down: Inventory not full and cows nearby? Pickup some shit. Inventory full? Go bank Inventory not full and no cows nearby? FIND DEM COWS! It's easy to read, right? Just use onloop() bro Full project has been uploaded to this thread Bank.java CollectBoners.java CollectHide.java Main.java WalkToCows.java Edited June 23, 2017 by Hayase 2 Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted June 23, 2017 Share Posted June 23, 2017 How much did Explv pay you Quote Link to comment Share on other sites More sharing options...
Hayase Posted June 23, 2017 Author Share Posted June 23, 2017 2 minutes ago, HeyImJamie said: How much did Explv pay you $5 is $5 Quote Link to comment Share on other sites More sharing options...
Chris Posted June 23, 2017 Share Posted June 23, 2017 just use onLoop bro 2 Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted June 23, 2017 Share Posted June 23, 2017 6 minutes ago, Chris said: just use onLoop bro Love onLoop 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted June 23, 2017 Share Posted June 23, 2017 2 minutes ago, HeyImJamie said: Love onLoop Quote Link to comment Share on other sites More sharing options...
Viston Posted June 23, 2017 Share Posted June 23, 2017 (edited) What's onLoop JK, don't ban. Imo, I feel like using a Task system is easier to maintain for bigger scripts, that requires multiple things, such as an AIO script. Edited June 23, 2017 by Visty 2 Quote Link to comment Share on other sites More sharing options...
Funfight Posted June 27, 2017 Share Posted June 27, 2017 how / where do you declare where the bank is, what kind of hide / bones to collect etc. how / where do you declare where the bank is, what kind of hide / bones to collect etc. Quote Link to comment Share on other sites More sharing options...
Eliot Posted June 27, 2017 Share Posted June 27, 2017 (edited) I'm assuming this post is satire but putting everything in one method stops being practical as soon as there is any complexity in your script. Edited June 27, 2017 by Eliot Quote Link to comment Share on other sites More sharing options...
Volta Posted June 27, 2017 Share Posted June 27, 2017 agree Quote Link to comment Share on other sites More sharing options...
gumibearscuz Posted July 20, 2017 Share Posted July 20, 2017 Tasks based approaches are nice but I prefer trees. Made a "TreeMember" class and "TreeBranch" and "TreeLeaf" that extend it. A branch has a boolean that validates it and 2 treemembers (one for success, one for failure). The leafs just have a void to execute. This allows me to prevent having to double check conditions in any tasks and gives a lot of freedom for structuring it. E.g. I made a tutorial island script where onLoop() checks what Instructor I am on and then progresses down a tree specfic to that instructor. Quote Link to comment Share on other sites More sharing options...
Offensive Posted July 28, 2017 Share Posted July 28, 2017 Lol Quote Link to comment Share on other sites More sharing options...