Advertisement
vittoema96

CyberAPIBasic

Jan 28th, 2022 (edited)
620
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 get qJSSf0qg startup --
  14. -- then restart the device.      --
  15. -----------------------------------
  16.  
  17. -----------------------------------
  18. --     BASIC COMPUTER API        --
  19. -- It handles the specific tasks --
  20. -- for the Basic Computer.       --
  21. -----------------------------------
  22.  
  23.  
  24. class = {}
  25. class.__index = class
  26. setmetatable(class, {__index = CyberAPIBW.class})
  27.  
  28. function class:new(shell)
  29.     local self = CyberAPIBW.class:new(shell)
  30.     setmetatable(self, class)
  31.    
  32.     return self
  33. end
  34.  
  35. function class:drawIcons(icons)
  36.     for i, name in ipairs(icons) do
  37.         if i<15 then
  38.             img = loadImageTheme("App"..name)
  39.             paintutils.drawImage(img,3+10*((i-1)%5),4+math.floor((i-1)/5)*6)
  40.             CyberAPI.blit(name, "0", "f",3+10*((i-1)%5)+math.floor((7-string.len(name))/2), 8+math.floor((i-1)/5)*6)
  41.         end
  42.     end
  43. end
  44.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement