Jump to content

Task based framework


sudoinit6

Recommended Posts

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!

Link to comment
Share on other sites

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! 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...