def gamblingpage(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") cookie = getcookie("User") return render_template("gambling.html", cookie=cookie)
def daily(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") daily = dailyfunc(getcookie("User")) if daily == False: return render_template("error.html", error="Don't be too greedy!") return render_template("success.html", type="daily", daily=daily)
def tips(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") tip = tipfunc(getcookie("User")) if tip == False: return render_template("error.html", error="Don't shoo away your customers by asking them for tips!") return render_template("success.html", type="tip", tip=tip)
def work(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") every = workfunc(getcookie("User")) if every == False: return render_template("error.html", error="Chill, enjoy your break!") return render_template("success.html", type="work", every=every)
def profilepage(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") cookie = getcookie("User") user = getuser(cookie) ready = getusercd(cookie) return render_template("profile.html", user=user, ready=ready, cookie=cookie)
def buymenuslot(): if request.method == "POST": if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") item = request.form['title'] func = buymenuitem(getcookie("User"), item) if func == True: return render_template("success.html", type="buymenu", item=item) return render_template("error.html", error=func)
def sellstraw(): if request.method == 'POST': if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") amount = request.form['amount'] color = request.form['color'] func = sellsm(getcookie("User"), color, amount) if type(func) is dict: return render_template("success.html", dict=func, type="sellstraw") else: return render_template("error.html", error=func)
def buystraw(): if request.method == "POST": if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") number = request.form['amount'] color = request.form['color'] if int(number) > 5000: return "You cannot buy more than 5000 of each straw!" func = buysm(color, getcookie("User"), number) if func == True: return render_template("success.html", type="buystraw") else: return render_template("error.html", error=func)
def cupapp(): if request.method == "POST": if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") number = request.form['number'] bet = request.form['bet'] func = cupgame(getcookie("User"), number, bet) if func.startswith("You "): return render_template("error.html", error=func) if "lost" in func: return render_template("error.html", error=func) if "won" in func: return render_template("success.html", type="gambling", success=func)
def shoppage(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") cookie = getcookie("User") useremployees = [] for employee in employees: useremployees.append({"Name": employee, "Boost": f"₹{employees[employee]}/hr", "Price": f"₹{str(getpriceempl(cookie, employee))}0", "Amount": getamountempl(getcookie("User"), employee)}) userdecos = [] for deco in decorations: userdecos.append({"Name": deco, "Boost": f"₹{decorations[deco]}/hr", "Price": f"₹{str(getpricedeco(cookie, deco))}0", "Amount": getamountdeco(getcookie("User"), deco)}) userupgrades = [] for up in upgrades: userupgrades.append({"Name": up, "Boost": f"₹{upgrades[up]}/hr", "Price": f"₹{str(getpriceup(cookie, up))}0", "Amount": getamountup(getcookie("User"), up)}) return render_template("shop.html", decorations=userdecos, upgrades=userupgrades, employees=useremployees)
def login(): if request.method == "POST": if getcookie("User") != False: return render_template("error.html", error="You have already logged in!") username = request.form['namelogin'] if getuser(username) == False: return render_template("error.html", error="That is not the name of a Cabin!") password = request.form['passwordl'] if check_password_hash(gethashpass(username), password) == False: return render_template("error.html", error="Wrong password!") addcookie("User", username) return redirect("/")
def shop(): if request.method == "POST": if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") if request.form['category'] == "decorations": func = buydeco(getcookie("User"), request.form['title']) if func == True: return render_template("success.html", item=request.form['title'], type='buy') else: return render_template("error.html", error=func) if request.form['category'] == "upgrades": func = buyup(getcookie("User"), request.form['title']) if func == True: return render_template("success.html", item=request.form['title'], type='buy') else: return render_template("error.html", error=func) if request.form['category'] == "employees": func = buyempl(getcookie("User"), request.form['title']) if func == True: return render_template("success.html", item=request.form['title'], type='hire') else: return render_template("error.html", error=func)
def signup(): if request.method == "POST": if getcookie("User") != False: return render_template("error.html", error="You have already logged in!") username = request.form['names'] if username.lower() in allusers(): return render_template("error.html", error="A user has this username! Try another one!") password = request.form['passwords'] passworda = request.form['passwordagain'] if password != passworda: return render_template("error.html", error="The two passwords don't match!") makeaccount(username, password) makeaccountcd(username) makeaccounthr(username) addcookie("User", username) return redirect("/")
def main(): cookie = str(getcookie("User")) if cookie == False: return render_template("index.html", cookie=cookie) user = getuser(cookie) ready = getusercd(cookie) useremployees = [] for employee in employees: useremployees.append({"Name": employee, "Boost": f"₹{employees[employee]}/hr", "Price": f"₹{str(getpriceempl(cookie, employee))}0", "Amount": getamountempl(getcookie("User"), employee)}) userdecos = [] for deco in decorations: userdecos.append({"Name": deco, "Boost": f"₹{decorations[deco]}/hr", "Price": f"₹{str(getpricedeco(cookie, deco))}0", "Amount": getamountdeco(getcookie("User"), deco)}) userupgrades = [] for up in upgrades: userupgrades.append({"Name": up, "Boost": f"₹{upgrades[up]}/hr", "Price": f"₹{str(getpriceup(cookie, up))}0", "Amount": getamountup(getcookie("User"), up)}) return render_template("index.html", cookie=cookie, user=user, ready=ready, employees=useremployees, decorations=userdecos, upgrades=userupgrades, franstats=getuserfranstats(cookie), franhourly=getuserfranhourly(cookie), sms=getusersm(cookie))
def logout(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") delcookie("User") return redirect("/")
def leaderboardspage(): if getcookie("User") == False: return render_template("error.html", error="You have not logged in!") if checkhourly() == True: return render_template("error.html", error="Hourly incomes are being sent out. Try again in a few seconds!") return render_template("leaderboard.html", hourlylb=getlbhourly(), drinkslb=getlbdrinks(), moneylb=getlbmoney())