Advertisement
skyslayer415

Untitled

Jul 26th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. function clear()
  2. term.clear()
  3. term.setCurserPos(1,1)
  4. end
  5.  
  6. itemExtention = ".shop"
  7. priceExtention = ".pri"
  8. curencyExtention = ".ce"
  9. count = 1
  10.  
  11. function createListing(name, price, curencyUsed)
  12. file = io.open("listing"..count..itemExtention, "a")
  13. io.output(file)
  14. io.write(name)
  15. io.close
  16.  
  17. file = io.open("listing"..count..curencyExtention, "a")
  18. io.output(file)
  19. io.write(curencyUsed)
  20. io.close
  21.  
  22. file = io.open("listing"..count..priceExtention, "a")
  23. io.output(file)
  24. io.write(price)
  25. io.close
  26.  
  27. count = count + 1
  28. print("made listing for "..name)
  29. end
  30.  
  31. clear()
  32. print("how many listings would you like? ")
  33. amount = read()
  34.  
  35. for i = amount,1,-1 do
  36. print("listing name: ")
  37. name = read()
  38.  
  39. print("listing price: ")
  40. price = read()
  41.  
  42. print("listing currency: ")
  43. currency = read()
  44.  
  45. createListing(name, price, curency)
  46. sleep(.5)
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement