Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --##################--
- -- Programm von Sr_endi
- -- https://pastebin.com/u/endminecraffter
- -- Server: MyFTB.de Deutsches Minecraft modded Netzwerk
- -- Benoetigte Mods/Apis: Mod AppliedEnergistics 2 ,
- -- Mon Size:
- --##################--
- function wrapPs(peripheralName)
- periTab={}
- sideTab={}
- if peripheralName==nil then
- print("Fehler")
- end
- local peripherals = peripheral.getNames()
- local i2 = 1
- for i =1, #peripherals do
- if peripheral.getType(peripherals[i])==peripheralName then
- periTab[i2]=peripheral.wrap(peripherals[i])
- sideTab[i2]=peripherals[i]
- i2=i2+1
- end
- end
- if periTab~={} then
- return periTab,sideTab
- else
- return nil
- end
- end
- label = "endAutomaticAutocraft"
- me = wrapPs("tileinterface")[1] --Me interface
- mon = wrapPs("monitor")[1]
- meItems = {
- [1] = {"Draconic Core","DraconicEvolution:draconicCore","0","1280"}, -- Name, id, damagemeta, minanzahl
- }
- function checkMe(checkName, name, low)
- melist = me.getAvailableItems()
- for a = 1, #melist do
- itemName = melist[a].fingerprint.id .. melist[a].fingerprint.dmg
- size = tostring(melist[a].size)
- iteminfo = {
- id = melist[a].fingerprint.id,
- dmg = melist[a].fingerprint.dmg
- }
- if itemName == checkName then
- row = row+1
- CenterT(name ,row+1, colors.black, colors.lightGray,"left")
- if tonumber(size) <= tonumber(low)-1 then
- CenterT(size ,row+1, colors.black, colors.red,"right")
- me.requestCrafting(iteminfo,low-size)
- else
- CenterT(size ,row+1, colors.black, colors.green,"right")
- end
- end
- end
- end
- function checkTable()
- row = 1
- clearScreen()
- for i = 1, #meItems do
- checkName = meItems[i][2] .. meItems[i][3]
- name = meItems[i][1]
- low = meItems[i][4]
- checkMe(checkName, name, low)
- end
- end
- function clearScreen()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(1,1)
- CenterT("endAutomaticAutocraft" ,1, colors.black, colors.white,"head")
- end
- function CenterT(text, line, txtback , txtcolor, pos)
- monX,monY = mon.getSize()
- mon.setBackgroundColor(txtback)
- mon.setTextColor(txtcolor)
- length = string.len(text)
- dif = math.floor(monX-length)
- x = math.floor(dif/2)
- if pos == "head" then
- mon.setCursorPos(x+1, line)
- mon.write(text)
- elseif pos == "left" then
- mon.setCursorPos(2,line)
- mon.write(text)
- elseif pos == "right" then
- mon.setCursorPos(monX-length, line)
- mon.write(text)
- end
- end
- while true do
- checkTable()
- sleep(30)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement