Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.find("monitor")
- local mod = peripheral.find("modem")
- --term.blit("Hello, world!","01234456789ab","0000000000000")
- term.redirect(mon)
- --mon.setTextColor(colors.white)
- mod.open(0)
- mon.setTextColor(colors.black)
- mon.setBackgroundColor( colors.black )
- mon.clear()
- mon.setCursorPos(1,24)
- mon.setTextScale(0.5)
- mon.setBackgroundColor( colors.cyan )
- mon.clearLine()
- local function centerTextX(text)
- local w,h = term.getSize()
- term.setCursorPos(math.floor(w/2-text:len()/2+.5), 24)
- io.write(text)
- end
- local function centerTextBy(text)
- local w,h = term.getSize()
- term.setCursorPos(math.floor(w/2-text:len()/2+.5), h)
- io.write(text)
- end
- centerTextX("computer ID: "..os.getComputerID().."\n")
- --print(modem.isOpen(0))
- -- for k,v in pairs(modem) do
- -- monitor.setTextColor(colors.yellow)
- -- print(k,v)
- -- end
- -- for k,v in pairs(r) do
- -- print(k,v)
- -- end
- --for k,v in pairs(r.tags) do
- -- print(k,v)
- --end
- --for k,v in pairs(r.state) do
- -- print(k,v)
- --end
- local w,h = term.getSize()
- mon.setTextColor(colors.gray)
- write ("\ntaille du monitor: ")
- mon.setTextColor(colors.yellow)
- print ("L x".. w .." : H x".. h)
- mon.setTextColor(colors.orange)
- print("modem ouvert")
- local blocks = {
- ["minecraft:ancient_debris"] = { colour = colours.brown, name = "ancien debris" },
- ["allthemodium:vibranium_ore"] = { colour = colors.green, name = "vibranium" },
- ["tconstruct:cobalt_ore"] = { colour = colors.blue, name = "cobalt" },
- ["allthemodium:allthemodium_ore"] = { colour = colors.orange, name = "allthemodium" },
- ["allthemodium:unobtainium_ore"] = { colour = colors.purple, name = "unobtainium" },
- }
- local function inspect()
- local _,r = turtle.inspect()
- mon.setTextColor(colors.white)
- print("j'inspect le block")
- sleep(2)
- if r and blocks[r.name] then
- mon.setTextColour(blocks[r.name].colour)
- print("> " .. blocks[r.name].name)
- else
- mon.setTextColor(colors.red)
- print("pas de block")
- end
- end
- -- function inspect()
- -- local _,r = turtle.inspect()
- -- print("j'inspect le block")
- -- sleep(2)
- -- if r.name == "minecraft:ancient_debris" then
- -- mon.setTextColor(colors.brown)
- -- print("> ".. "ancien debris")
- -- elseif r.name == "allthemodium:vibranium_ore" then
- -- mon.setTextColor(colors.green)
- -- print("> ".. "vibranium")
- -- elseif r.name == "tconstruct:cobalt_ore" then
- -- mon.setTextColor(colors.blue)
- -- print("> ".. "cobalt")
- -- elseif r.name == "allthemodium:allthemodium_ore" then
- -- mon.setTextColor(colors.orange)
- -- print("> ".. "allthemodium")
- -- elseif r.name == "allthemodium:unobtainium_ore" then
- -- mon.setTextColor(colors.purple)
- -- print("> ".. "unobtainium")
- -- else
- -- mon.setTextColor(colors.red)
- -- print("pas de block")
- -- end
- -- mon.setTextColor(colors.white)
- -- end
- local premierSlot = 1
- local dernierSlot = 16
- function scan()
- local items ={}
- for i = premierSlot,dernierSlot do
- local data = turtle.getItemDetail(i)
- if data then
- items[i]={name=data.name,count=data.count}
- --print(data.name .. " x" .. data.count) -- pour verifier les noms
- if data.name == "allthemodium:allthemodium_ore" then
- name1 = "allthemodium x" .. data.count
- elseif data.name == "allthemodium:vibranium_ore" then
- name2 = "vibranium x" .. data.count
- elseif data.name == "allthemodium:unobtainium_ore" then
- name3 = "unobtainium x" .. data.count
- elseif data.name == "minecraft:ancient_debris" then
- name4 = "ancient debris x" .. data.count
- elseif data.name == "tconstruct:cobalt_ore" then
- name5 = "cobalt x" .. data.count
- end
- end
- end
- end
- mon.setCursorPos(1,24)
- mon.setBackgroundColor( colors.black )
- mon.setTextColor(colors.yellow)
- mon.clearLine()
- print("--------------------")
- for i = 1, 4 do
- inspect()
- turtle.turnRight()
- end
- sleep(1)
- mon.setTextColor(colors.yellow)
- mon.setBackgroundColor( colors.gray )
- mon.clearLine()
- print("--------------------")
- mon.setTextColor(colors.lime)
- --print("")
- print("Dans mon inventaire j'ai :")
- mon.setTextColor(colors.white)
- -- mon.setBackgroundColor( colors.gray )
- -- mon.clearLine()
- scan()
- print(name1)
- print(name2)
- print(name3)
- print(name4)
- print(name5)
- mon.setTextColor(colors.yellow)
- -- mon.setBackgroundColor( colors.black )
- -- mon.clearLine()
- --print("")
- print("--------------------")
- mon.setBackgroundColor( colors.cyan )
- mon.clearLine()
- mod.close(0)
- mon.setTextColor(colors.orange)
- print("modem fermer")
- --mon.setTextColor(colors.white)
- ---print(modem.isOpen(0))
- print("")
- mon.setTextColor(colors.black)
- centerTextBy("By Vodka")
Add Comment
Please, Sign In to add comment