PasaP

Direwolf Shop PocA

Jan 25th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wrapPs(peripheralName)
  2. periTab={}
  3. sideTab={}
  4. if peripheralName==nil then
  5. print("Fehler")
  6. end
  7. local peripherals = peripheral.getNames()
  8. local i2 = 1
  9. for i =1, #peripherals do
  10. if peripheral.getType(peripherals[i])==peripheralName then
  11. sideTab[i2]=peripherals[i]
  12. i2=i2+1
  13. end
  14. end
  15. if periTab~={} then
  16. return sideTab
  17. else
  18. return nil
  19. end
  20. end
  21.  
  22. frequencyRight=false
  23.  
  24. print("Hallo, mein Name ist PocA\n(Programm ohne cooles Acronym)")
  25.  
  26. echests=wrapPs("ender_chest")
  27. if echests[1]~=nil then
  28.  p=peripheral.wrap(echests[1])
  29.  print("\n\nEnder Chest erkannt")
  30. else
  31.  print("\n\nEs wurde keine Ender Chest erkannt\nBitte setze eine Ender Chest an den Computer und druecke ENTER")
  32.  io.read()
  33.  os.reboot()
  34. end
  35.  
  36. print("\n\nBitte gib deine Abholnummer ein und druecke ENTER")
  37.  
  38. while frequencyRight==false do
  39.  term.setCursorPos(1,18)
  40.  frequency=io.read()
  41.  term.setCursorPos(1,18)
  42.  term.clearLine()
  43.  if tonumber(frequency)==nil or tonumber(frequency)<0 or tonumber(frequency)>=4096 then
  44.   term.setCursorPos(1,9)
  45.   term.clearLine()
  46.   sleep(0.3)
  47.   print("ERROR - nicht gueltige Abholnummer")
  48.  else
  49.  p.setFrequency(frequency)
  50.   term.setCursorPos(1,9)
  51.   term.clearLine()
  52.   term.setCursorPos(1,8)
  53.   term.clearLine()
  54.   print("Bitte lege jetzt die Bezahlung in die Ender Chest. Sollte der Handel nicht ausgefuehrt werden, gehe einmal kurz in die Shopwelt(/warp shop), damit die Chunks des Shops geladen werden")
  55.   frequencyRight=true
  56.  end
  57. end
  58.  
  59. sleep(6000)
Add Comment
Please, Sign In to add comment