Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alpha = color.new(0,0,0,0)
- blue = color.new(0,0,255)
- green = color.new(0,255,0)
- red = color.new(255,0,0)
- white = color.new(255,255,255)
- yellow = color.new(155,155,0)
- pink = color.new(255,192,203)
- black = color.new(0,0,0)
- gold= color.new(255,215,0)
- orange = color.new(255,160,0)
- alphawhite = color.new(255,255,255,124)
- function batteryandtime()
- if batt.exists() then
- if batt.charging() and tiempo:time() >= 500 and tiempo:time() <= 1000 then
- if batt.percent() >0 and batt.percent() <=25 then
- draw.fillrect(300+115, 2,math.ceil((batt.percent()*14)/100), 9,red)
- elseif batt.percent() >25 and batt.percent() <=50 then
- draw.fillrect(300+115, 2,math.ceil((batt.percent()*14)/100), 9,orange)
- elseif batt.percent() >50 and batt.percent() <=75 then
- draw.fillrect(300+115, 2,math.ceil((batt.percent()*14)/100), 9,yellow)
- elseif batt.percent() >75 and batt.percent() <=100 then
- draw.fillrect(300+115, 3,14,7,green)
- end
- draw.line(300+114, 2, 315+114, 2,white)
- draw.line(300+114, 10, 315+114, 10,white)
- draw.line(300+114, 2, 300+114, 10,white)
- draw.line(316+114, 4, 316+114, 8,white)
- draw.line(315+114, 2, 315+114, 11,white)
- draw.line(315+114, 4, 317+114, 4,white)
- draw.line(315+114, 8, 317+114, 8,white)
- draw.line(317+114, 4, 317+114, 9,white)
- elseif batt.charging()==false then
- if batt.percent() >0 and batt.percent() <=25 then
- draw.fillrect(300+115, 2,math.ceil(math.ceil(batt.percent()/14)), 9,red)
- elseif batt.percent() >25 and batt.percent() <=50 then
- draw.fillrect(300+115, 2,math.ceil((batt.percent()*14)/100), 9,orange)
- elseif batt.percent() >50 and batt.percent() <=75 then
- draw.fillrect(300+115, 2,math.ceil((batt.percent()*14)/100), 9,yellow)
- elseif batt.percent() >75 and batt.percent() <=100 then
- draw.fillrect(300+115, 3,14,7,green)
- end
- draw.line(300+114, 2, 315+114, 2,white)
- draw.line(300+114, 10, 315+114, 10,white)
- draw.line(300+114, 2, 300+114, 10,white)
- draw.line(316+114, 4, 316+114, 8,white)
- draw.line(315+114, 2, 315+114, 11,white)
- draw.line(315+114, 4, 317+114, 4,white)
- draw.line(315+114, 8, 317+114, 8,white)
- draw.line(317+114, 4, 317+114, 9,white)
- end
- else
- draw.fillrect(300+115, 3,14,7,blue)
- draw.line(300+114, 2, 315+114, 2,white)
- draw.line(300+114, 10, 315+114, 10,white)
- draw.line(300+114, 2, 300+114, 10,white)
- draw.line(316+114, 4, 316+114, 8,white)
- draw.line(315+114, 2, 315+114, 11,white)
- draw.line(315+114, 4, 317+114, 4,white)
- draw.line(315+114, 8, 317+114, 8,white)
- draw.line(317+114, 4, 317+114, 9,white)
- end
- if batt.exists() then
- screen.print(319+115,2,batt.percent().."%",size,white,alpha)
- end
- screen.print(290,2,os.date("%x"),size,white,alpha)
- screen.print(290+screen.textwidth(os.date("%x").." "),2,os.date("%H"),size,white,alpha)
- screen.print(290+screen.textwidth(os.date("%x").." "..os.date("%H")..":"),2,os.date("%M"),size,white,alpha)
- if tiempo:time() >= 500 and tiempo:time() <= 1000 then
- screen.print(290+screen.textwidth(os.date("%x").." "..os.date("%H")),2,":",size,white,alpha)
- elseif tiempo:time() >= 1000 then tiempo:reset()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement