Alkerss

Untitled

Jun 17th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.86 KB | None | 0 0
  1. --------------------------------------------------------------------------------------------------------------------------------
  2. --[[------------ Descriptions of function calls --------------------------------------------------------------------------------
  3. WiP
  4. --]]
  5. --------------------------------------------------------------------------------------------------------------------------------
  6. ---------------- Dependencies --------------------------------------------------------------------------------------------------
  7. -- Name Section:
  8. -- Declare the name library will use. Leave it alone and
  9. local Lib = {}
  10. Init = Lib
  11.  
  12. -- Import Section:
  13. -- declare everything this library needs from outside
  14. -- FYI You can change or shorten names if you wish so.
  15.  
  16. ---- Luaj unmodified libraries. Import only needed sub-functions.
  17. -- Full list (functions): assert, collectgarbage, error, _G, ipairs, load, loadstring, next, pcall, rawequal, rawget, rawset, select, setfenv, setmetatable, tonumber, tostring, unpack, _VERSION, xpcall, require, module
  18. -- Full list (tables): coroutine, package, table, math
  19. -- local
  20. local coroutine = coroutine
  21. local read = io.read
  22.  
  23. ---- CC libraries. Import only needed sub-functions.
  24. -- Full list (modified Luaj functions): getfenv, getmetatable, loadfile, dofile, print, type, string.sub, string.find, write
  25. -- Full list (modified Luaj tables): string, os, io
  26. -- Full list (new tables): os, colors, disk, gps, help, keys, paintutils, parallel, peripheral, rednet, term, textutils, turtle, vector, window
  27. -- local
  28. -- local
  29. local write = write
  30.  
  31. ---- TuCoWa libraries. Import only needed sub-functions.
  32. -- Full list: Gui, Rui, Hud, Logger, Stats, Comm, Utils, Nav, Jobs, Resm, Logic, Init
  33. local Gui, Rui, Hud, Logger, Stats, Comm, Utils, Nav, Jobs, Resm, Logic = Gui, Rui, Hud, Logger, Stats, Comm, Utils, Nav, Jobs, Resm, Logic
  34.  
  35. -- DEBUG only. Sets access to all functions.
  36. setmetatable(Lib, { __index = _G } )
  37.  
  38. -- no more external access after this point.
  39. setfenv(1, Lib)
  40.  
  41. --------------------------------------------------------------------------------------------------------------------------------
  42. ---------------- Library wide variables ----------------------------------------------------------------------------------------
  43.  
  44. -- none
  45.  
  46. --------------------------------------------------------------------------------------------------------------------------------
  47. ---------------- Classes -------------------------------------------------------------------------------------------------------
  48.  
  49. -- none
  50.  
  51. --------------------------------------------------------------------------------------------------------------------------------
  52. ---------------- Public functions ----------------------------------------------------------------------------------------------
  53.  
  54. function Start ()
  55.         Nav.UpdateMap({0,0,0},false)
  56.         coroutine.yield("_Call",Logger.Info,{"In"})
  57.         coroutine.yield("_Call",PlayerRun)
  58.         write("itialized!\n")
  59. end
  60.  
  61. function PlayerRun()
  62.         --Utils.Refuel()
  63.         Logger.Info("\n# ")
  64.         str = read()
  65.         ch = loadstring(str)
  66.         print(pcall(ch))
  67.        
  68.         pos = Nav.GetPos()
  69.         Logger.Info(" Coords: (%s,%s,%s), F:%s\n",Nav.GetPos("x"),Nav.GetPos("z"),Nav.GetPos("y"),Nav.GetPos("f"))
  70.         coroutine.yield("_Call",PlayerRun)
  71. end
  72.  
  73. --------------------------------------------------------------------------------------------------------------------------------
  74. ---------------- Private functions ---------------------------------------------------------------------------------------------
  75.  
  76. -- none
  77.  
  78. --------------------------------------------------------------------------------------------------------------------------------
  79. ---------------- Details & Notes -----------------------------------------------------------------------------------------------
  80.  
  81. -- none
Advertisement
Add Comment
Please, Sign In to add comment