Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Tick function that will be executed every logic tick
- function onTick()
- fuel = input.getNumber(1)
- batt = input.getNumber(2)
- rps = input.getNumber(3)
- tmp = input.getNumber(4)
- thr = input.getNumber(5)
- end
- -- Draw function that will be executed when this script renders to a screen
- function onDraw()
- w = screen.getWidth() -- Get the screen's width and height
- h = screen.getHeight()
- screen.setColor(169, 169, 169)
- screen.drawClear()
- screen.setColor(0, 0, 0)
- screen.drawRectF(2, 2, 60, 60)
- screen.setColor(255, 255, 0)
- screen.drawTextBox(5, 15, w, 6, "Fuel:", -1, 0)
- screen.drawTextBox(5, 22, w, 6, "Battery:", -1, 0)
- screen.drawTextBox(5, 29, w, 6, "RPS:", -1, 0)
- screen.drawTextBox(5, 36, w, 6, "Eng Temp:", -1, 0)
- screen.drawTextBox(47, 15, w - 6, 6, string.format("%.1f", fuel), -1, 0)
- screen.drawTextBox(47, 22, w - 6, 6, string.format("%.1f", batt), -1, 0)
- screen.drawTextBox(49, 29, w - 6, 6, string.format("%.0f", rps), -1, 0)
- screen.drawTextBox(49, 36, w - 6, 6, string.format("%.0f", tmp), -1, 0)
- if tmp > 94 then
- screen.setColor(255, 0, 0)
- screen.drawText(18, 3, "Danger!")
- screen.drawText(3, 10, "High Temp!")
- end
- if thr < 0.1 then
- one()
- elseif thr > 0.1 and thr < 0.2 then
- one()
- two()
- elseif thr > 0.2 and thr < 0.3 then
- one()
- two()
- three()
- elseif thr > 0.3 and thr < 0.4 then
- one()
- two()
- three()
- four()
- elseif thr > 0.4 and thr < 0.5 then
- one()
- two()
- three()
- four()
- five()
- elseif thr > 0.5 and thr < 0.6 then
- one()
- two()
- three()
- four()
- five()
- six()
- elseif thr > 0.6 and thr < 0.7 then
- one()
- two()
- three()
- four()
- five()
- six()
- seven()
- elseif thr > 0.7 and thr < 0.8 then
- one()
- two()
- three()
- four()
- five()
- six()
- seven()
- eight()
- elseif thr > 0.8 and thr < 0.9 then
- one()
- two()
- three()
- four()
- five()
- six()
- seven()
- eight()
- nine()
- elseif thr > 0.9 and thr < 1 then
- one()
- two()
- three()
- four()
- five()
- six()
- seven()
- eight()
- nine()
- ten()
- elseif thr == 1 then
- one()
- two()
- three()
- four()
- five()
- six()
- seven()
- eight()
- nine()
- ten()
- eleven()
- end
- end
- function one()
- screen.setColor(0, 255, 0)
- screen.drawRectF(12, 53, 4, 5)
- end
- function two()
- screen.setColor(0, 255, 0)
- screen.drawRectF(16, 53, 4, 5)
- end
- function three()
- screen.setColor(0, 255, 0)
- screen.drawRectF(20, 53, 4, 5)
- end
- function four()
- screen.setColor(0, 255, 0)
- screen.drawRectF(24, 53, 4, 5)
- end
- function five()
- screen.setColor(255, 255, 0)
- screen.drawRectF(28, 53, 4, 5)
- end
- function six()
- screen.setColor(255, 255, 0)
- screen.drawRectF(32, 53, 4, 5)
- end
- function seven()
- screen.setColor(255, 255, 0)
- screen.drawRectF(36, 53, 4, 5)
- end
- function eight()
- screen.setColor(255, 255, 0)
- screen.drawRectF(40, 53, 4, 5)
- end
- function nine()
- screen.setColor(255, 0, 0)
- screen.drawRectF(44, 53, 4, 5)
- end
- function ten()
- screen.setColor(255, 0, 0)
- screen.drawRectF(48, 53, 4, 5)
- end
- function eleven()
- screen.setColor(255, 0, 0)
- screen.drawRectF(52, 53, 4, 5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement