d0sboots / PerfectTower

AI Scripts and Utilities for Perfect Tower II
Apache License 2.0
36 stars 11 forks source link

With down tiering possible, a script to up tier everything to T10? #19

Closed NickGrease closed 8 months ago

NickGrease commented 9 months ago

Seems like it might be easier/faster to uptier all dust to T10 and work back from there. No more worrying about leaving a single dust, no more trying to find the right balance/distribution of dust between tiers, etc. If your still around, what are your thoughts?

d0sboots commented 9 months ago

It won't be faster, but with the new(ish) uptier workers it might be easier. You don't needa script at all for the uptiering part.

You'd still ultimately a proper ratio though, because the purpose of the script is to leave your dust in a state where you're ready to use it.

NickGrease commented 8 months ago

Thanks for your input, I guess its like the saying '6 of one, half a dozen of another'. My initial thoughts were it would simplify the code base - everything can be made from a single tier of dust, but I guess not so much.

While I have you here, I did hope you can help: I want to write a script that will take 3 workers and have them perform the task 'mine and generate layers' on tabs 1-3 and then move them to tabs 4-6, then 7-9, and then 10-12, finally back to 1-3. I was hoping you could give me a few lines of pseudo code to get me going in the right direction. Love your Autominer, but having the workers do it means it can run in the background, and I'm itching to get back to scripting and seeing what I can do with the new 'window tool'

Also, I noticed in one of your scripts you do something like worker.name I'm guessing worker is internal to the game accessed thru lua - is there a list of data structures available thru lua? Or any documentation on the types of interactions possible with lua?

Anyways good to hear from you, thanks as always for your help!

d0sboots commented 8 months ago

While I have you here, I did hope you can help: I want to write a script that will take 3 workers and have them perform the task 'mine and generate layers' on tabs 1-3 and then move them to tabs 4-6, then 7-9, and then 10-12, finally back to 1-3. I was hoping you could give me a few lines of pseudo code to get me going in the right direction.

The worker functions can do this. The easiest way will be if you assign the workers fixed names. If you're using the external editor, look through the worker functions and you should find what you need. Also, if you're on the discord, there's at least one existing script posted that does this.

Love your Autominer, but having the workers do it means it can run in the background, and I'm itching to get back to scripting and seeing what I can do with the new 'window tool'

The window editor is unfortunately very twitchy and undocumented, so although it's possible to do great things with it, it's very hard to use.

Also, I noticed in one of your scripts you do something like worker.name I'm guessing worker is internal to the game accessed thru lua - is there a list of data structures available thru lua? Or any documentation on the types of interactions possible with lua?

worker.name is a standard one of the (many) functions available through the game, it has nothing to do with lua. Lua exists strictly as a preprocessing/macro layer on top - by the time the script is exported to the game, it no longer exists. You can see this by exporting and reimporting a script that has lua in it: all the lua (and other macros) will be gone, you'll just have statements and (large) expressions left.

NickGrease commented 8 months ago

Thank you very much, lots of useful info! Too bad about about the WindowUI, hope it gets some love in the future. I'll study up on your worker storage API, looks like just the ticket.