Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variablen
- redstone.setOutput("bottom", false)
- os.loadAPI("ocs/apis/sensor")
- senP = sensor.wrap("right")
- senI = sensor.wrap("left")
- bcol = colors.white
- tcol = colors.white
- tbcol = colors.black
- bcolagb = colors.black
- tcolagb = colors.white
- monSide = "back"
- agb = false
- anzeigeuu = 0
- mon = peripheral.wrap(monSide)
- xMax,yMax = mon.getSize()
- -- Funktionen
- function screen()
- mon.setBackgroundColor(bcol)
- for i=1,yMax do
- mon.setCursorPos(1,i)
- for j=1,xMax do
- mon.write(" ")
- end
- end
- end
- function AGB()
- mon.setBackgroundColor(bcolagb)
- for i=4,15 do
- mon.setCursorPos(1,i)
- for j=1,xMax do
- mon.write(" ")
- end
- end
- -- AGB Text
- mon.setTextColor(tcolagb)
- mon.setCursorPos(1,5)
- mon.write("Allgemeine Geschäftsbedinungen:")
- mon.setCursorPos(1,7)
- mon.write("blablabla")
- mon.setCursorPos(1,13)
- mon.write("Um zu bestätigen klicke auf den Bildschirm")
- mon.setCursorPos(1,15)
- mon.write("lg bla bla")
- end
- function start()
- mon.clear()
- screen()
- AGB()
- end
- function Bclear()
- mon.clear()
- screen()
- end
- start()
- event,side,xPos,yPos = os.pullEvent("monitor_touch")
- if event == "monitor_touch" then
- agb = true
- end
- function h()
- while false do
- mon.setCursorPos(1,1)
- for i=1,xMax do
- mon.setBackgroundColor(tbcol)
- mon.write(" ")
- end
- t = textutils.formatTime(os.time())
- mon.setCursorPos(1,1)
- mon.setTextColor(tcol)
- mon.setBackgroundColor(tbcol)
- mon.write("Jobcenter")
- mon.setCursorPos((xMax-#t)+1,1)
- mon.write(t)
- sleep(0.8)
- end
- end
- function main()
- Bclear()
- player = " "
- playerp = " "
- while true do
- proximity = sensor.wrap("right")
- targets = proximity.getTargets()
- for k,v in pairs(targets) do
- if v.Name == "Player"
- and v.Position.X<=3 and v.Position.X>=-3
- and v.Position.Z<=9 and v.Position.Z>=3
- and v.Position.Y>=-3 and v.Position.Y<=4
- then
- player = k
- mon.setCursorPos(3,5)
- mon.setBackgroundColor(colors.black)
- mon.write(" ")
- mon.setCursorPos(3,5)
- mon.write("Willkommen "..player.." ")
- mon.setCursorPos(3,6)
- mon.setBackgroundColor(colors.black)
- mon.write("Du befindest dich im Hauptmenue des Jobcenters")
- mon.setCursorPos(3,8)
- mon.setBackgroundColor(colors.red)
- mon.write("o")
- mon.setCursorPos(5,8)
- mon.setBackgroundColor(colors.black)
- mon.write("Angebot schreiben")
- event,side,xPost,yPost = os.pullEvent("monitor_touch")
- if xPost == 3 and yPost == 8 then
- screen()
- mon.setCursorPos(3,5)
- mon.setTextColor(colors.black)
- mon.write("Kategorie angeben: ")
- mon.setCursorPos(3,8)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("o")
- mon.setCursorPos(5,8)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.green)
- mon.write("Terraforming")
- mon.setCursorPos(3,10)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("o")
- mon.setCursorPos(5,10)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.brown)
- mon.write("Crafting")
- mon.setCursorPos(3,12)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("o")
- mon.setCursorPos(5,12)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.cyan)
- mon.write("Gestaltung")
- kategorie = true
- Beschreibung = true
- katwaehlen = false
- end
- while kategorie do
- event,side,xPost,yPost = os.pullEvent("monitor_touch")
- if xPost == 3 and yPost == 8 then
- kategorie = false
- kat = "Terraforming"
- screen()
- katwaehlen = true
- end
- if xPost == 3 and yPost == 10 then
- kategorie = false
- kat = "Crafting"
- screen()
- katwaehlen = true
- end
- if xPost == 3 and yPost == 12 then
- kategorie = false
- kat = "Gestaltung"
- screen()
- katwaehlen = true
- end
- end
- if katwaehlen == true then
- mon.setCursorPos(2,3)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("Kategorie: ")
- mon.setCursorPos(13,3)
- mon.setTextColor(colors.cyan)
- mon.write(kat)
- mon.setCursorPos(2,6)
- mon.setTextColor(colors.black)
- mon.write("Nun gebe im unteren Computer eine Beschreibung")
- mon.setCursorPos(2,7)
- mon.write("an, was genau getan werden soll.")
- while Beschreibung do
- rednet.open("front")
- rednet.send(8949,"Tastatur start")
- id,message = rednet.receive()
- print(id)
- print(message)
- if id == 8949 and message == "Tastatur stopp" then
- id,message = rednet.receive()
- if id == 8949 and message == "Nachricht wird übermittelt" then
- id,message = rednet.receive()
- if id == 8949 then
- str = message
- print(message)
- id,message = rednet.receive()
- if id == 8949 and message == "Nachricht wurde übermittelt" then
- mon.setTextColor(colors.black)
- mon.setBackgroundColor(colors.white)
- mon.setCursorPos(5,2)
- mon.write("Beschreibung wurde erfolgreich gespeichert!")
- sleep(5)
- screen()
- mon.setBackgroundColor(colors.black)
- for i=5,yMax-3 do
- for j=3,xMax-2 do
- mon.setCursorPos(j,i)
- mon.write(" ")
- end
- end
- end
- mon.setCursorPos(2,3)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("Kategorie: ")
- mon.setCursorPos(2,4)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("Beschreibung: ")
- mon.setCursorPos(13,3)
- mon.setTextColor(colors.cyan)
- mon.write(kat)
- pos = 1
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- abbruch = false
- xPos=3
- yPos=5
- mon.setCursorPos(xPos,yPos)
- while true do
- stelleA = string.find(str,"<",pos,true)
- if stelleA == nil then
- substr = string.sub(str,pos)
- else
- substr = string.sub(str,pos,stelleA-1)
- end
- mon.write(substr)
- if abbruch==true then
- break
- end
- stelleE = string.find(str,">",pos)
- if stelleE then
- col = string.sub(str,stelleA+1,stelleE-1)
- else
- abbruch = true
- end
- if not string.match(col,"[a-zA-Z]+") then
- mon.setTextColor(tonumber(col))
- elseif col == "E" then
- yPos = yPos+1
- mon.setCursorPos(xPos,yPos)
- end
- print(col)
- if stelleE then
- pos = stelleE+1
- end
- sleep(0.1)
- end
- while true do
- mon.setCursorPos(3,17)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("Lohn fuer den Spieler in Form von ")
- mon.setTextColor(colors.pink)
- mon.write("UU")
- mon.setCursorPos(3,18)
- mon.setTextColor(colors.black)
- mon.write("in die Diamanttruhe legen")
- mon.setCursorPos(3,19)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("o")
- mon.setCursorPos(5,19)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.cyan)
- mon.write("Angebot abgeben")
- event,side,xPost,yPost = os.pullEvent("monitor_touch")
- if xPost == 3 and yPost == 19 then
- mon.setCursorPos(3,19)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.red)
- mon.write("Truhe wird abgepumpt! ")
- for i = 1,108 do
- redstone.setOutput("bottom", true)
- sleep(0.1)
- redstone.setOutput("bottom", false)
- end
- break
- end
- end
- while true do
- menge = 0
- anzeigeuu = 0
- sleep(2)
- zieleinv = senI.getTargets()
- for k,v in pairs(zieleinv) do
- if v.Name == "Diamond Chest"
- and v.Position.X==-5
- and v.Position.Y==-1
- and v.Position.Z==-2
- then
- print("Chest detected")
- details = senI.getTargetDetails(k)
- for i = 1,108 do
- if details.Slots[i].Name == "UU-Matter" then
- menge = details.Slots[i].Size
- anzeigeuu = anzeigeuu+menge
- for j = 17,20 do
- for g = 1,xMax do
- mon.setBackgroundColor(colors.white)
- mon.setCursorPos(g,j)
- mon.write(" ")
- end
- end
- mon.setCursorPos(3,18)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("Lohn: ")
- mon.setTextColor(colors.pink)
- mon.write(anzeigeuu.." UU")
- end
- end
- end
- end
- end
- end
- end
- end
- sleep(10)
- end
- sleep(1)
- end
- end
- end
- end
- end
- parallel.waitForAll(main,h)
Advertisement
Add Comment
Please, Sign In to add comment