Advertisement
Marlingaming

CC Tweaked CCSPS Iron - Shortcut Creator

Jan 25th, 2022 (edited)
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. local tArg = {...}
  2. local Name = tArg[1]
  3. local File = tArg[2]
  4. local Image = tArg[3]
  5. local x = 1
  6. local y = 1
  7. local w, h = term.getSize()
  8. local Items = fs.list("os/System/Saved/Shortcuts")
  9. y = #Items / 5
  10. x = #Items - (y * 5)
  11. if #Items < 6 then
  12. y = 1
  13. x = #Items
  14. end
  15. x = x * (w / 5)
  16. y = (y * 6) - 3
  17.  
  18. if Image == "blank" then
  19. Image = "os/System/Defaults/Images/BlankShortcut"
  20. end
  21.  
  22. local Short = fs.open(fs.combine("os/System/Saved/Shortcuts",Name),"w")
  23. Short.writeLine(Name)
  24. Short.writeLine(File)
  25. Short.writeLine(Image)
  26. Short.writeLine(x)
  27. Short.writeLine(y)
  28. Short.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement