sudoinit6 Posted April 19, 2019 Share Posted April 19, 2019 Hey all, long time no see. I am thinking about doing some botting but I have a problem, I lost the laptop that had my ide on it and even though I wrote my own scripts I really don't know java (those that remember me should remember I said that often). Anyway, I had a "framework" that I found here on the forums and I used that as the base of my scripts. It consisted of one class that had a list of "tasks" to add to the list and the other classes were the actual tasks. The script would go through the class list and see if the "test" at the beginning of each "task" class matched the current state (if my player is in the bank and bank is not open). If it matched it would execute the code that followed, if not the script would move to the next task on the list. It worked similar to "state" scripts but many classes instead of one large one. I have been told this isn't good programming practice, and I understand that. The fact of the matter is this is the only way I know how to script and it works for me. Anyway, if anyone can point me in the direction of an open source script written this way I would appreciate it. I found the original one here years ago but can't seem to find one now. Thanks! Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted April 19, 2019 Share Posted April 19, 2019 Maybe look over some of the tutorials in the "Tutorials" section of "Scripting help" I'd recommend checking out @Eliot's 10 min Open-Source scripts here's one for example: Also take a look @Explv's scripting tutorial here: Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted April 19, 2019 Author Share Posted April 19, 2019 I have tried following Explv's tutorial, he is a great guy and talented programmer. I don't know how to explain it, but I just don't "get" it. Something doesn't click. With the task based classes I get it a little, enough to get by anyway. Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted April 19, 2019 Share Posted April 19, 2019 Or take a look in the general scripting help section. Lots of new people including myself posting code that could potentially help you in understanding better or the "Unofficial scripting section" https://osbot.org/forum/forum/288-unofficial-scripts-applications/ Which also has lots of open source scripts that could potentially help you. Best of luck! Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted April 19, 2019 Share Posted April 19, 2019 I personally split my scripts into a mix of a 'Task' / 'State' based framework. Add my Discord @ HeyImLit#3244 and I'll give you some code snippets. Quote Link to comment Share on other sites More sharing options...
Chris Posted April 19, 2019 Share Posted April 19, 2019 use onloop 1 Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted April 20, 2019 Author Share Posted April 20, 2019 14 hours ago, Chris said: use onloop Yeah, I do think the main class used onstart to build the list of tasks, and onloop to go through that list and try to match the current state of the game to the state statements at the beginning of all the other classes. If it matched then it executed the code and then started the loop over again, are you aware of any tutorials for scripting in this manner? Quote Link to comment Share on other sites More sharing options...
zwaffel Posted April 20, 2019 Share Posted April 20, 2019 Were you using something like this ? https://osbot.org/forum/topic/92612-tutorialindepth-a-better-take-on-task-based-scripts/ 1 Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted April 20, 2019 Author Share Posted April 20, 2019 9 hours ago, zwaffel said: Were you using something like this ? https://osbot.org/forum/topic/92612-tutorialindepth-a-better-take-on-task-based-scripts/ That is EXACTLY what I was looking for, thank you very much! 1 Quote Link to comment Share on other sites More sharing options...