Advertisement
vittoema96

CyberOsHome

Jan 28th, 2022 (edited)
712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. -------------------------------------
  2. -- This program was designed for   --
  3. -- the Minecraft mod ComputerCraft --
  4. -------------------------------------
  5.  
  6. -----------------------------------
  7. --           WARNING             --
  8. -- This program is not meant to  --
  9. -- be downloaded.                --
  10. -- To install CyberOS on your    --
  11. -- ComputerCraft device just run --
  12. -- the following line on it:     --
  13. -- pastebin run qJSSf0qg         --
  14. -----------------------------------
  15.  
  16. -----------------------------------
  17. --        COMPUTER API           --
  18. -- This is the superclass of all --
  19. -- "Computer" devices.           --
  20. -- It handles all the common     --
  21. -- computer stuff (mainly        --
  22. -- computer-specific apps).      --
  23. -----------------------------------
  24.  
  25.  
  26. class = {}
  27. class.__index = class
  28. setmetatable(class, {__index = CyberOs.class})
  29.  
  30. function class:initDeviceApi()
  31.     print("Implement something in initDeviceApi")
  32. end
  33.  
  34. function class:drawIcons(icons)
  35.     for i, name in ipairs(icons) do
  36.         if i<15 then
  37.             img = loadImageTheme("App"..name)
  38.             paintutils.drawImage(img,3+10*((i-1)%5),4+math.floor((i-1)/5)*6)
  39.             CyberAPI.blit(name, "0", "f",3+10*((i-1)%5)+math.floor((7-string.len(name))/2), 8+math.floor((i-1)/5)*6)
  40.         end
  41.     end
  42. end
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement