Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ctrlRod,power,fuel,tempCore,tempCase
- fileName="test1.csv"
- file=fs.open(fileName,"w")
- file.writeLine("speed,power")
- file.writeLine("rpm,fe/t")
- file.close()
- powerProd,speed=0,0
- reactor = peripheral.wrap("back")
- function saveData()
- file=fs.open(fileName,fs.exists(fileName) and "a" or "w")
- print(string.format("%d ,%d",speed,powerProd))
- file.writeLine(string.format("%d ,%d",speed,powerProd))
- file.close()
- end
- function measure()
- points = 0
- powerProd,fuelRate=0,0
- while points < 4 do
- points = points + 1
- powerProd = powerProd+reactor.getEnergyProducedLastTick()
- speed = speed+reactor.getRotorSpeed()
- sleep(0.25)
- end
- powerProd = powerProd/points
- speed = speed/points
- end
- sleep(10)
- print("starting")
- t = 0
- while t < 1800 do
- measure()
- saveData()
- t = t + 1
- print(string.format("point %d/1800 %.1f percent",t,t/18))
- end
- print("done")
- reactor.setActive(false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement