Advertisement
aka_zaratustra

setInterfacePattern

May 16th, 2021
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. local component = require "component"
  2. local iface = component.me_interface -- interface with a pattern in the first slot
  3. --print (iface)
  4. --local c = component.get("c8db", "database")
  5.  
  6. local guid = nil
  7. for k, v in component.list() do
  8.   if v == 'database' then
  9.     guid = k
  10.   end
  11. end
  12. print("Адрес базы данных:"..guid)
  13.  
  14. --local c = component.database
  15. --print (c)
  16. local d = component.proxy(guid) or error("database not found")
  17. local database = d.address
  18. iface.setInterfacePatternInput(1, database, 1, 64, 1)
  19. iface.setInterfacePatternOutput(1, database, 2, 64, 1)
  20. iface.setInterfacePatternOutput(1, database, 2, 64, 2)
  21. iface.setInterfacePatternOutput(1, database, 2, 64, 3)
  22. iface.setInterfacePatternOutput(1, database, 2, 64, 4)
  23. print("Перепрошивка паттерна завершена.")
  24.  
  25.  
  26.  
  27.  
  28. -- setInterfacePatternInput(slot:number, database:address, entry:number, size:number, index:number)
  29.  
  30. -- slot:number       Номер/позиция паттерна в интерфейсе
  31. -- database:address  Адрес в мире
  32. -- entry:number      Номер слота в датабейсе, откуда взять итем
  33. -- size:number       сколько итемов нужно установить в паттерн
  34. -- index:number      позиция в паттерне в которую будет установлен новый итем
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement