Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ingredients=1
- price=0
- fs.makeDir("butt")
- print("What item are you getting the price for?")
- item=read()
- print("How many does recipe make:")
- quantity=tonumber(read())
- while true do
- while ingredients==1 do
- folder="butt"
- print("Ingredient(write done when out of ingredients):")
- check=read()
- if check=="done" then
- ingredients=0
- cheap=price/2
- print("Your Adjusted total is:"..cheap)
- elseif tostring(fs.exists(tostring(folder.."/"..check)))=="true" then
- god=fs.open((folder.."/"..check),"r")
- print("How many does it require:")
- mult=tonumber(read())
- price=price + ((tonumber(god.readLine())*mult)/quantity)
- cheap=price/2
- print("your total thus far is:",cheap)
- elseif tostring(fs.exists(tostring(folder.."/"..check)))=="false" then
- god=fs.open((folder.."/"..check),"w")
- print("we dont have that item in the system whats the admin price:")
- new=tonumber(read())
- god.write(new)
- print("How many does it require:")
- mult=tonumber(read())
- price=price+((new*mult)/quantity)
- cheap=price/2
- print("your total thus far is:",cheap)
- end
- god.close()
- end
- if tostring(fs.exists(tostring(folder.."/"..item)))=="false" then
- god=fs.open((folder.."/"..item),"w")
- god.write(price)
- god.close()
- print("item saved")
- end
- print("would you like to do another item y/n:")
- if read()=="y" then
- os.reboot()
- else
- os.shutdown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement