💥🌾🌾FARMING GAME 🍠🍠 WITH LIVE LEADER BOARD🏆💥
A game inspired with the help of @Atari7! With a live leaderboard, you can compete with friends and compare your skills to other players! Complex strategy, never-ending fun, will keep you busy at night. A farming extravaganza, with strategy, thinking, farming, and a bit of luck, have fun!
PS: Those of you who have seen this before, it now works for anybody!
I made a bot to automate it
https://repl.it/@pyelias/Farming-Game-bot
@pyelias wow thats amazing. it gets the highest score iv ever seen
Looks awesome, i hope you don't mind me having a try at Creating a game like this. I have 0 ideas and when i see people making games i always think “i should have though of that”.
@bossotron13 that's fine! maybe I could post a tutorial on a game like this if you want it
@PYer That would help me and others if you find the time.
@bossotron13 ok ill start writing one!
I have created a Endless Mode of this game
https://repl.it/@RileyGrooms1/Farming-Game-Endless-Mode
cool! @RileyGrooms1
I made one that displays the score after every turn! (Instead of the days left.) @RileyGrooms1
oh thats cool @PYer
thanks. you can add it to yours. @RilGames
Traceback (most recent call last):
File "main.py", line 21, in <module>
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers
it works now. thank you @HILLIARDGALLOW1
@C00lguy975 yea someone posted a score of "inf" and it broke the avrage function
I have a fixed version @ https://Farming-Game-verifier.haaruun.repl.run
pyelias made a game verifier
accidentally crashed the game DB while trying to cheat in it
@sanjaykdragon saw that, you posted "inf" wich is not a number, try and cheat this one tho @ https://Farming-Game-verifier.haaruun.repl.run
@Haaruun can't cheat by POST'ing in that version because it actually simulates my entire moveset
HELLO EVERYONE! I noticed a lot of people have been commenting on an error. I fixed it and it should work. @Haaruun Described the error if you want more information.
It says
Traceback (most recent call last):
File "main.py", line 21, in <module>
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers
@TheBlacksmith yea someone posted a score of "inf" and it broke the avrage function
I have a fixed version @ https://Farming-Game-verifier.haaruun.repl.run
pyelias made a game verifier
something is wrong w/ your database specifically the avg function im assumuing its because a user haxor overflowed the average function but i cant test it beacuse in dont have the mongo password
there is something wrong with the average function. it is easy for people to add their own data into the database though, im trying to work on a way to fix that. @Haaruun its really hard to add security with a leaderboard like that.
@PYer The average function on the server-side is fine, but only taking the first 8 characters in getavg
makes it work wrong for large numbers. You should use round
or something like this instead. And for security, you could record the users actions and simulate them on the server to make sure the score is legitimate.
@pyelias you would have to do everything on the server move by move because whats stopping someone from faking there actions by changing the benefits that happens while playing. if replit supports it i would recommend websockets to stop the delay from opening a connection and posting each time
@Haaruun You can send the random state to the server as well to have it check that the benefits were generated normally.
(something like this and this. Feel free to just copy parts of that, there's no point rewriting it)
@PYer i got a working leaderboard server w/ game verification but im using a free mongodb and bots score so high it wont store it
with all the bots coming on im going to try to make a seprate bot server w/ bot contests (saving bot 3.0 till then :P )
oh yeah I saw. that sounds cool! @Haaruun
interrupted by 13/365 days :/
THE FARMING GAME ||
By PYer ||
======================
Days Left [ 13 ]
Crops [ 8 ]
Seeds [ 107808038 ]
Total Land [ 423950450 ] feet
Unused Land [ 0 ] feet
Workers [ 49486704 ]
Harvested [ 82477840 ] crops!
Nothing extraordinary happened today.
@SaptarshiHalder what is it with those emojies?
@DJWang Nice!
Traceback (most recent call last):
File "main.py", line 22, in <module>
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers
please fix
How do you do it so that you can just press any key without having to press ' enter' and it will continue?
I created a function using the module readchar
. Here it is:
def newinput(prompt):
stdout.write(prompt)
stdout.flush()
return str(readkey())
no problem @ripu
How to do live leaderboard
I like this game! Can I embed it in my website?
sure, just please give me a simple credit and link to my profile please. juse Created by @PYer
works. Thanks! @KellerWorthen
@PYer here's the website: https://replgames.kellerworthen.repl.co/
it is a collection of good games created on repl.
@KellerWorthen cool thanks!
Just asking out of curiosity, does using Flask and hiding the database inside a .env make the data more secure? I would like to implement this into my own projects if it means that people are not able to change the server data to whatever they want. Thanks
not really. it prevent people from deleting scores as well as manually changing the average and scores/ usernames. Basically, it prevents them from having complete control, but they can still add any scores they want by visiting the site. The main reason was to make it harder to change, but people found out still. @LoneAce
@PYer Yea I expected that. However, if the Flask server was to return a piece of data from a .env file does it mean that another person can just make another repl and use the same app.route to get the data?
they could open up the flask app without opening your repl. then they oculd see any of the returned data. @LoneAce
@PYer Right. But what if the repl is a private one made using a Hacker plan? Will the data be more secure? If it is I will consider subscribing
i don't think so. Anybody could still view the flask server. just not the code. @LoneAce
@PYer Okay thanks mate
super fun! i really enjoyed this (:
thanks! @b30wulf
my game dosent work
awesome, i like it very much
thanks @Mustafa12324
i made a score of 131432.0 points. really cool game!
also, the score website is not working (404)
nice job! @banew
ta kebrado
I'm getting a error on line 22
That was a really fun game
thanks! @Kamlemyar
the best
thanks! @JosMag2019
not bad with imagination
thanks @Banger
Wym?
what do you mean? @gcard03
Im talking about [email protected]
Can you do a tutorial on your pymongo storage? I used jsonstore and it is not very secure if someone takes a glance at the code
@LoneAce there is already one by @TheDrone7 : Using Mongodb With Python
@PYer Thanks mate
no problem. @LoneAce
Looks Like you have an error:
Traceback (most recent call last):
File "main.py", line 21, in <module>
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers
@AQDProjects yea someone posted a score of "inf" and it broke the avrage function
I have a fixed version @ https://Farming-Game-verifier.haaruun.repl.run
pyelias made a game verifier
@Haaruun Should've read further into the comments, looks like I was late to the party