Integrated accelerator controller LUA scripts

This commit is contained in:
LemADEC 2017-05-20 12:23:27 +02:00
parent 99221df636
commit bb3075d5ac
3 changed files with 18 additions and 19 deletions

View file

@ -37,7 +37,7 @@ targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = config.minecraft_version + "-" + config.forge_version
runDir = "eclipse"
// replacing
replace "@version@", project.version
replaceIn "WarpDrive.java"
@ -53,19 +53,18 @@ dependencies {
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// skip source assets
// skip source assets
exclude '**/*.pdn'
exclude '**/*.psd'
@ -86,7 +85,7 @@ processResources {
//copies the commons folder to all instances
task copyOpenComputersCommons1(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipController')
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipController')
}
task copyOpenComputersCommons2(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
@ -98,7 +97,7 @@ task copyOpenComputersCommons3(type: Copy) {
}
task copyOpenComputersCommons4(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveAcceleratorController')
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator')
}
jar {

View file

@ -115,7 +115,7 @@ function lhc_page_parameter()
local controlChannel, isEnabled, threshold, description = lhc_parameter_get(indexSelected)
w.writeLn("Control channel #" .. w.format_integer(controlChannel, 9) .. " applies to:")
for key, controlPoint in ipairs(lhc_controlPoints) do
local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = unpack(controlPoint)
local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = table.unpack(controlPoint)
if cp_controlChannel == controlChannel then
w.write(string.format("%s %s @%s %s %s ",
w.format_string(cp_type, 10),
@ -134,7 +134,7 @@ function lhc_page_parameter()
description = w.input_readText(description)
w.writeLn("")
w.writeLn("Current theshold is " .. (threshold * 100) .. "%")
w.writeLn("Current threshold is " .. (threshold * 100) .. "%")
w.write("Enter parameter threshold: ")
local new_threshold = w.input_readNumber(threshold * 100) / 100
threshold = math.min(2.0, math.max(0.0, new_threshold))
@ -170,7 +170,7 @@ function lhc_parameter_get(index)
lhc_boot(false)
w.status_showWarning("Invalid parameter at index " .. index)
else
controlChannel, isEnabled, threshold, description = unpack(parameter)
controlChannel, isEnabled, threshold, description = table.unpack(parameter)
end
return controlChannel, isEnabled, threshold, description
end
@ -232,7 +232,7 @@ function lhc_page()
else
w.setColorDisabled();
end
w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. "EU)")
w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. " EU)")
-- w.writeLn("")
w.setColorNormal();
@ -244,9 +244,9 @@ function lhc_page()
else
w.setColorDisabled();
end
w.write(string.format("%fK", math.floor(temperatureCurrent_K * 10) / 10))
w.write(string.format("%.1f K", math.floor(temperatureCurrent_K * 10) / 10))
w.setColorNormal();
w.writeLn(". Target is " .. temperatureTarget_K .. "K")
w.writeLn(". Target is " .. temperatureTarget_K .. " K")
-- w.writeLn("")
w.write("Parameters: ")

View file

@ -114,7 +114,7 @@ function lhc_page_parameter()
local controlChannel, isEnabled, threshold, description = lhc_parameter_get(indexSelected)
w.writeLn("Control channel #" .. w.format_integer(controlChannel, 9) .. " applies to:")
for key, controlPoint in ipairs(lhc_controlPoints) do
local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = unpack(controlPoint)
local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = table.unpack(controlPoint)
if cp_controlChannel == controlChannel then
w.write(string.format("%s %s @%s %s %s ",
w.format_string(cp_type, 10),
@ -133,7 +133,7 @@ function lhc_page_parameter()
description = w.input_readText(description)
w.writeLn("")
w.writeLn("Current theshold is " .. (threshold * 100) .. "%")
w.writeLn("Current threshold is " .. (threshold * 100) .. "%")
w.write("Enter parameter threshold: ")
local new_threshold = w.input_readNumber(threshold * 100) / 100
threshold = math.min(2.0, math.max(0.0, new_threshold))
@ -169,7 +169,7 @@ function lhc_parameter_get(index)
lhc_boot(false)
w.status_showWarning("Invalid parameter at index " .. index)
else
controlChannel, isEnabled, threshold, description = unpack(parameter)
controlChannel, isEnabled, threshold, description = table.unpack(parameter)
end
return controlChannel, isEnabled, threshold, description
end
@ -231,7 +231,7 @@ function lhc_page()
else
w.setColorDisabled();
end
w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. "EU)")
w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. " EU)")
-- w.writeLn("")
w.setColorNormal();
@ -243,9 +243,9 @@ function lhc_page()
else
w.setColorDisabled();
end
w.write(string.format("%fK", math.floor(temperatureCurrent_K * 10) / 10))
w.write(string.format("%.1f K", math.floor(temperatureCurrent_K * 10) / 10))
w.setColorNormal();
w.writeLn(". Target is " .. temperatureTarget_K .. "K")
w.writeLn(". Target is " .. temperatureTarget_K .. " K")
-- w.writeLn("")
w.write("Parameters: ")