Advertisement
streqicity

Untitled

Feb 10th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. ingredients=1
  2. price=0
  3. fs.makeDir("butt")
  4. print("What item are you getting the price for?")
  5. item=read()
  6. print("How many does recipe make:")
  7. quantity=tonumber(read())
  8. while true do
  9.  
  10.  
  11. while ingredients==1 do
  12. folder="butt"
  13. print("Ingredient(write done when out of ingredients):")
  14. check=read()
  15. if check=="done" then
  16. ingredients=0
  17. cheap=price/2
  18. print("Your Adjusted total is:"..cheap)
  19.  
  20. elseif tostring(fs.exists(tostring(folder.."/"..check)))=="true" then
  21. god=fs.open((folder.."/"..check),"r")
  22. print("How many does it require:")
  23. mult=tonumber(read())
  24. price=price + ((tonumber(god.readLine())*mult)/quantity)
  25. cheap=price/2
  26. print("your total thus far is:",cheap)
  27. elseif tostring(fs.exists(tostring(folder.."/"..check)))=="false" then
  28. god=fs.open((folder.."/"..check),"w")
  29. print("we dont have that item in the system whats the admin price:")
  30. new=tonumber(read())
  31. god.write(new)
  32. print("How many does it require:")
  33. mult=tonumber(read())
  34. price=price+((new*mult)/quantity)
  35. cheap=price/2
  36. print("your total thus far is:",cheap)
  37. end
  38. god.close()
  39. end
  40. if tostring(fs.exists(tostring(folder.."/"..item)))=="false" then
  41. god=fs.open((folder.."/"..item),"w")
  42. god.write(price)
  43. god.close()
  44. print("item saved")
  45. end
  46. print("would you like to do another item y/n:")
  47. if read()=="y" then
  48. os.reboot()
  49. else
  50. os.shutdown()
  51. end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement