liverare Posted January 4, 2018 Share Posted January 4, 2018 String food = "trout"; NPC rockCrab; @Override public int onLoop() { if (atBank()) { doBank(); } else if (atRockCrabs()) { doRockCrabs(); } return 250; } private void doBank() { if (stockedUpOnFood()) { if (goodHealth()) { goToRockCrabs(); } else { eat(); } } else if (bankHasFood()) { withdrawFood(); } else { stopScript(); } } private void doRockCrabs() { if (goodHealth()) { if (findRockCrab()) { attackRockCrab(); } } else if (hasFood()) { eat(); } else { goToBank(); } } Easy to debug. Easy to predict. Simple script logic. This is a high-level overview of an upcoming rock crab script. You can see from this small snippet everything my script does without having to read further into the script. Additionally, the logic's presented simplistically, enough so that it can be compared to pseudo code (if you plan your scripts). Maintainability is one of the most important elements of a script. Why? There'll come a time when this logic fails and you may not necessarily be the one maintaining your own scripts. Years from now when you've probably f'd off to pursue some other interest, your work will still be here, being used by people. Your script will break (because Jagex can't leave well enough alone) and some poor motherfucker is going to be tasked with salvaging your works. Do you really want to give him or her a hard time of it? You don't need to use task frameworks. You can, but please know what you're doing and how to make the most use out of it first. I've seen new scripters try use tasks frameworks and it saddens me, because their desired outcome could be written so much simpler. 5 Quote Link to comment Share on other sites More sharing options...
Orlando Bloom Posted January 4, 2018 Share Posted January 4, 2018 wtf is framework. Quote Link to comment Share on other sites More sharing options...
4otj34oitjoi34r4 Posted January 4, 2018 Share Posted January 4, 2018 just got my maxed main banned ty Quote Link to comment Share on other sites More sharing options...
Nintendo Switch Posted January 4, 2018 Share Posted January 4, 2018 Just now, 4otj34oitjoi34r4 said: just got my maxed main banned ty kys. 2 Quote Link to comment Share on other sites More sharing options...
Viston Posted January 4, 2018 Share Posted January 4, 2018 Indeed Pseudo code is useful. However, I've noticed that sometimes if you do have a bigger project/script, using a task framework is somewhat less tedious for me. But not sure if it also applies to some other people. Of course, the elements of using the task framework properly comes into hand. 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted January 4, 2018 Share Posted January 4, 2018 (edited) 20 minutes ago, Viston said: Indeed Pseudo code is useful. However, I've noticed that sometimes if you do have a bigger project/script, using a task framework is somewhat less tedious for me. But not sure if it also applies to some other people. Of course, the elements of using the task framework properly comes into hand. Pseudo code? Not sure you know what pseudo code is fren and also the "Task pattern" is trash Edited January 4, 2018 by Explv 1 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted January 4, 2018 Share Posted January 4, 2018 I'm all for this, and for some scripts this style works great. It's also quick to put together which is nice. That being said, for certain projects (mostly AIO stuff), going to town with OOP can be very rewarding and also really fun, lol Quote Link to comment Share on other sites More sharing options...
Explv Posted January 4, 2018 Share Posted January 4, 2018 @liverare ur doing the lord's work, preach the gospel, preachhhhhh Quote Link to comment Share on other sites More sharing options...
Explv Posted January 4, 2018 Share Posted January 4, 2018 Just now, Apaec said: I'm all for this, and for some scripts this style works great. It's also quick to put together which is nice. That being said, for certain projects (mostly AIO stuff), going to town with OOP can be very rewarding and also really fun, lol Yes, you are correct my friend. But when you're using the janky ass "Task pattern" with dumb shit like WalkingToTheBankOnTheOtherSideOfVarrockHaHaTask.java like a lot of people do, then you're just shooting yourself in the foot. 3 Quote Link to comment Share on other sites More sharing options...
dreameo Posted January 4, 2018 Share Posted January 4, 2018 7 minutes ago, Explv said: Pseudo code? Not sure you know what pseudo code is fren and also the "Task pattern" is trash he nub Quote Link to comment Share on other sites More sharing options...
TheMcPker Posted January 4, 2018 Share Posted January 4, 2018 pro lmao good joke Quote Link to comment Share on other sites More sharing options...
Viston Posted January 4, 2018 Share Posted January 4, 2018 16 minutes ago, Explv said: Pseudo code? Not sure you know what pseudo code is fren and also the "Task pattern" is trash Kmt Quote Link to comment Share on other sites More sharing options...
jller12 Posted January 4, 2018 Share Posted January 4, 2018 seems good if we are on a same thinking level. Quote Link to comment Share on other sites More sharing options...
Rxd Posted January 4, 2018 Share Posted January 4, 2018 (edited) 1 hour ago, Explv said: preach the gospel, preachhhhhh "4000 camels came down upon the earth to bite the whore wives of alpaca thieves." explv 4:16 "In order to free themselves from the jews, they thrusted their genitalia towards yahweh" explv 2:19 Edited January 4, 2018 by Rxd Quote Link to comment Share on other sites More sharing options...
Tom Posted January 4, 2018 Share Posted January 4, 2018 1 hour ago, Explv said: Pseudo code? Not sure you know what pseudo code is fren and also the "Task pattern" is trash ur parents are trash for conceiving someone who against fsm Quote Link to comment Share on other sites More sharing options...