Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --INIT
- maxT=400
- --Scale Factor, 1 = no scale
- adjustVal=5
- --Range loop, finds range of TMPs on the screen from 400
- for i in sim.parts(i) do
- if sim.partProperty(i,"type")==17 and sim.partProperty(i,"tmp")>maxT then
- maxT=sim.partProperty(i,"tmp")
- end
- end
- --Range calculations
- range=(maxT-400)*adjustVal
- dsize=range/254
- --Set dcolour
- for i in sim.parts(i) do
- if sim.partProperty(i,"type")==17 then
- if sim.partProperty(i,"tmp")<=0 then
- color=0xFFFFFFFF
- else
- color=0xFF000000+((0x00010101)*(255-(math.floor((sim.partProperty(i,"tmp")-400)/dsize))))
- end
- sim.partProperty(i, "dcolour", color)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement