Difference between revisions of "Common YOLOL"
Vox Serico (talk | contribs) (→Pulsed Signal Script: Reduced script complexity. Reworded the description.) |
Vox Serico (talk | contribs) (Reorganized scripts into sections of their main device/machine.) |
||
Line 1: | Line 1: | ||
==Standard Generator Script (Basic YOLOL Chip)== | ==[[Fuel chamber]]== | ||
===Standard Generator Script (Basic YOLOL Chip)=== | |||
''Note: This script will require enough batteries on the ship to act as a buffer for the generator spool up time.'' | ''Note: This script will require enough batteries on the ship to act as a buffer for the generator spool up time.'' | ||
===Default Fields=== | ====Default Fields==== | ||
:FuelChamberUnitRateLimit=100-:StoredBatteryPower/100 goto 1 | :FuelChamberUnitRateLimit=100-:StoredBatteryPower/100 goto 1 | ||
===Non Default Fields=== | ====Non Default Fields==== | ||
''Note: This version of the script assumes either "'''GeneratorUnitRateLimit'''" or "'''FuelChamberRateLimit'''" (preferably the latter) are renamed to "'''limit'''", and at least one battery exists on the network with it's "'''StoredBatteryPower'''" field renamed to "'''bat'''".'' | ''Note: This version of the script assumes either "'''GeneratorUnitRateLimit'''" or "'''FuelChamberRateLimit'''" (preferably the latter) are renamed to "'''limit'''", and at least one battery exists on the network with it's "'''StoredBatteryPower'''" field renamed to "'''bat'''".'' | ||
Line 13: | Line 14: | ||
:limit=100-:bat/100 goto 1 | :limit=100-:bat/100 goto 1 | ||
===Tutorial Laborer=== | ====Tutorial Laborer==== | ||
''Note: The Laborer has renamed field names by default so this version will work for the tutorial ship.'' | ''Note: The Laborer has renamed field names by default so this version will work for the tutorial ship.'' | ||
Line 19: | Line 20: | ||
:Generator=100-:Battery_1/100 goto 1 | :Generator=100-:Battery_1/100 goto 1 | ||
==Settable on/off Generator flag== | ===Settable on/off Generator flag=== | ||
c=(c<1)*(:Battery_1<5000)+c*(:Battery_1<9999) :Gen=c*22+0.001 goto 1 | c=(c<1)*(:Battery_1<5000)+c*(:Battery_1<9999) :Gen=c*22+0.001 goto 1 | ||
Fitting this code on the Laborer Module requires renaming at least one device. (here the Generator was renamed Gen) | Fitting this code on the Laborer Module requires renaming at least one device. (here the Generator was renamed Gen) | ||
Line 25: | Line 26: | ||
5000 and 9999 are the start-charging and stop-charging levels. 22 is just enough charge to run the stock two box thrusters. | 5000 and 9999 are the start-charging and stop-charging levels. 22 is just enough charge to run the stock two box thrusters. | ||
==Awesome Generator Script (Basic YOLOL Chip)== | ===Awesome Generator Script (Basic YOLOL Chip)=== | ||
This YOLOL script is inspired by the standard generator script and is further optimized. | This YOLOL script is inspired by the standard generator script and is further optimized. | ||
Line 42: | Line 43: | ||
Depending on the amount of batteries and the amount of generators, a higher or lower value can be used for the variable "a" in the script. A too high value leads to the fact that the algorithm cannot find an optimal balance for the FuelChamberUnitRateLimit/Gen. | Depending on the amount of batteries and the amount of generators, a higher or lower value can be used for the variable "a" in the script. A too high value leads to the fact that the algorithm cannot find an optimal balance for the FuelChamberUnitRateLimit/Gen. | ||
===Awesome Generator Script=== | ====Awesome Generator Script==== | ||
// Variables for Tweaking | // Variables for Tweaking | ||
Line 53: | Line 54: | ||
:Gen=((:Bat<a)*d)+((:Bat>a)*((:Bat-c)*-1)/e) goto 8 | :Gen=((:Bat<a)*d)+((:Bat>a)*((:Bat-c)*-1)/e) goto 8 | ||
===Awesome Generator Script with On/Off Button and Minimum Power Production=== | ====Awesome Generator Script with On/Off Button and Minimum Power Production==== | ||
If the battery consumption is very high and the amount of rechargeable batteries is not enough until the generator produces enough power, you should consider using the following version of the script. | If the battery consumption is very high and the amount of rechargeable batteries is not enough until the generator produces enough power, you should consider using the following version of the script. | ||
Line 83: | Line 84: | ||
:Gen=:On*(((:Bat<a)*d)+((:Bat>a)*(((:Bat-c)*-1)+(:Bat-a)/f)/e)) goto 9 | :Gen=:On*(((:Bat<a)*d)+((:Bat>a)*(((:Bat-c)*-1)+(:Bat-a)/f)/e)) goto 9 | ||
== | ==[[Flight control unit]]== | ||
===Single lever forward/backward script (Basic YOLOL Chip)=== | |||
==Single lever forward/backward script (Basic YOLOL Chip)== | |||
''Note: This script assumes you have a center lever bound to FcuForward'' | ''Note: This script assumes you have a center lever bound to FcuForward'' | ||
===Default device fields=== | ====Default device fields==== | ||
:FcuBackward=-:FcuForward goto 1 | :FcuBackward=-:FcuForward goto 1 | ||
==Material Point Scanner Script== | ==[[Material point scanner]]== | ||
===Material Point Scanner Script=== | |||
''Note: Additionally to two output panels for '''"Material"''' and '''"Volume"''' and two buttons to toggle '''"Active"''' and '''"Scan"''' install a third button and rename '''"ButtonState"''' to '''"Next"''' and set its '''"ButtonStyle"''' to '''1'''.'' | ''Note: Additionally to two output panels for '''"Material"''' and '''"Volume"''' and two buttons to toggle '''"Active"''' and '''"Scan"''' install a third button and rename '''"ButtonState"''' to '''"Next"''' and set its '''"ButtonStyle"''' to '''1'''.'' | ||
:Material=:Material :Volume=:Volume | :Material=:Material :Volume=:Volume | ||
:Index=(:Index+:Next)*(:Index<:ScanResults) :Next=0 goto 1 | :Index=(:Index+:Next)*(:Index<:ScanResults) :Next=0 goto 1 | ||
==Continuous Material Point Scanner Script== | ===Continuous Material Point Scanner Script=== | ||
''Note: This is a modified version of the above script'' | ''Note: This is a modified version of the above script'' | ||
:Material=:Material :Volume=:Volume | :Material=:Material :Volume=:Volume | ||
Line 109: | Line 107: | ||
goto 1 | goto 1 | ||
==Pulsed Mining Lasers== | ==[[Mining laser]]== | ||
===Pulsed Mining Lasers=== | |||
Reduces power consumption by pulsing mining lasers on and off while a button is pressed. The duration of the on and off state are each configurable in number of ticks. (One tick is about 0.2 seconds) | Reduces power consumption by pulsing mining lasers on and off while a button is pressed. The duration of the on and off state are each configurable in number of ticks. (One tick is about 0.2 seconds) | ||
on=1 off=2 :MiningLaserOn=:ButtonState*(t<on) t++ t*=t<(on+off) goto1 | on=1 off=2 :MiningLaserOn=:ButtonState*(t<on) t++ t*=t<(on+off) goto1 | ||
==[[Navigation receivers]]== | |||
===Receiver Signal Display=== | |||
Using a display named '''Nav''' | |||
if :SignalStrength>0 then goto2 else :Nav="No Signal" goto1 end | |||
:Nav=:Message+"\n"+(1000000-:SignalStrength)/1000+" km" goto1 | |||
''This page is a WIP. Please contribute to it!'' | ''This page is a WIP. Please contribute to it!'' |
Revision as of 13:32, 30 August 2021
Fuel chamber
Standard Generator Script (Basic YOLOL Chip)
Note: This script will require enough batteries on the ship to act as a buffer for the generator spool up time.
Default Fields
:FuelChamberUnitRateLimit=100-:StoredBatteryPower/100 goto 1
Non Default Fields
Note: This version of the script assumes either "GeneratorUnitRateLimit" or "FuelChamberRateLimit" (preferably the latter) are renamed to "limit", and at least one battery exists on the network with it's "StoredBatteryPower" field renamed to "bat".
:limit=100-:bat/100 goto 1
Tutorial Laborer
Note: The Laborer has renamed field names by default so this version will work for the tutorial ship.
:Generator=100-:Battery_1/100 goto 1
Settable on/off Generator flag
c=(c<1)*(:Battery_1<5000)+c*(:Battery_1<9999) :Gen=c*22+0.001 goto 1
Fitting this code on the Laborer Module requires renaming at least one device. (here the Generator was renamed Gen)
5000 and 9999 are the start-charging and stop-charging levels. 22 is just enough charge to run the stock two box thrusters.
Awesome Generator Script (Basic YOLOL Chip)
This YOLOL script is inspired by the standard generator script and is further optimized. You can set from which amount of stored battery power the generator should generate less compared to the stored battery power.
It is assumed that specific YOLOL fields are renamed:
Ship Part | Old YOLOL field name | New YOLOL field name |
---|---|---|
Every Fuel Chamber | FuelChamberUnitRateLimit | Gen |
One Rechargeable Battery | StoredBatteryPower | Bat |
Depending on the amount of batteries and the amount of generators, a higher or lower value can be used for the variable "a" in the script. A too high value leads to the fact that the algorithm cannot find an optimal balance for the FuelChamberUnitRateLimit/Gen.
Awesome Generator Script
// Variables for Tweaking a = 9500 // If Battery Amount is lower than this, Gen is 100% // Static variables and precalculation c = 10000 // Max Stored Battery Power d = 100 // 100% e = (c-a)/d // Final Generator Scriptline :Gen=((:Bat<a)*d)+((:Bat>a)*((:Bat-c)*-1)/e) goto 8
Awesome Generator Script with On/Off Button and Minimum Power Production
If the battery consumption is very high and the amount of rechargeable batteries is not enough until the generator produces enough power, you should consider using the following version of the script.
Use a Hybrid-Button with the following field names and values configured:
Name | Value |
---|---|
On | 0 |
ButtonOnStateValue | 1 |
ButtonOffStateValue | 0 |
ButtonStyle | 1 |
The variable b can be used to set the minimum amount of power that the generators should generate. A too low value, can lead to the fact that the generators do not provide enough power yet and the batteries are already discharged. A too high value leads to the fuel rod consumption during standstill being too high.
// Variables for Tweaking a = 9500 // If Battery Amount is lower than this, Gen is 100% b = 10 // If Button is On, Gen will be at least this much // Static variables and precalculation c = 10000 // Max Stored Battery Power d = 100 // 100% e=(c-a)/d f=(d/b) // Final Generator Scriptline :Gen=:On*(((:Bat<a)*d)+((:Bat>a)*(((:Bat-c)*-1)+(:Bat-a)/f)/e)) goto 9
Flight control unit
Single lever forward/backward script (Basic YOLOL Chip)
Note: This script assumes you have a center lever bound to FcuForward
Default device fields
:FcuBackward=-:FcuForward goto 1
Material point scanner
Material Point Scanner Script
Note: Additionally to two output panels for "Material" and "Volume" and two buttons to toggle "Active" and "Scan" install a third button and rename "ButtonState" to "Next" and set its "ButtonStyle" to 1.
:Material=:Material :Volume=:Volume :Index=(:Index+:Next)*(:Index<:ScanResults) :Next=0 goto 1
Continuous Material Point Scanner Script
Note: This is a modified version of the above script
:Material=:Material :Volume=:Volume :Index=(:Index+:Next)*(:Index<:ScanResults) :Next=1 //pause :Scan=1 goto 1
Mining laser
Pulsed Mining Lasers
Reduces power consumption by pulsing mining lasers on and off while a button is pressed. The duration of the on and off state are each configurable in number of ticks. (One tick is about 0.2 seconds)
on=1 off=2 :MiningLaserOn=:ButtonState*(t<on) t++ t*=t<(on+off) goto1
Receiver Signal Display
Using a display named Nav
if :SignalStrength>0 then goto2 else :Nav="No Signal" goto1 end :Nav=:Message+"\n"+(1000000-:SignalStrength)/1000+" km" goto1
This page is a WIP. Please contribute to it!