Making a Simon Says Bot with Python
Vložit
- čas přidán 30. 01. 2021
- In this video I'll show you how I made a Simon Says color tile memory game bot using python. Simon says is an old game where there are 4 tiles with different colors, the tiles will begin flashing in a specific order, and your goal is to click on them in the same order they flashed. The game gets harder and harder as more and more tiles start flashing and normal humans will eventually run out of memory.
To create a bot for this game I will be using the knowledge I demonstrated in previous videos, notably the
"How to make advanced image recognition bots using python"
• How to make advanced i...
and the "How I make bots using python (educational)"
• How I make bots using ...
The libraries I used in this video are pyautogui, keyboard, pywin32 and time.
If you don't have them installed and want to try this make sure to install them from a CMD with
pip install pyautogui
pip install keyboard
pip install time
pip install pywin32
Note that I am using python 3.7.0 64 bit which is compatible with pyautogui without any major issues, if you attempt this in any newer version of python make sure to fix the pillow and numpy issues with
pip install pillow
pip uninstall numpy
pip install numpy==1.19.3
If you have any questions feel free to comment, I reply to every singe one.
Thanks for reading ^^
I am sad this channel does not have more than 100k subs. Definetly one of the best programming Tutorial channels there are on the platform.
Ty! Hopefully I can get there this year haha
i agree
this is so nice, everything is fully explained and easy to understand
I love your style, thanks for making these videos!
Thanks! I'm working on one rn xD Been forever since the last upload
Your tutorials are fantastic! I enjoy just listening to it and seeing how you eliminate each issue and explain what's going on.
Glad you like them!
Fast and detailed ,A perfect combination to make a programming tutorial👍✌
Ty!
I love your video! It's awesome! Straight to the point, waiting for your next video!
Glad you liked it!
@@KianBrose Welcome! Can you put the code link in the description for our reference?
@@ddtdilireba sadly i think i didn't release the code for this one,there might be a pastebin somewhere in the comments though
Awesome as always 👍
Thanks ^-^
Love it! keep up the amazing videos!
Will do!
Hey man thanks so much for this incredible tutorial and I really wish you will do more of such awesome content and grow your channel!
Is there a way to restrict the bot in running only on one software like Memu or Bluestacks?
Unfortunately not! Your best shot is to stick it in a virtual machine, or you could use the very very very very very slow ADB (android debugging bridge) to send taps to the emulator but then again its very very very very slow!
@@KianBrose Thanks so much for the fast info man!
I really didn't understood the listen and x portion,
You are a genius bro, keep on like this and you will reach 1 million in no time
Ty!
YOU ARE THE BEST, PLEASE CONTINUE TO MAKE MORE VIDEOS LIKE THESE!!! YOU ARE UNIQUE AND I LOVE YOU, YOU HAVE MADE ME WHOLE WEEK 100X BETTER THANKS SO MUCH PLEASE NEVER STOP YOU ARE THE BESTTTTTTTTT!!!
Will do xD Have a few things going on atm
@@KianBrose Take your time my man,
Great explaining, based on your video i could manage again my script. Thank you
Glad it helped!
Thank you for helping me automate my required annual training!
np
Thank you! I really like your videos
Np, Glad you like em!
That was Amazing !
Thanks!
Hello
High quality content :)
loving it
Totally underrated :(
Ik
@@KianBrose Post more videos with less content over shorter periods of time to spread the goodies
@@krissloo143 Am a bit financially unstable atm so doing side jobs to support my lifestyle
the fact that you reply to every comment is a W, though on 4:50 you could just make it so when it detects a color it sets a variable 'currentColor' to the current color so then next time those pixels are detected it would check what the current color is so that it doesn't detect it multiple times if it's the same and it would set a new color if one is detected (edit: well i guess if it repeats the same color twice it would break but it could be fixed by removing currentColor when no of the pressing pixels are detected)
ty!
ngl i got a stroke reading your comment
I think I get it, but the problem is that sometimes the same color appears twice
@@KianBrose lmao, i had a stroke making it too, then i also realized the same color could appear twice, but there's a simple fix (since there's a little bit of time where no buttons are highlighted), you can just set the currentColor to null when there is no color selected, that would entirely fix that problem
Well, I think I found a bunch of tutorials for botting 3d games, but they are all 45+ minute videos and are like 8 part series. This is what makes your channel so much easier to follow then the rest because you can explain so much in 15 minutes and actually have it make sense so we can implement the same core mechanics into our own endeavors. I highly doubt I'll be able to stick to OpenCV but i'll try.
Yeah, I try to compress the content as much as possible as to not waste time
really cool video and great explanation
Glad you liked it!
so good explained thanks!
Glad it was helpful!
This kind of project is what im looking for... A bunch of thanks from newbie subber😊
This is the first comment on this video in like a year, glad you liked it!
Thanks for the video. It is really helping me to build my own script to use on my smartphone.
Np
you are really good and underated your tutorials are straight forward funny and dont have a 5minuite intro of you plugging your second channel or asking people to sub
yep, people dont care about anything other than what the title says, straight forward and fast is good
Kian, thanks a lot for making these videos. I learned A LOT from them and i m trying to make a bot on my own. I would appreciate the effort if you made a video on either making a aim bot in krunker game or how to change values of in-game currency of online ( or server-side ) games
btw I just subbed so I haven't watched much of your videos so if you have already made on then attach the link.Thanks again!
While i do know how to do this, I think it hits the 'you can't talk about it publicly' side of CZcams
@@KianBrose is there a discord server of yours where you can teach us that?? please 🥺🙏?
That is also against discord tos
@@KianBrose My god😅 thats fine bro I still enjoy your other content, I'll go with it
You should try making a bot for a chess game. Then you could do a Computer Vs Computer(python) match.
Actually that's a project i wanted to do but with AI
OK NICE VIEO KEEP MOVING!
Thanks! Will do
@@KianBrose are u from sweden?
based on your videos, i will make a youtube bot to open your videos and like and subscribe. Awesome video! cheers from Brasil
Oof ty xD Glad you liked it!
Hello, Kian, great videos! i'm getting an error though when I tried.
while l:
NameError: name 'l' is not defined"
Do you have any idea?>
Thanks
o yah its not an I as in the letter i, its a 1, "While 1:" can be interpreted in the same way as "while true:" which jsut means it will run forever
I kind of got lost after the listen and x list part but i understood how the program works. Could you have a way to download the finished program so we could look through the code to understand it better? Anyways love the content keep it up man.
Oof to be completely honest I deleted the project folder a while ago, sorry, forgot to put the code in the decription...
Love your content, you helped teach me create and sell hacks for online games
Is there a way to make the pyautogui.pixel be region-based (meaning different x and y values) or is it only possible with a single x and y value?
e.g instead of x: 500 y: 400, do from x: 200 to 800 and y: 300 to 700.
im pretty sure just single value is possible
super late reply but you can generate a random x and y int within the range and feed that value to the move function
Nice video bro, do you know how to make the bot works without having the game window in the foreground? so i can watch a movie while the bot is farming xd, it would also be nice to see how to capture a part of the window with locateOnScreen without it being in the foreground and then click on it.
Unfortunately not possible, tried doing that myself multiple times, best solution is just either having dual monitors or running it in a vm
Very good video but if you wanted to introduce a timer in the game, how would you introduce it?
What do you mean by timer? Like a delay between each click?
@@KianBrose Nope, I mean like a timer that tells you how long you've been playing since the game starts
@@edgargabriel5090 Oh em, I mean I guess you could play around with the date time module, personally I have never needed something like that so I never looked into it so I can't give proper advice
Nice
*click* nice
@@KianBrose keyword “nice” not found now searching for “Nice”
Hi bro ur videos awesome
Can u make a similar bot for match2 game
Like candy crush? I mean that could be easily done with a pretty simple low effort neural network
@@KianBrose exactly
Would love to see you tackle that. No pressure though, do your thing. Your content is really nice!
Hi this doesn't directly relate to the video but i've been having problems with my program. For some reason my program cant do anything in game. All it can do is move the mouse around very glitchy to one spot and only moves when i move the mouse cursor ignoring all the other code. Ive tried to troubleshoot it but it hasn't worked. I assume its because its a full windowed game not just a web browser game that might be messing with my code but it's not super secure or anything it might just be messing with perms and inputs.
Ah actually this might be related to the game being 3d, I am aware that clicks dont work well in 3d "pan" environments and have no way to solve it at the moment
@@KianBrose Oh that sucks, I thought it was something to due with Idle not having admin permissions not being able to input into the game. All well, thanks for the fast reply!
Edit: Does there happen to be another similar coding program that can run in 3d spaces because I can make the bot I wrote all the code for it the bot just can't execute it correctly sadly.
Thanks Kian, that was again a great lesson I am inspired doing python again, was sidetracked with a little VBA project. How is the halfnaked women clickbait project going?
Well you see, I'd rather not to clickbait thaaaaaaaaaaaat much xd
Good job, maybe something bit harder next time? ;)
yes
I have a video suggestion: is it possible you can do a vision processing tutorial using openCV? I’m trying my best to understand it but it’s really complicated.
Actually this is something I need to learn as well haha, quite possibly a video I'll do soon
@@KianBrose Cool! Tysm
I’d love to see your approach to making a bot for farming in clash of clans
Theres actually a really incredible clash of clans bot called MyBotRun if I recall correctly that i fail to understand how it works
you are amazing !!!!!!!!!!!!
friend is a boot for flappy bird ♥
Ty!
nice. Can you do this for bejeweled 3? Thanks.
Unfortunately I cannot take personal requests at this time, but I really recommend trying to do it yourself
@@KianBrose Well it's not that u must do it now or later. If u will find time and if things like bj3 interest u. Those things are not for me, i barely know this stuff. Thanks.
plz make a video on how to import modules in python idle
I mean you just write import module_name_here
But I can't import it is showing no module named
Do you have a github repository for this project?
Unfortunately not, I forgot
Ik im late, but for the colour values, like the rgb and stuff, it just says NaN for them, idk what i did wrong
Ah actually that's a bug i experienced as well when using dual monitors, use it on the primary monitoe
answer = input("Hey man, do you have a Discord server?").upper().replace(" ", "").replace("Y", "YES").replace("N", "NO")
if answer == "YES":
print(r"That's nice, I would like to join!")
elif answer == "NO":
print(r"Well, I would be interested in joining if u made one")
else:
print(r"OK, mr.SmartPants I didn't think u would try to outsmart my program but... I OUTSMARTED YOUR OUTSMARTING")
wtf am I doing with my life… programming on the CZcams comment section
Hei man! Awesome content. Create a Discord community! And let's create a team. All the best
One more thing. I guess this video doesn't have the code inside. Can you put the code in the description?
I have one actually, it's in the channel about page
Oof I actually deleted the code shortly after making the video and I forgot to upload it, sorry about that
I watch your videos on CZcams
I love it
But I want to create a bot and I have no idea. I want a bot to view me a hidden number on a game online. please can you help me with an idea codes in python?
that sort of requires a mod menu
@@KianBrose okay tell me more please I have no knowledge!
Does it exist a library like win32 but for mac?
Yes, you can use pyautogui like so:
pyautogui.PAUSE = 0 #This removes the delay pyautogui has to simulate a left down left up, u can tweak it if the click isnt registering
pyautogui.click(x,y)
@@KianBrose Oh Thank you so much!! I am going to try it!
@@KianBrose and continue your videos they are awesome for guys like me learning python! Thank's!
@@KianBrose well i tried but there is always a delay between the clicks...
@@victorneto3573 hm odd, if you added pyautogui.PAUSE = 0 after importing pyautogui it shouldnt have breaks, maybe the problem isnt the break itself but that it's clicking too fast so that it doesn't register, try 0.1 in the pause
Pls do for hayday
lol
hi i have been haveing problems importing win32api and i dont know why i have been searching all afternoon and notheing :C
its windows exclusive, you will need pyautogui.click(x,y) for mac and linux
i have fixed it it was not that the dlls were missing@@KianBrose
Win32 api alternative for linux?
Yes, you can use pyautogui like so:
pyautogui.PAUSE = 0 #This removes the delay pyautogui has to simulate a left down left up, u can tweak it if the click isnt registering
pyautogui.click(x,y)
@@KianBrose oh k and thanks for uploading.
@@Ravisingh-dl3jr maybe linux32api? (I am a noob xD)
@@menyepy no there is no such thing lel
@@Ravisingh-dl3jr xD
can you do a tutorial to learn python?
That is a video I have planned for the future, currently recording somethign else though
Would love some 1 to 1 help bro would really appreciate it if you could just getting into all this python stuff and it's so confusing at time
Sorry I can't provide 1 on 1 help, i recommend joining the discord group and asking in the python help chat
I can't import modules. What am I missing?
Ah, I recommend looking at the first tutorial I ever made which explains how to download these modules, this video was more of a demonstration of how I would bot this game
Hey kian can you teach us make bot with adb in python on android phone
For ADB I usually just use python to run an autoit script that controls a console with adb open
@@KianBrose can you make video on it please,how to setup adb, how to setup in python, which version of python I use for it
@@KianBrose kian which version I use for automation in Python
@@YashKumar-oy9je python 3.7.0 64 bit
@@KianBrose thanks bro
I don’t see a line of coding restating the list to become empty. This would in theory mean the captured color numbers stored would stack up and eventually repeat earlier captured colors and then click on the wrong colors at the wrong time. Did I miss something?
Em.. that's exactly what it's supposed to do though, it infinitely appends the colors to the list, it never needs to start over since it's never wrong, if you really want to restart it just close and open the script
@@KianBrose Oh, I had thought that the game would signal colors like so: red (first round), red; yellow (second round and so forth). And the script would capture it as (red (first round, click etc.), red, yellow (second round > red, red, yellow)). Because you iterate again over the list completely over.
@@grandtheftautoexpert2040 ah yeah that's not how the game works, it just keeps going infinitely, there are no rounds hence no reset
@@KianBrose oooh yeah thanks for clearing it up
@@KianBrose Now I rather have the question why you chose to use an more increasing variable (x) instead of just clearing the table?
very, very good, speak , music in piano virtual, letter in internet, and play music in virtual piano, accordes, note music, simultaneos, one, or two, or thre teclas some.
Yes
tnhks, download project study ? create project player guitar flash ? or guitar hero ? tnhks, videos, study python, :-)
Kian Why Your Stop Upload Tutorial , We Miss You
Im editing on right now lol, yeah have been off for a couple... weeks..
hey I ran the final product and this message popped up pls help
Traceback (most recent call last):
File "C:/Users/humai/Desktop/python codes/colourmembot2.py", line 72, in
click(1239,1140)
File "C:/Users/humai/Desktop/python codes/colourmembot2.py", line 10, in click
win32api.mouse_event(win32con.MOUSEVENTF_LEFTUP,0,0)
AttributeError: module 'win32con' has no attribute 'MOUSEVENTF_LEFTUP'
q
Try to make 3d aimbot please 😊. I know its hard but can u do ?
i can but dont have time
@@KianBrose OK bro 😊.
im enjoying the video without even understanding it
ah i failed then
😅@@KianBrose
Please make a video on ultimate pyautogui tutorial making bots, keylogger, spammer whatever. It'll be cool❤️
ah unfortunately cannot make keyloggers on yt
@@KianBrose Cool np, but you get the big picture right? Make ultimate pyautogui tutorial.
bro why now find your channel ,
the algorithm has blessed ye with my content
Second
Nice!
Third lol
Indeed
Nice
Nice