View Single Post
05-19-16, 11:40 AM   #32
ykiigor
A Murloc Raider
Join Date: Jun 2014
Posts: 9
Lua Code:
  1. -------------------------------------------------------------------
  2. -- Table library
  3. local tab = table
  4. foreach = tab.foreach
  5. foreachi = tab.foreachi
  6. getn = tab.getn
  7. tinsert = tab.insert
  8. tremove = tab.remove
  9. sort = tab.sort
  10. wipe = tab.wipe
  11.  
  12. -------------------------------------------------------------------
  13. -- math library
  14. local math = math
  15. abs = math.abs
  16. acos = function (x) return math.deg(math.acos(x)) end
  17. asin = function (x) return math.deg(math.asin(x)) end
  18. atan = function (x) return math.deg(math.atan(x)) end
  19. atan2 = function (x,y) return math.deg(math.atan2(x,y)) end
  20. ceil = math.ceil
  21. cos = function (x) return math.cos(math.rad(x)) end
  22. deg = math.deg
  23. exp = math.exp
  24. floor = math.floor
  25. frexp = math.frexp
  26. ldexp = math.ldexp
  27. log = math.log
  28. log10 = math.log10
  29. max = math.max
  30. min = math.min
  31. mod = math.fmod
  32. PI = math.pi
  33. --??? pow = math.pow
  34. rad = math.rad
  35. random = math.random
  36. sin = function (x) return math.sin(math.rad(x)) end
  37. sqrt = math.sqrt
  38. tan = function (x) return math.tan(math.rad(x)) end
  39.  
  40. -------------------------------------------------------------------
  41. -- string library
  42. local str = string
  43. strbyte = str.byte
  44. strchar = str.char
  45. strfind = str.find
  46. format = str.format
  47. gmatch = str.gmatch
  48. gsub = str.gsub
  49. strlen = str.len
  50. strlower = str.lower
  51. strmatch = str.match
  52. strrep = str.rep
  53. strrev = str.reverse
  54. strsub = str.sub
  55. strupper = str.upper
  56. -------------------------------------------------------------------
  57. -- Add custom string functions to the string table
  58. str.trim = strtrim
  59. str.split = strsplit
  60. str.join = strjoin