SHARE
TWEET

Untitled

a guest Apr 20th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------------------------------------------------------------------------------
  2. -- Status recording library for computercraft's scripts by Hea3veN
  3. -- Version 0.1
  4. ------------------------------------------------------------------------------
  5.  
  6. loadfile("lib/serialize.lua")()
  7.  
  8. status = nil
  9.  
  10. function statusLoad()
  11.     status = unserialize('status')
  12.     if status == nil or status.prog == nil then
  13.         return false
  14.     end
  15.     if status.progData == nil then
  16.         status.progData = {}
  17.     end
  18.     return status
  19. end
  20.  
  21. function statusInit(prog)
  22.     status = {prog=prog, progData={}}
  23.     statusSave()
  24. end
  25.  
  26. function statusEnd()
  27.     status.prog = nil
  28.     status.progData = {}
  29.     statusSave()
  30. end
  31.  
  32. function statusSave()
  33.     serialize(status, 'status')
  34. end
  35.  
  36. function statusSetProgData(data)
  37.     status.progData = data
  38. end
  39.  
  40. function statusGetProg()
  41.     return status.prog
  42. end
  43.  
  44. function statusGetProgData()
  45.     return status.progData
  46. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top