Lokes AutoHotKey tools for Ascent

Complain about the nerfs here
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Lokes AutoHotKey tools for Ascent

Postby Loke » Sat Jul 10, 2021 6:44 pm

Lokes AutoHotkey tools

Download current version here:
https://ufile.io/f/8otpp
The .exe file is ready to run, just download it and start it. Since its a .exe you will most likely get security warnings.
The .ahk file is for those who wants to read the code or have AutoHotKey installed

Its important that you put the file in the same folder as Ascent stores the cache files, should be: C:\Users\<YOURNAME>\AppData\LocalLow\Fluffy Kitten Studios\Ascent _ The Space Game

Features:
  • Mining yield caclulator, including ship trait miner
  • Age of roid calculator, input your max yield and see how old the roid was
  • OSB tool that lists all ship modules stored
  • Logging of systems and astroid fields, stores directly to a .csv file
  • It remembers your inputs from last time, so much less typing
  • SM deleter, a tool to delete a lot of sell and buy orders
  • Hotkey to ask NPCs all you need to know from them (that they can answer...)
  • Hotkey to hide/unhide menu buttons GUI
  • Minimalistic main menu, only a few small buttons in the upper right of the screen, where its not in the way of anything while playing ascent.
  • Shindis charting tool

Menu buttons are placed out of the way in upper rigth of the screen:
Image


OSB tool:
Image


Mining yield calculator:
Image
Remembers your inputs for skill, MB class etc.
Can calculate yield based on age in days or find age by inputing yield

Outputs a lot of yield info:
Image


Shindis charting tool:
Image
It remembers what you input last for system and automaticly suggests todays date. Saves a lot of typing, and can be edited before saving.
The tool creates a .csv with coloumn description in first row. Saves in same folder as this script is stored

Logging tool for asteroid fields:
Image
It remembers what you input last for system and automaticly suggests todays date. Saves a lot of typing, and can be edited before saving.
1 click asteroid types and number of proms.
The tool creates a .csv with coloumn description in first row. Saves in same folder as this script is stored

Stock Market deleter:
A tool to send many delsell and delbuy commands to SM. Similar GUI as the other tools

Hotkeys:
A list of hotkeys
Esc will immediately close it completely
Last edited by Loke on Mon Aug 02, 2021 3:01 pm, edited 9 times in total.
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0
no avatar
User

Shindi

Rank

Midshipman

Midshipman
Posts

12

Joined

Sun Aug 06, 2017 6:06 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Shindi » Sun Jul 11, 2021 9:26 pm

Thank you for the tool and inspiration!

I modified your code to add my charting tool. I did make one change to your base code and modified the data to Month - Day - Year. My tiny American brain can't seem to get past that.


Here is my modified file:
Code: Select all
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


MB := 10
Age := 0
Skill := 0
Miner := 0
;yield := 0
guixpos := A_screenwidth - 560
guiypos := A_screenheight - 50

If not FileExist("test log.csv") {
   FileAppend, Username`,Sector`,Number`,Full system name`,Date`,Col`,Ang`,Ure`,Chron`,Sid`,Kam`,Aut`,Auro`,Neuro`,Cyan`,Bast`,Prom`,Comment`n, test log.csv
   }

If not FileExist("chart.csv") {
   FileAppend, Username`,Sector`,Number`,Full system Name`,Date`,# of Planets`,# of Moons`,# of GG`,Type`,Object #`,Aluminium`,Carbon`,Iron`,Silicon`,Titanium`,Geo`,Grain`,Fruit`,Vegetables`,Meat`,Tobacco`,Gems`,Atmosphere`,H2O`,CH4`,NH3`,N`,O2`,CO2`,Pressure`,Temp`,Gravity`,Ocean`,Tritium`,Asteroids`,Notes`n, chart.csv
   }


Gui, +AlwaysOnTop -Caption
Gui, Color, 000000
Gui, Add, Button,, Chart ; The ym option starts a new column of controls.
Gui, Add, Button, X+10, Log
Gui, Add, Button, X+10, Calc
Gui, Add, Button, X+10, Keys
Gui, Add, Button, X+10, OSB
Gui, Add, Button, X+10, SM
Gui, Add, Button, X+10, Close
Gui, Show, X%guixpos% Y25, Companion
return  ; End of auto-execute section. The script is idle until the user does something.

ButtonCalc:
^!c:: ; ctrl + Alt + c runs yield calculator
Gui, New, +AlwaysOnTop
Gui, Add, Text,, Skill:
Gui, Add, Text,, MB class:
Gui, Add, Text,, Miner trait:
Gui, Add, Text,, Asteroid:
Gui, Add, Text,, Age in days:


Gui, Add, Edit, vSkill w50 ym,%Skill%  ; The ym option starts a new column of controls.
Gui, Add, Edit, vMB w50, %MB%
Gui, Add, Edit, vMiner w50, %Miner%
Gui, Add, DropDownList, roidtype, Colombite||Angrite
Gui, Add, Edit, vAge w50,%Age%
Gui, Add, Text,x+10, or yield:
Gui, Add, Edit, vYield2 x+10 w50,%Yield2%
Gui, Add, Text,xs,
Gui, Add, Button, default x+60, CalcYield
Gui, Add, Button, default x+50, CalcAge
Gui, Add, Button, default x+50, CloseCalc
Gui, Show,, Mining yield calculator
return  ; End of auto-execute section. The script is idle until the user does something.


ButtonCalcYield:
Gui, Submit, NoHide
yield := (Age + MB) * (1 + (Skill / (Skill + 100))) * 4 * (1 + 0.05 * Miner)
daily := (1 + (Skill / (Skill + 100))) * 4 * (1 + 0.05 * Miner)
result := Round(yield)
result2 := Round(daily,1)
MsgBox, 4096,, Yield: %result%`n`nAccuracy: +/- %result2%`nThe accurasy number is equal to how much yield increases per day
return

ButtonCalcAge:
Gui, Submit, NoHide
Age2 := Yield2 / ((1 + (Skill / (Skill + 100))) * 4 * (1 + 0.05 * Miner)) - MB
result2 := Round(Age2)
years := Round((result2 / 365),2)
MsgBox, 4096,,Days old: %result2%`nor %years% years
return

ButtonCloseCalc:
Gui, Submit
return

ButtonLog:
^!l:: ; ctrl + Alt + l runs logger
Gui, New
;Gui, GuiName:Logger
Gui, Add, Text,,System:
Gui, Add, Edit, vWho x+11 w100 ym,%Who%
Gui, Add, Edit, vSector w50 ym,%Sector%
Gui, Add, Edit, vNumber w50 ym,%Number%
Gui, Add, Text,xs,Date:
Gui, Add, Edit, vDate x+22 w100,%A_MM%.%A_DD%.%A_YYYY% ; Changed to month day year
Gui, Add, Text,xs,Comment:
Gui, Add, Edit, vComment x+1 w400
Gui, Add, Text,xs,Asteroids:
Gui, Add, CheckBox, vCol x+3, Col
Gui, Add, CheckBox, vAng x+10, Ang
Gui, Add, CheckBox, vUre x+10, Ure
Gui, Add, CheckBox, vChron x+10, Chron
Gui, Add, CheckBox, vSid xs+49, Sid
Gui, Add, CheckBox, vKam x+10, Kam
Gui, Add, CheckBox, vAut x+8, Aut
Gui, Add, CheckBox, vNeuro xs+49, Neuro
Gui, Add, CheckBox, vCyan x+0, Cyan
Gui, Add, CheckBox, vAuro x+0, Auro
Gui, Add, CheckBox, vBast x+10, Bast
Gui, Add, Text,xs,Prom:
Gui, Add, Edit, vProm x+22 w50
Gui, Add, Button, default x+10, Save

Gui, Show,, Logger
WinSet, AlwaysOnTop, On, Logger
return

ButtonChart:
^!m:: ; ctrl + Alt + m runs Charting
Gui, New
;Gui, GuiName:Chart
Gui, Add, Text,,System:
Gui, Add, Edit, vWho x+11 w100 ym,%Who%
Gui, Add, Edit, vSector w50 ym,%Sector%
Gui, Add, Edit, vNumber w50 ym,%Number%
Gui, Add, Text, xs,Date:
Gui, Add, Edit, vDate x+22 w75,%A_MM%.%A_DD%.%A_YYYY% ; Changed to month day year
Gui, Add, Text, x+5,P:
Gui, Add, Edit, vP x+1 w20,%P%
Gui, Add, Text, x+5,M:
Gui, Add, Edit, vM x+1 w20,%M%
Gui, Add, Text, x+5,GG:
Gui, Add, Edit, vGG x+1 w20,%GG%
Gui, Add, Text, xs w280 h1 0x7
Gui, Add, Text, xs,Type:
Gui, Add, DDL, vType x+22 w75, ||Moon|Rocky Planet|Gas Giant
Gui, Add, Text, x+10, Object #:
Gui, Add, Edit, vObject x+10 w50
Gui, Add, Text, xs w280 h1 0x7
Gui, Add, Text, xs,Mineral concentrations:
Gui, Add, Text, xs+10,AL:
Gui, Add, Edit, vAL x+1 w50
Gui, Add, Text, x+10,C:
Gui, Add, Edit, vC x+1 w50
Gui, Add, Text, x+10,FE:
Gui, Add, Edit, vFE x+1 w50
Gui, Add, Text, xs+10,SI:
Gui, Add, Edit, vSI x+4 w50
Gui, Add, Text, x+7,TI:
Gui, Add, Edit, vTI x+1 w50
Gui, Add, Text, x+10,Geo:
Gui, Add, DDL, vGeo x+1 w43, ||1|2|3|4|5
Gui, Add, Text, xs w280 h1 0x7
Gui, Add, Text, xs,Agricultural Analysis:
Gui, Add, Text, xs+10,Grain:
Gui, Add, DDL, vGrain x+1 w30, ||0|1|2
Gui, Add, Text, x+10,Fruit:
Gui, Add, DDL, vFruit x+1 w30, ||0|1|2
Gui, Add, Text, x+10,Vegetables:
Gui, Add, DDL, vVeg x+1 w30, ||0|1|2
Gui, Add, Text, xs+10,Meat:
Gui, Add, DDL, vMeat x+1 w30, ||0|1|2
Gui, Add, Text, x+85,Tobacco:
Gui, Add, DDL, vTobacco x+1 w30, ||0|1|2
Gui, Add, CheckBox, vGems xs+10, Gems
Gui, Add, CheckBox, vAtmos x+10, Atmosphere
Gui, Add, Text, x+16,Gravity:
Gui, Add, Edit, vGrav x+1 w50
Gui, Add, Text, xs w280 h1 0x7
Gui, Add, Text, xs,H2O:
Gui, Add, Edit, vH2O x+1 w50
Gui, Add, Text, x+5,CH4:
Gui, Add, Edit, vCH4 x+1 w50
Gui, Add, Text, x+5,NH3:
Gui, Add, Edit, vNH3 x+1 w50
Gui, Add, Text, xs+14,N:
Gui, Add, Edit, vN x+1 w50
Gui, Add, Text, x+12,O2:
Gui, Add, Edit, vO2 x+1 w50
Gui, Add, Text, x+6,CO2:
Gui, Add, Edit, vCO2 x+1 w50
Gui, Add, Text, xs+61,Pressure:
Gui, Add, Edit, vPress x+1 w50
Gui, Add, Text, x+3,Temp
Gui, Add, Edit, vTemp x+1 w50
Gui, Add, Text, xs w280 h1 0x7
Gui, Add, CheckBox, vTrit xs+10, Trit
Gui, Add, CheckBox, vOcean x+5, Ocean
Gui, Add, CheckBox, vAst x+5,Asteroids
Gui, Add, Text, xs,Notes:
Gui, Add, Edit, vNotes x+1 w220
Gui, Add, Button, default x+10, Add

Gui, Show,X%guixpos% Y65, Charting

WinSet, AlwaysOnTop, On, Chart
return

ButtonAdd:
Gui, Submit
FileAppend,%Who%`,%Sector%`,%Number%`,%Who%-%Sector%-%Number%`,%Date%`,%P%`,%M%`,%GG%`,%Type%`,%Object%`,%AL%`,%C%`,%FE%`,%SI%`,%TI%`,%Geo%`,%Grain%`,%Fruit%`,%Veg%`,%Meat%`,%Tobacco%`,%Gems%`,%Atmos%`,%H2O%`,%CH4%`,%NH3%`,%N%`,%O2%`,%CO2%`,%Press%`,%Temp%`,%Grav%`,%Ocean%`,%Trit%`,%Ast%`,%Notes%`n, chart.csv
if not ErrorLevel {
   MsgBox,4096,Charting, Charted: %Who%-%Sector%-%Number%,2
   }
else {
   MsgBox,4096,Error, Failed to save! `nIf you have the file open in a different program, close it and try again
   }
return

ButtonSave:
Gui, Submit
FileAppend,%Who%`,%Sector%`,%Number%`,%Who%-%Sector%-%Number%`,%Date%`,%Col%`,%Ang%`,%Ure%`,%Chron%`,%Sid%`,%Kam%`,%Aut%`,%Auro%`,%Neuro%`,%Cyan%`,%Bast%`,%Prom%`,%Comment%`n, test log.csv
if not ErrorLevel {
   MsgBox,4096,Logging, Logged: %Who%-%Sector%-%Number%,2
   }
else {
   MsgBox,4096,Error, Failed to save! `nIf you have the file open in a different program, close it and try again
   }
return


ButtonKeys:
MsgBox,4096,Hotkeys, Exit this app: Esc `n`nHide interface: Ctrl + Alt + h `nUnhide interface: Ctrl + Alt + u`n`nChart system: Ctrl + Alt + m `nYield calculator: Ctrl + Alt + c `nLog asteroid field: Ctrl + Alt + l `n`n`nNPCs: `nCheck status: Ctrl + Alt + s `n
return

^!u:: ; ctrl + Alt + u unhides GUI of mining companion
Gui, Show,, Mining companion
return


^!h:: ; ctrl + Alt + h hides GUI of mining companion
Gui, Hide
return


^!s:: ;NPC status

Sleep 1000
Send what is your cargo?{Enter}
Sleep 400
Send what are you doing?{Enter}
Sleep 400
Send where are you?{Enter}
Sleep 400
Send What is your trade route?{Enter}
Sleep 400

return


ButtonOSB:
MsgBox,4096,OSB,Not yet added, will show number of modules in future
return


ButtonSM:
Gui, New, +AlwaysOnTop
Gui, Add, Text,, Delsell start number:
Gui, Add, Text,, How many delsell commmands?
Gui, Add, Text,,
Gui, Add, Text,, Delbuy start number:
Gui, Add, Text,, How many delbuy commmands?
Gui, Add, Text,,Fill in which SM orders to delete, click ready, open SM and place the cursor and "Ctrl + Alt + d" to start

Gui, Add, Edit, vSellstart ym
Gui, Add, Edit, vSellnumber
Gui, Add, Text,,
Gui, Add, Edit, vBuystart
Gui, Add, Edit, vBuynumber
Gui, Add, Button, default, Ready
Gui, Show,,SM delete orders
return

ButtonReady:
Gui, Submit
b := Buystart
bstop := Buystart + Buynumber

s := Sellstart
sstop := Sellstart + Sellnumber
;MsgBox,4096,test,%b% %bstop% %s% %sstop%
return


^!d:: ; ctrl + Alt + d runs the script, check that the cursor is in SM console before you run it. You dont want to run it in chat!
loop {
Send delbuy %b%{Enter}
Sleep 500
b:=b+1
} Until b > bstop

loop {
Send delsell %s%{Enter}
Sleep 500
s:=s+1
} Until s > sstop
bstop := 0
sstop := 0
return


ButtonClose:
Esc::
ExitApp
return
;P::Pause, toggle


Thanks again for this!
no avatar
User

stagc2002

Rank

2nd Lieutenant

2nd Lieutenant
Posts

49

Joined

Wed Mar 25, 2015 5:47 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby stagc2002 » Mon Jul 12, 2021 2:37 pm

hi Loke
thank you for the work you have put in on this tool, I would love to use it but unfortunately because of the pissing contest between PRC and Google it is not possible for me to access Google Docs, if you could upload to a alternate site it would be appreciated. Again, thanks for the time you have spent on this
User avatar
User

Doodstamper9000

Rank

Lieutenant

Lieutenant
Posts

95

Joined

Sat Nov 14, 2015 8:40 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Doodstamper9000 » Mon Jul 12, 2021 5:11 pm

I can put it on a Nextcloud Server Heidistein owns. Not sure he would like the link to be shared here publically.
Senator for Gilead and Amber

Hope is the hand that guided me. Secured by the hand that set me free.
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Loke » Mon Jul 12, 2021 5:21 pm

Stagc, does this work: https://ufile.io/f/t3gbh
I downloaded the spreadsheets in xlsx and ods, but since it made in googledocs, the format gets a bit messed up, think the yield numbers should still be ok though, so hopefully that is ok to use.
Also added ship trait miner to the next 2 sheets. Been a while since I made it, so cant remember completly how it works, so hopefully I edited it correctly.
Assuming you meant the google sheets linked in my signature.

If you want the tools shown in this thread, you need Auto Hot Key installed, copy the code in first post and paste in notepad or similar, then save it as a .ahk file.
Currently the tool only calculate yield for col/ang, other asteroid types will be added soon. Will add how much is wasted do to lack of cargo space and a few more things, but that will have to wait until I have time. Should give all the info that the spreadsheets give, but with a nice GUI instead of messy spreadsheets.
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Loke » Mon Jul 12, 2021 5:33 pm

Shindi wrote:Thank you for the tool and inspiration!

I modified your code to add my charting tool. I did make one change to your base code and modified the data to Month - Day - Year. My tiny American brain can't seem to get past that.


Here is my modified file:
Thanks again for this!

Awesome! Thx for sharing, thats very good charting tool.
Good point about the date format, I probably need to find a solution to that so you can choose. I have been thinking of making a "config" file where things like that can be changed, and also to make it remember mining skills etc even when its completely closed. Will look into it at some point, most likely not soon.

I think the GUI works very well for adding more tools, just need to make sure it doesnt grow much in size. If RAM dont mind I could add his NPC comm tool for example.
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Loke » Wed Jul 14, 2021 7:21 pm

Updated version that saves inputs in a file when its closed. Also improved mining yield calculator, but still need to add more roid types. Date formats is a bit simple, will hopefully be able to make it more fancy and possbile to choose format in future versions.

Files:
https://ufile.io/f/tvm3j
Added a .exe version so that anyone can just download and run int. No need to have AurtoHotKey installed.
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Loke » Sat Jul 17, 2021 12:22 pm

Fixed an error in yield calc for prom.
Added the rest of the asteroids for caclulating yield and age:
Image

https://ufile.io/f/8mtwc


Edit:
FYI the compiled version (the .exe) behave slightly different compared to the non-cmpiled version (the .ahk). Main difference is that on the compiled version hotkeys only works if it is the active window, on the non-compiled version hotkeys work also when the game window or other windows are the active one, so its a bit more useful. So unless someone knows how to fix that, I suggest using the .ahk file if you can (needs AutoHotKey installed on you PC)
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Re: Ascent companion a AHK tool with yield calc and log

Postby Loke » Sun Aug 01, 2021 4:47 pm

New version 0.91:
https://ufile.io/f/ypwyg

Added OSB button that counts and lists all ship modules stored at the OSB you are currently at in game (automatically loads most recent cache file):
Image
Very convenient when building lots of ships to see how many of each modules you currently have. In the example you see there is 6 class 1 Armour Panels.
Might change the layout in future version to make it easier to read, any suggestions for a better layout?

Let me know if you experience wrong numbers of modules, cache files for OSBs tend to keep old data. I added a couple of checks to avoid errors related to this, but if cache file is too messed up you will get a message telling you to delete the cache file. Works perfectly on all my OSBs now at least

Edit:
New version with tweaks to the OSB tool, it was complaining about bad cache file a bit too often
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0
User avatar
User

Loke

Rank

Commander

Commander
Posts

577

Joined

Mon Jun 30, 2014 7:39 pm

Re: Lokes AutoHotKey tools for Ascent

Postby Loke » Mon Aug 02, 2021 1:39 pm

Updated version 0.92 that adds status of shipyard constructions to OSB tool.
https://ufile.io/f/8otpp
Also changed the name as I discovered Ascent Companion has been used a few times before
Callsign: Fraaggii or Loke
My AutohotKey tools: viewtopic.php?f=3&t=4329
Mining yield calculator (google sheets): https://docs.google.com/spreadsheets/d/ ... edit#gid=0

Who is online

Users browsing this forum: No registered users and 4 guests

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