Advertisement
Marlingaming

Pocket Maps Application

Apr 6th, 2022 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. local tArg = {...}
  2. local DataPath
  3.  
  4. local x, y, z = gps
  5. local w, h = term.getSize()
  6.  
  7. local Locations = {}
  8. local Zoom = 0.2
  9.  
  10. local Nodes = {}
  11.  
  12. function GetData()
  13. local file = fs.open(DataPath,"r")
  14. Nodes = textutils.unserialize(file.readAll())
  15. end
  16.  
  17. function DrawUI()
  18. Text("UI1","N",w/2,1)
  19. Text("UI2","S",w/2,h)
  20. Text("UI3","W",1,h/2)
  21. Text("UI4","E",w,h/2)
  22. end
  23.  
  24. function DrawLocations()
  25. for i = 1, #Locations do
  26. paintutils.drawPixel(Locations[i][2] * Zoom, Locations[i][3] * Zoom, colors.red)
  27. end
  28. end
  29.  
  30. function Text(id,text,x,y)
  31. os.queueEvent("application_task","create_text",id,text,x,y)
  32. end
  33.  
  34. if tArg[1] == "start" then
  35. os.queueEvent("application_task","clearEntities")
  36. DrawUI()
  37. DrawLocations()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement