예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
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)
예제 #6
0
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)
예제 #7
0
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)
예제 #8
0
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)
예제 #9
0
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)
예제 #10
0
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)
예제 #11
0
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("/")
예제 #12
0
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)
예제 #13
0
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("/")
예제 #14
0
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))
예제 #15
0
def logout():
  if getcookie("User") == False:
    return render_template("error.html", error="You have not logged in!")
  delcookie("User")
  return redirect("/")
예제 #16
0
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())