Comprehensive Colony/OSB Overview Tool

Complain about the nerfs here
no avatar
User

RAM

Rank

Captain

Captain
Posts

1093

Joined

Thu Sep 22, 2016 6:36 am

Re: Comprehensive Colony/OSB Overview Tool

Postby RAM » Thu Mar 25, 2021 1:27 pm

I built an AHK script to delete multiple OSB structures in a row. It is a little clunky to use, but works well.

If anyone needs it, let me know. I can paste the code or I can compile it and make a small program out of it. If there is interest, I might do both.

It allowed me to delete hundreds of structures for moving and replanning.
"The UNCA is not your boss!" ~ Jessica Steele
Fan Fiction from an old timer - RAM Memories
User avatar
User

Loke

Rank

Commander

Commander
Posts

492

Joined

Mon Jun 30, 2014 7:39 pm

Re: Comprehensive Colony/OSB Overview Tool

Postby Loke » Thu Mar 25, 2021 2:18 pm

I am interested in the code, at some point would like to make a script to remove powerplants on colonies, so they can be replaced with higher output planetary fusion
Callsign: Fraaggii or Loke
Mining yield calculator: https://docs.google.com/spreadsheets/d/ ... edit#gid=0
RAM wrote: Loving the SiFi but Loke got his first.
no avatar
User

RAM

Rank

Captain

Captain
Posts

1093

Joined

Thu Sep 22, 2016 6:36 am

Re: Comprehensive Colony/OSB Overview Tool

Postby RAM » Fri Mar 26, 2021 12:28 am

; ********************OSB Building Deleter***************************

F10:: ;Starts routine
Gui, Destroy
xstart :=0
xend := 0
zstart := 0
zend := 0
ystart := 0
yend := 0

dbGuiStart:
Gui, Color, 427277
If xstart xend := xstart
If zstart zend := zstart
If ystart yend := ystart

guixpos := A_screenwidth - 255
guiypos := A_screenheight - 300
;guihide := 0
Gui, Add, Text,,Select X Z Y cooodinates to delete:
Gui, Add, Text,xs,This will auto increment X, Z, or Y.
Gui, Add, Text, xs+10,From:
Gui, Add, Text, xp+100,To:
Gui, Add, Text, xs,X:
;Gui, Add, Text
Gui, Add, Edit, W60 xp+20 yp-5
Gui, Add, UpDown,vxstart Range0-200, %xstart%
Gui, Add, Edit, W60 xp+80
Gui, Add, UpDown,vxend Range0-200, %xend%
Gui, Add, Button, grunX W40 xp+80, Run X

Gui, Add, Text, xs,Z:
Gui, Add, Edit, W60 xp+20 yp-5
Gui, Add, UpDown,vzstart Range0-200, %zstart%
Gui, Add, Edit, W60 xp+80
Gui, Add, UpDown,vzend Range0-200, %zend%
Gui, Add, Button, grunz W40 xp+80, Run Z

Gui, Add, Text, xs,Y:
Gui, Add, Edit, W60 xp+20 yp-5
Gui, Add, UpDown,vystart Range0-200, %ystart%
Gui, Add, Edit, W60 xp+80
Gui, Add, UpDown,vyend Range0-200, %yend%
Gui, Add, Button, gruny W40 xp+80, Run Y

Gui, Show, w250 h200 X%guixpos% Y%guiypos%,OSB Deleter
WinSet, AlwaysOnTop, On, OSB Deleter
return

runX:
Gui, Submit, NoHide ; Save the input from the user to each control's associated variable.
SplashTextOn, 250,30, ,Click Ship Computer input line to start
WinMove, Click Ship Computer, , (A_ScreenWidth * .55), 50
KeyWait, lbutton, D
SplashTextOff
if (xstart > xend) xend := xstart
loop {
sleep 500
Send gg.destroybuilding %xstart% %zstart% %ystart%{Enter}
sleep 500
xstart++
} Until xstart = xend + 1
Gui, Destroy
xstart--
xend := xstart
Goto, dbGuiStart
return

runZ:
Gui, Submit, NoHide ; Save the input from the user to each control's associated variable.
SplashTextOn, 250,30, ,Click Ship Computer input line to start
WinMove, Click Ship Computer, , (A_ScreenWidth * .55), 50
KeyWait, lbutton, D
SplashTextOff
if (zstart > zend) zend := zstart
loop {
sleep 500
Send gg.destroybuilding %xstart% %zstart% %ystart%{Enter}
sleep 500
zstart++
} Until zstart = zend + 1
Gui, Destroy
zstart--
Goto, dbGuiStart
return

runY:
Gui, Submit, NoHide ; Save the input from the user to each control's associated variable.
SplashTextOn, 250,30, ,Click Ship Computer input line to start
WinMove, Click Ship Computer, , (A_ScreenWidth * .55), 50
KeyWait, lbutton, D
SplashTextOff
if (ystart > yend) yend := ystart
loop {
sleep 500
Send gg.destroybuilding %xstart% %zstart% %ystart%{Enter}
sleep 500
ystart++
} Until ystart = yend + 1
Gui, Destroy
ystart--
Goto, dbGuiStart
return

Image

If you are just deleting one building, you can just add the coords in the From: column and hit any Run button.
"The UNCA is not your boss!" ~ Jessica Steele
Fan Fiction from an old timer - RAM Memories
no avatar
User

RAM

Rank

Captain

Captain
Posts

1093

Joined

Thu Sep 22, 2016 6:36 am

Re: Comprehensive Colony/OSB Overview Tool

Postby RAM » Fri Mar 26, 2021 12:31 am

Loke wrote:I am interested in the code, at some point would like to make a script to remove powerplants on colonies, so they can be replaced with higher output planetary fusion


I think this only works for the OSB, but you could try it on the colony. Just use a 0 z and remember it is X Z Y not X Y Z. This means the Z in the middle will be 0 or ignored by the command.
"The UNCA is not your boss!" ~ Jessica Steele
Fan Fiction from an old timer - RAM Memories
User avatar
User

Loke

Rank

Commander

Commander
Posts

492

Joined

Mon Jun 30, 2014 7:39 pm

Re: Comprehensive Colony/OSB Overview Tool

Postby Loke » Fri Mar 26, 2021 1:57 pm

RAM wrote:
Loke wrote:I am interested in the code, at some point would like to make a script to remove powerplants on colonies, so they can be replaced with higher output planetary fusion


I think this only works for the OSB, but you could try it on the colony. Just use a 0 z and remember it is X Z Y not X Y Z. This means the Z in the middle will be 0 or ignored by the command.

It said colonies and starbases in patch notes, so I just tested and it does work on colonies :D

gg.destroybuilding -45 55

Found a Automated Fission Power Plant in cache file and used the coordinates and now there is one less of them in my colony. 1 down, 14624 to go :P
Now I can even remove all the aluminium mines instead of banning the output. This actually gives us a good tool to improve on old colonies that were mostly buildt before many buildings were added to the game
Callsign: Fraaggii or Loke
Mining yield calculator: https://docs.google.com/spreadsheets/d/ ... edit#gid=0
RAM wrote: Loving the SiFi but Loke got his first.
no avatar
User

RAM

Rank

Captain

Captain
Posts

1093

Joined

Thu Sep 22, 2016 6:36 am

Re: Comprehensive Colony/OSB Overview Tool

Postby RAM » Fri Mar 26, 2021 7:21 pm

So you just added the x,y coords and left of the Z which is in between and it worked? Good. The tool will need to be adjusted for it. Might just add a new one on the bottom of the XZY section I got and let it run with 2 numbers. Should be pretty easy. If I get too bored next week, I will do that. Thanks.
"The UNCA is not your boss!" ~ Jessica Steele
Fan Fiction from an old timer - RAM Memories
User avatar
User

Loke

Rank

Commander

Commander
Posts

492

Joined

Mon Jun 30, 2014 7:39 pm

Re: Comprehensive Colony/OSB Overview Tool

Postby Loke » Fri Mar 26, 2021 9:52 pm

RAM wrote:So you just added the x,y coords and left of the Z which is in between and it worked? Good.
Indeed, quite simple really. Only tried one, but should be easy enough to extract info from cache file for any type of building you want less of. Like for new colonies you can spam unis early on to quickly increase tertiary population and just remove a few hundred unis later on. This can actually be very useful


RAM wrote:
Loke wrote:

I think this only works for the OSB
Dont think man, it leads to no good :lol:
Callsign: Fraaggii or Loke
Mining yield calculator: https://docs.google.com/spreadsheets/d/ ... edit#gid=0
RAM wrote: Loving the SiFi but Loke got his first.
User avatar
User

Loke

Rank

Commander

Commander
Posts

492

Joined

Mon Jun 30, 2014 7:39 pm

Re: Comprehensive Colony/OSB Overview Tool

Postby Loke » Mon Mar 29, 2021 9:16 am

Made a test .ahk script for destroying buildings. Needed to slow it down to removing 1 building every 2 seconds to avoid it skipping, similar to how planning OSB modules too fast works. Can probably go faster on smaller colonies. Only removed 400 buildings on the test but should work fine as a afk tool to remove a lot of buildings (1800 per hour). Plan is to make a script that reads the cache to find buildings, then a loop that destroy named building a set number of times
Callsign: Fraaggii or Loke
Mining yield calculator: https://docs.google.com/spreadsheets/d/ ... edit#gid=0
RAM wrote: Loving the SiFi but Loke got his first.
no avatar
User

RAM

Rank

Captain

Captain
Posts

1093

Joined

Thu Sep 22, 2016 6:36 am

Re: Comprehensive Colony/OSB Overview Tool

Postby RAM » Mon Mar 29, 2021 2:30 pm

Loke wrote:Made a test .ahk script for destroying buildings. Needed to slow it down to removing 1 building every 2 seconds to avoid it skipping, similar to how planning OSB modules too fast works. Can probably go faster on smaller colonies. Only removed 400 buildings on the test but should work fine as a afk tool to remove a lot of buildings (1800 per hour). Plan is to make a script that reads the cache to find buildings, then a loop that destroy named building a set number of times


I will update mine to do straight runs. This will give others options if you make yours available too.

Sounds quite fancy, but what if they don't want to remove ALL of them? Add a counter to stop at a certain number if defined?
"The UNCA is not your boss!" ~ Jessica Steele
Fan Fiction from an old timer - RAM Memories
User avatar
User

Loke

Rank

Commander

Commander
Posts

492

Joined

Mon Jun 30, 2014 7:39 pm

Re: Comprehensive Colony/OSB Overview Tool

Postby Loke » Mon Mar 29, 2021 10:16 pm

I only have the idea how I want to make it so far, it will probably take me quite some time to write it.
The idea is to choose a building you want to destroy, then input how many. For example I want to remove 1000 power plants. The loop that send destroy commands will then run 1000 times.

The challenging part is to make the script that makes a list of power plants coordinates the loop can read from. I havent used AHK to read from files before, so that part is gonna be interesting. My colony cache is 16MB so I dont want to do it in a way thats gonna kill the pc either. Might do something similar as the old colony counter and produce a list of all the buildings. Or have a line counter for reading from the file, so that it will continue searching from the last line building was destroyed from. Im sure I will come up with more ideas as I figure out stuff, will end up doing whatever is easiest as usual :P

No fancy gui or anything. Just the normal edit in number and type of building, start with hotkey. Also there will be no way of controlling from where on the colony it removes buildings, but it should be in the same order as they were buildt.

Hopefully dont accidently start it in chat and let it run for 1 hour :|
Callsign: Fraaggii or Loke
Mining yield calculator: https://docs.google.com/spreadsheets/d/ ... edit#gid=0
RAM wrote: Loving the SiFi but Loke got his first.
PreviousNext

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB ® | Style by KomiDesign | Modified by Chris Valleriani