As suggested/challenged by lockheedmartin.
It's still early in development, so don't expect it to be good, mniip.
sensorX = 200
sensorY = 200
sensorFileStr = tpt.input("Sensor output file","This is the file the sensor will write all of its data to.")
local sFile = io.open(sensorFileStr,"w")
function drawSensor()
tpt.fillrect(4,367,63,12,255,255,255,255)
tpt.drawtext(7,370,"Take reading",0,0,0,255)
tpt.drawpixel(sensorX,sensorY,255,0,0,275)
tpt.drawtext(sensorX+2,sensorY,"Sensor",255,0,0,75)
end
function sensorMouseTest()
if tpt.mousex >= 4 and tpt.mousex <= 67 and tpt.mousey >= 367 and tpt.mousey <= 377 then
sTemp = tpt.get_property("temp",sensorX,sensorY)
sType = tpt.get_property("type",sensorX,sensorY)
sTime = os.date()
sFile:write(sTime .. ": Type: " .. sType .. ", Temp: " .. sTemp .. "\n")
end
end
function placeSensor(x,y)
sFile:close()
sensorX = x
sensorY = y
sFile = io.open(tpt.input("Sensor output file","This is the file the sensor will write all of its data to."),"w")
end
tpt.register_step(drawSensor)
tpt.register_mouseclick(sensorMouseTest)
Sorry for it not having any formatting or in a code box; my computer doesn't seem to like me.
@FeynmanLogoMaker, lol, from your recent posts it appears it's Feynman vs. mniip ;). By the way good job :D.
Thanks! (Although it's still a WIP)
...
Will you guys maybe make a separate thread for that? (Although it is sort of amusing.)