Space Engineers

Space Engineers

501 个评价
Easy Automation V2.0
6
9
4
3
2
   
奖励
收藏
已收藏
取消收藏
标签: other_script
文件大小
发表于
更新日期
356.981 KB
2016 年 5 月 30 日 下午 3:50
2023 年 9 月 26 日 上午 1:57
65 项改动说明 ( 查看 )

订阅以下载
Easy Automation V2.0

描述
Current Version from this subscription = 2.054

Also check out my first Space Engineers Mod:
Easy Access Programmable Block Controls
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2872094732

Timer Block no longer needed as of V2.035

Not compatible with:
- Space Data Center by mooviies

New features since release:

v2.040
- Added ability for Rename statement to use variables like the Write statements do. You can't use Rename if your block name contains a \

V2.041
- Addressed Keen's change to how rotors deal with being out of the set limit range. Rotors should now be functioning correctly and be able to rotate counter clockwise once again.

V2.042
Added the ability to use negative angles with rotors and hinges (to account for using hinges that have negative lower limits) with the Rotate and ShortRotate statements.

v2.043
-Added the ability have EA2 code in the Custom Data field of any block, not just LCD's.
-As a result the "Show Properties" and "Show Actions" statements now require a debug LCD to be shown.
-Multiple LCD's can now be named as the debug LCD and all will show the debug info. This works in the same way that Named Groups work when referencing other blocks.

V 2.044
Added ability for Variables to reference other Variables in text (useful for passing a compiled variable as a run argument for a Programmable block)
Added a Closing round bracket to the list of ending characters for variable v in InsertVars method on line 1694 so it could recognize the end of the variable name that is at the end of enclosing brackets.

v2.045
CustomWrite, CustomWriteNew, CustomWriteLine, and CustomClear now work with all blocks that have a terminal interface, not just LCDs

v2.046
Fixed bug where having a * as the first character in a write statement's write text would confuse the parser into thinking it was the instruction for a Dynamic variable pointer.

V2.047
added a missing bit of logic to combine multi word component names before a != operator into a single token.
- thanks to Survival Ready for the bug find.

V2.048
Math in the Variables code block can now use other variables.
Do not attempt to put the variable into it's own Math function. This will create an infinite loop and will lock up the programming block. If you do, you will need fix your variable code and recompile the programmable block to get it working again.

V2.49
modified how EA handles filled of gas tanks, it now returns a ratio.

V2.050
- Fixed issue where the last character in a value taken from the detailed info would not be included.
- Changed floats to doubles for the ability to do math with larger numbers.
- Added the ability obtain the amount of blocks that have been completed in a projection as well as the percentage a projection is finished.
-To get the number of blocks finished use "Build progress of Projector"
-To get the % of the projection that is finished use "Build progress% of Projector"

V2.051
- Added special case for obtaining the connected status of a connector.

V2.052
-removed an old cast to LCD that was preventing the custom data of all blocks from being used when referencing other CodeBlocks.

V2.053
- Added the ability to select which screen you wish to write to on blocks that have more then one screen (like a cockpit) by appending the number of the screen directly after the write statement like so:

WriteNew2 to MyCockpit = "Text" will write to the second LCD in the cockpit

if you have other blocks in the group that have less screens then what you have marked then the text will display on screen 1 as a default.

v2.054
-Added some error handling to the screen write and fixed bug with how blocks with to few screens would be handled.

Current Version from this subscription = 2.054

Welcome fellow space engineers, to the Easy Automation InGame Script V2.0
Much has changed since the previous version which is why I am releasing this as a new item on the workshop.

The Easy Automation V2.0 script will allow you to:
  • Delay actions to millisecond precision
  • Manipulate the Sliders and Actions of every block
  • Stop an Automation until a desired situation happens and then resume
  • Take a Value from one block and apply it to another
  • Rotate a rotor to a desired angle at a desired speed
  • Create complex logic which will govern how your automation’s react to different situations
  • Have unlimited LCD code size
  • Write and manipulate text on LCD's
  • Write current values of blocks to LCD's (such as a pistons "Current position")
  • Write to the core LCD the actions and properties of a block you may want to manipulate
  • Modify block names (Especially useful when interacting with other tech such as Digi's Control Module)
  • Create and destroy specialized groups as well as use the games built in groups (the built in groups can't be created, destroyed or modified with this system)
  • Run other programs with arguments you define in your program
  • Reset the Easy Automation system in case of a systems failure
  • View debug info of a non functioning automation in the detailed info of the Programming block
  • Assign simple algebra equations to variables
  • Edit the LCD code as the programmable block is running it for run time testing/experimenting.
  • And maybe some other stuff that I can't remember right now, this thing has gotten pretty big!



I have written up a detailed guide for set up and all available functionality here:
http://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=685206874

If you are still having trouble after referring to the guide then ask your questions in the "Questions on Use" discussion below or in the discussion you will find below the guide.

Good luck fellow Spacefarers and happy Engineering!

Feb 2nd 2017 - The Stable and Dev versions of the programmable block are now the same.
热门讨论 查看全部(11)
297
10 月 5 日 下午 9:02
Questions on Use
Coren
161
7 小时以前
Bug Reports
Coren
1
6 月 6 日 上午 8:37
Convert to ship
[MAIM]IronDad
929 条留言
Dext3r09 10 月 16 日 上午 11:10 
I had that issue too. There is general issue with get status "Attached" or "Detached" because there is no properties for that, so you cannot use if statement.
You can use "if Attached ..." but this will use datailed info field which dissapear when detached and cause exception in script.
I workaround that by using eventcontroller at first. Then I changed script by self (For science!) and add for datiled info options without value simply True/False and exception catch but I do not remember if that was working or not
Menko'Sar 10 月 15 日 下午 5:26 
Hi Coren, its been a wile on me asking for help. Still loving this Script mod. Its helped me make a true to scale working Nostromo from Alien.
I'm trying to set up a button to Attach/Detach rotor heads for portable batteries on our Role Play server.
The Debug Lcd is showing the action of the rotor using the simple Show actions script. It clearly list Attach and Detach Yet I cant seem to get a script to work.

Recharge Battery Rotor{
If Attach of Way Station - Battery Charge Point 1 = True
{
Detach Way Station - Battery Charge Point 1
}
Else If Attach of Way Station - Battery Charge Point 1 = False
{
Attach Way Station - Battery Charge Point 1
}
}

I've tried in the script On/Off 0/1 True/False. I cant think of anything else or have I missed something totally lol
Coren  [作者] 10 月 14 日 上午 10:30 
@TheTomRom
You are correct, Space engineers does not handle merging and unmerging of grids that have a running scrip on them very well. if you need it to continue to move along by crawling along, you could use landing pads to lock it in place, or docking connectors, or one of my favorites is getting 2 piston heads to lock into 2 piston bases... but these have their own little issues and caveats with the physics system. Sensors can also be of great help if you have two separate grids with separate scripts running to make sure everything is in the correct position. What you are attempting is something I did in an automated ship building factory a long time ago but that build is now defunct because Keen changed something fundamental about how sensors sense grids that they are a part of.
TheTomRom 10 月 13 日 下午 4:30 
Hi Coren, it's a rock solid script you have made - I am using it in many builds and I am very thankful for it!

I have a question: I use this to automate an endless miner which works by building its own guide rail with connector and merge block and a mobile plattform that moves along this guide rail. The mobile plattform is always connected with at least one merge block and one connector to the guide rail, but through which connection will change during the working cycle.

A recently discovered problem is that the script cannot find a certain piston (I gives me the error that it cannot find it) just after one merger and one connector are disconnected. If I just recompile the script and run everything again, it works without trouble. My suspicion is that this could be due to how SE handels the subgrids, as their link to the main grid changes. Do you think that could be true? Are there ways around it? And was my description even understandable?

Cheers, Tom
Coren  [作者] 9 月 14 日 下午 5:58 
@Toxicrobot
and even if it did trigger, the next check would throw an error if the block being referred to was not a cockpit block.
Coren  [作者] 9 月 14 日 下午 5:56 
@Toxicrobot
I am confused. The "if" statement you are referring to is a gate that is checking if the property being referred to is a cockpit property. this would not trigger on any Projector properties that I know of.
Toxicrobot 9 月 10 日 上午 11:07 
Oh this is my edit:
else if(property.Length > 1 && (locationAndMovement.Contains(property.ToLower()) ||
locationAndMovement.Contains(property.Substring(0,property.Length - 2))))
{
Toxicrobot 9 月 10 日 上午 10:47 
In GetSignals there is a bug:

else if(false && locationAndMovement.Contains(property.ToLower()) ||
false && locationAndMovement.Contains(property.Substring(0,property.Length - 2)))
{
^ This throws an index out of range error if the property is just 1 letter long (like in the Projector Y values!)

Editing it fixed the bug
Jack Schitt 6 月 6 日 上午 7:49 
Someone opened a discussion topic asking a question about whether it's possible to convert a ship to a station and vice versa using this. I don't think it is but I don't know for sure. Here's the topic:
https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/694296356/591773365282308220/?tscn=1749219135
Coren  [作者] 6 月 6 日 上午 7:41 
@FantazeR
You're welcome :)