wasliebob

api

Jul 8th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function drawString(mon, str, x, y)
  2. mon.setCursorPos(x, y)
  3.  
  4. mon.write(str)
  5. end
  6.  
  7. function drawStringWithColor(mon, str, x, y, col)
  8. mon.setCursorPos(x, y)
  9.  
  10. mon.setTextColor(col)
  11. mon.write(str)
  12. end
  13.  
  14. function getPercent(amount, capacity)
  15. return amount / 100 * capacity
  16. end
  17.  
  18. function round(num, idp)
  19. mult = 10 ^ (idp or 0)
  20.  
  21. return math.floor(num * mult + 0.5) / mult
  22. end
Advertisement
Add Comment
Please, Sign In to add comment