Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ingredients=1
- price=0
- folder="butt"
- fs.makeDir("butt")
- print("do you want to remove, add, or price check an item?")
- remove=read()
- if remove=="remove" then
- print("what item?")
- item=read()
- fs.delete("butt/"..item)
- print("deleted restart in 1 second")
- sleep(1)
- os.reboot()
- elseif remove=="price check" then
- bullshit=0
- print("when you are done getting prices type exit")
- while bullshit==0 do
- print("What item are you getting the price for?")
- item=read()
- if tostring(fs.exists(tostring(folder.."/"..item)))=="true" then
- god=fs.open((folder.."/"..item),"r")
- print(god.readLine())
- elseif item=="exit" then
- os.reboot()
- else
- print("Whoops... I do not appear to have that in our system.")
- end
- end
- else
- 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
- 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
- end
Advertisement
Add Comment
Please, Sign In to add comment