How to make a Bot with AutoIT
HTML-код
- Опубликовано: 16 сен 2024
- Download script here: haskins.ninja/
Step by step on how create a bot for use on games and other automation things. We will take a look at the basics of what you can do, and how its done. Plus you get to see me mess up a couple of times. - Игры
Your video simply changed my life...
I first saw it by accident two years ago and completely fell in love with automating stuff. Now, I'm doing aerospace engineering at the university and planning to use programming as my main working engine in the future.
It's impossible to put in words how big of a difference you made in my life with a simple video about making a bot for a game I haven't played in ages.
Thank you!
Great video. That's how a programmer works with his code. Explore the stuff, get errors, fix them and keep moving till you get desired result. Basically, that's how i figure out the things while programming. Thanks mate.
Thank you so much. This was one of my early early videos, and probably the funnest to make. I had be thinking about it for like 2 weeks, then finally i was like, "just do it..."
Well, this was educational on another level as well. I will soon start to persue my own carreer in programming and I always felt like I didn't know enough from my education. It's good to see an actual programmer also do the "trial->research->repeat" method.
Although I realize it isn't your main language and you would do a lot more planning in a serious programming scenario, it still calms me that you're not just plowing though this like it's the most trivial thing ever, like professors do in prepared lectures while going through way more complex material.
Thank you for the tuttorial i have used this video to make my own macro, i really appreciate that you show that you use the help button frequently which was my biggest discouragement in learning any language, was not memorizing api. instead i can remember by doing now I will continue to learn using the help button. My next step after what you see below is to select via widget so that i can use this on other computers using a memory key.
For $i = 1 to 15
WinActivate("Let's Play")
sleep(250)
MouseClick("Left",77,554) ;Bunker
sleep(100)
MouseClick("Left",77,554) ;Bunker
sleep(300)
MouseClick("Left",829,462) ;select current capacity
sleep(100)
MouseClick("Left",829,462) ;highlight capacity
sleep(250)
MouseClick("Right",829,462) ;right click capacity
sleep(300)
MouseClick("Left",908,474) ;click copy in menu
sleep(250)
MouseClick("Right",818,491) ;right click the amount wanted
sleep(250)
MouseClick("Left",878,608) ;click paste
sleep(250)
MouseClick("Left",814,486) ;place cursor before cama
sleep(100)
send("{BACKSPACE}") ; remove cama
sleep(300)
MouseClick("Left",824,539) ;place oil purchase of camaless amount
sleep(300)
MouseClick("Left",1210,222) ;Click depart max routes
Next
new version
#include
; Press Esc to terminate script, Pause/Break to "pause"
Global $g_bPaused = False
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ; Shift-Alt-d
While 1
WinActivate("lets play")
MouseClick("Left",48,696) ;Bunker
sleep(100)
MouseClick("Left",48,696) ;Bunker
sleep(100)
MouseClick("Left",847,592) ;select current capacity
sleep(100)
MouseClick("Left",847,592) ;highlight capacity
sleep(150)
MouseClick("Right",847,592) ;right click capacity
sleep(100)
MouseClick("Left",871,598) ;click copy in menu
sleep(150)
MouseClick("Right",830,631) ;right click the amount wanted
sleep(150)
MouseClick("Left",904,473) ;click paste
sleep(150)
MouseClick("Left",829,628) ;place cursor before cama
sleep(100)
send("{BACKSPACE}") ; remove cama
sleep(200)
MouseClick("Left",730,698) ;place oil purchase of camaless amount
sleep(200)
MouseClick("Left",1102,263) ;Click depart max routes
sleep(100)
MouseClick("Left",240,685)
sleep(100)
WEnd
Func TogglePause()
$g_bPaused = Not $g_bPaused
While $g_bPaused
Sleep(100)
ToolTip('Script is "Paused"', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>TogglePause
Func Terminate()
Exit
EndFunc ;==>Terminate
Func ShowMessage()
MsgBox($MB_SYSTEMMODAL, "", "This is a message.")
EndFunc ;==>ShowMessage
Also, you could make the bot by parts... So when you test that part, its for the level you are on and don't have to reset every time.
Later you put everything in one sequence.
+Blame DonaldTrump Yes, I have made a couple since then that have step by step.
I found this video immensely enjoyable. This is the first video I've seen on automation with AutoIT and I can say now, it will not be my last. I can't wait to start automating things :)
Thanks for your time.
You learn a lot by making mistakes too. Thanks for not editing the video.
Greetings from Lima, Peru.
Been wanting to make a bot for a couple of games. Can't say this has helped me but it has given me a better outlook on how to make simple bots.
Man, you will never board anyone with your intelligence. Thank you so much for showing us informative tutorial. Please have more! I would like to get into programming, I have an associates and one month into my BA in I.T. How can I start learning how to program and what applications to use...thanks again!
+ramon tompkins If you are just starting, python. www.python.org/ (this is if you do not know anything else) python will get you a base knowledge of programming. for Applications C#, use Visual Studios from Microsoft (free version, kinda cluncky), or MonoDev www.monodevelop.com/ (open source). For web development (wepages) learn HTML, JavaScript, jQuery and use Notepad++ notepad-plus-plus.org/. for phone apps, learn Java, more specificly, Android SDK. use Ecplise developer.android.com/sdk/installing/index.html.That should get you started. Tons of tutorials and videos on how to get started with programming. The main thing you will need is time. And we are all short on that supply. :)
+ramon tompkins Don't know if this will post or not, but here is a snip of some of the code I am working on at work. it uses 5 different languages in 1 page. Just as an example of programming languages "crossing" paths.
+Heath Haskins I did not post Heath, I was geeked to see it lol
ramon tompkins Very cool :D
Coolest coder vid by far.. and autoit is such a gem!
Saw the video length, was not expecting to watch it all the way through and I ended up doing so anyways. This was a great video, very informative and worth watching every minute.
+Alvin Phaho Thank you
Big Thx! Still very useful - even in 2019!
I'm 70yrs.old. I know nothing about coding or programming.. What I would like is a bot to play hayday and autobuy upgrade parts from roadside shops. I know it's a lot to ask for but thought I would give it a shot. This game is my form of enjoyment. Thx. I forgot to say. This game is played on an iPad mini.
To concatenate strings in AutoIt you use ampersands (&), not plus (+). E.g. "Hello" & "World".
Very nice, high quality video, high quality voice(and sound), fast introduction
+TheIvan290 thank you. :)
Great video. Being a developer, I kinda chuckled a couple of times. But I have to admit, you used much better language than I normally do when things don't work right.
+John Teceno Thank you. :) Trust me, my language off cam is much more colorfull.
This is the best video i have ever come across on botting, boy i am i glad i found it. Every second of it was enjoyable!
Really good video on Automating, I like the way you actually figured out your Errors and Mistakes on the videos, that also teaches everyone to fix their own Errors. Good Job :)
+Eraj Tob Thank you. I had intended to take the error sections out, but realized this was great by itself. Thanks for watching! I will be doing many more of this style of tutorials.
This video wasn't what I was looking for but I'm glad I found it all the same. I'm five minutes in and I already love your teaching style and casual demeanor. It doesn't hurt that you speak intelligibly. I'll be sure to check out your other vids.
A long shot request: Could you make tutorials for visual studio? More specifically, java script, universal apps, and porting to multiple platforms would be good starting points. It seems like the tool to use to reach the widest possible audience but the IDE is overwhelmingly complex and intimidating.
Visual studios is a beast of a program. When using it, I was in a group project enviornment. (By the way, I can't stand team server) as for Java I can program somthing for you, but you have to understand how Java works. Java when executed is inside a sandbox the sandbox exist on all different operating systems including Windows Mac Linux and other OS. These sandboxes are protected buy securities that are almost impossible to get around. With that being said it is possible, but I will not show how. Would you like me to still try to show you something in Java? Also I recommend going and downloading Eclipse to do your Java programming.
I would absolutely like to see you do Java tutorials. Correct me if I'm wrong but it would be counter productive to rely on exploits since they'll eventually be patched. When would that be useful for every day development? Portability is the reason I've been focusing on java. I know I'm capable of developing sophisticated apps. I keep running into stumbling blocks and having a teacher that articulates programming concepts in common english would be helpful. Something that struck me as above average about your video was you didn't take anything for granted. I didn't have to pause it to google something every minute. I understood it. You have a gift for teaching.
It just occurred to me that you might be familiar with a machine learning. If so, teach that. There aren't any general purpose machine learning applications that work out of the box but there are lots of open source machine learning projects that can be built into applications. The more devs who can work with this stuff, the faster we'll all have autonomous software. Given enough time and development, it's a field of research that could blossom into the stuff of sci-fi.
+Chase Graham Thank you very much! I will start a new series on Java programming. I have been through courses before, and I know what you mean. For the most part, the only reason I was able to get through those classes was because I had prior knowledge of programming languages. thank you again!
:) If you ask, I will try. Tell me what you think. ruclips.net/p/PLy9pYSa4f-d7R7_wvih2IOdbOsnDZqQFg
Subbed for autoit programming and bot concepts
thanks you so much, this video helped me a lot, since i want to become "videogames" developer i think this is a good way for me to start in , i´ve always wanted to become a " hacker " or something like that. i got bored so fast just making simple programs that just say " hello world" just subscribed :) waiting for new content !
Ha! nice. :D I have other ideas, but I havn't put out new bot content in awhile.
"Was that what was wrong with my function!?" lol, love programming.
Was the reason your function didnt work because you were declaring the function after you had already called it?
Yes
Tought the same. It probably is
he is from c# it could be.
Great video! Shows what programming really is. Good job
Are you brother of Heath Ledger...Because you both are perfect in own work!!
Watched this video a year ago now working at City of Titans project, ty!
+Giorgos Coacola :D Nioce!
compiling the script into an exe + WinHotKey makes a pretty cool little automation
Dude, I'm in love with ur videos
And, if i want use the command Send, but with ALT + Ñ ?( ` ), how it can be?
not sure how to set those on the HotKeySet.
Stronghold Kingdoms would be an amazing thing to make :D
Is there any benefit to use AutoIt rather than AutoHotKey?
Search history:
How to hack club penguin.
How to get away from the FBI
Way better that let's-plays. *thumbs-up
Excellent explanation and I able to get in to the bot programming.
Im looking into developing my own bot for the game kingdoms at war and this is a good place to start since i have no experience in programming or anything else computer related thanks for the video!
+Tyler St. Clair Any time! just let me know if you get stuck. :)
Tyler St. Clair How'd it go?
Good starting point for autoit. But the chair man... fix the chair, it is killing it.... oil it. You can use cooking oil as well :) ... oil it trust me
That chair is long gone.
this bot can be used in different windows? like in two games at the same time doing different stuffs in each windows? that should be great.
Yes
I think it was running the lines where you called your function and THEN it ran the lines to create the function. That's probably why it wasn't working and showing no errors.
Awesome! Laughed and learned, thank you for the tutorial.
Hey man thank you for this video. I am going write a script to change hundreds on settings in a salesforce environment.
Hello I have just watched your video and I got inspired
Also using a marco recorder such as TinyTask would be a lot easier to use. You can record your mouse (and keyboard if you wanted) and you the program will replay your actions and with x5 speed if you select fast speed in the settings. Try it out :)
+BinNation Hes an programmer, he wants some challenge
+BinNation i don't think that would work cause a company can't ban you if you made the bot cause it's still considerd a "manned" machine. if you use a program to record your steps a program made it for you.
+Greezy Technically, if you step away from your computer, it is no longer "manned" Using anything other then a mouse and keyboard to provid input to the game (like autoit) would break these rules.
Now, with that said, there is a thing called a USB Rubber Ducky. :D it is a programable usb device that IS a keyboard and mouse. :) Techincallitys, right? (link to rubber ducky below)
hakshop.myshopify.com/products/usb-rubber-ducky-deluxe?variant=353378649
I relay liked your video and i was laughing each time its not working .. and telling you whats wrong :P
+amer hamdan heehee I liked keeping it as real as possible. This is my normal stuggle
+amer hamdan heehee I liked keeping it as real as possible. This is my normal stuggle
Heath Haskins did you use a bot to type that comment because it did it twice XD
amazing mate! more autoit tutorials if its possible ;3
Thanks for this! RIP Club Penguin
Check out club penguin rewritten. It's playable
This is really cool tutorial thanks for a great video on the basics and stuff! Really, helped me start out on "Bots"
+RedishRibs Thank you! I will continue to make tutorial videos with walkthroughs. I will try to keep them shorter, but leave in all the trouble shoots aswell as how to find the answers.
LUCKYJ3SS3 Yes. I have made personal bots for runescape. The one I was most proud of did a wicked job of mining until inventory was 1/2 full of copper and 1/2 full of iron, walking back to the forge, metling into ingots, then crafting dagger, and selling them all off. I was able to set a "radom" delay on it so it would look like human clicks. I also put in a radom "do other stuff" loop so it wouldn't just do the single farming loop. I wont judge you, but please tell pepe the frog to watch his lingo please. (my kids can read my channel) :) Thanks!
Nice. Well just to let you know, I spent 9 years in Correctional Facilities. (I was a correctional officer) heehee. I don't consider botting a form of hacking.
ruclips.net/video/WaMQveDbRjU/видео.html
And no i didn't. (thankfully)
+LUCKYJ3SS3 who the heck asks questions like this? what a screwed up world we live in
Would autoIt program work on MMO games. These game usually have some kind of Gaurd/Shield to prevent third parties program to simulate key stroke/ mouse movements.
For example: some game use Hackshield or GameGaurd to prevent hack/bot from working, is there a way to use autoIt to get around it so it will work.
+Yang Xiong yes. For example, the game Shaiya has GameGaurd. AutoIt will run along side it without through up any alarms. Which game you going for?
+Heath Haskins
I am playing an online game called Rappelz, it's an old online mmo game but it uses hack shield called Gameguard, I have tried doing what you were doing but it's not working for me.
Can you possible do another video regards to mmo games that uses hack shields n how to use autoit on it.
This is awesome i used it to atomatically subscribe and like XD
That is so awesome you just answered all my questions in one video *.* you don't even know how I love you for that!
+Jean-Sébastien Brouard :) why thank you! I love you for watching! :D
+Heath Haskins Just programmed a bot in a rpgmmo and it works perfectly :D
How would I make a bot to buy something online without me their on a specific time?
+pvpblake hc timer.
Thanks for this awesome tutorial! 😇 I was wondering why the autoit doesn't sen keyboard keys! Thanks for this tutorial! 👍👌
Hey Heath, how are you? I'm learning to use autoit with your classes, they are perfect! Thank you!
I would like to ask a question, use the pixel; looking for the game constantly changes from day to night; logo or pixel changes; have any tips to keep collecting? the problem that arises in different places and different coordinates also!
Thanks!
Dear Mr. Haskins, great video! Is it possbile to create bot which solves Solitaire (cards) with autoit or is that to complex?
How to stop the script while it's running? Great video and helped me a lot, thanks! I subbed to btw :D
you can press ctrl+pause/break to stop the script
2 lill idea:
- Why do not u use ControlSend insted of Send function. Then it will work at background. :)
- Why are u copy paste multiple times the send function?
U can use like this:
Opt("SendKeyDownDelay", 2000) ;Key down delay 2 sec, so will w8 2 sec till next keypress.
ControlSend($hWnd, "", "", "{LEFT 12}"); sending left arrow button 12 times
Opt("SendKeyDownDelay", 5) ;Base delay time to remove the modification on it
So u do not need to use loop for this.
Where can i download AutoIT Windows Info? and Co. pls need help
bfy.tw/6yGC
Am I the only programmer that was screaming when he was making all those silly mistakes
Could it be utilized to find stuff that is in the game maybe objects or menu interactions. A better way to make it work without mouseclicks?
+Berke Ertugrul Yes. See my other videos. :) this is just one of a series (the first one actually)
+Heath Haskins Oh thanks, definitely will :)
You are the man! I’ve been wanting to have my own project that I’d actually be excited about to apply/learn programming skills. This is totally it - thanks for getting me started!!!
Do you have any tips for concealing your automation from...Wardens? :)
How to make Bot for pes 2016 play..... in my club vs comp challenge???
A grown man playing club penguin.
You missed the key word which makes it completely acceptable "American" kappa
I didnt knew u ever made vid like that thanks :)
great video! it's a shame you didn't end up creating a function for the keypress tasks but i understand the frustration of having purely syntax based errors. rustiness can creep up on ya. i'm gonna watch the clash of clans video to see more
New videos will have some functions in there. :)
i have another question xD can you make that bot will run in the background or that's not possible?
rip club penguin great video tho
So can you make bots work for bittorent a p2p peer application software If you can can you please show me ?
I think I could. Would depend on what you are trying to get to. What do you want the bot to do?
Very nice hat sir! Setting in one myself.
+Jesse Jones wootwoot peterbilts!
How about a bot for a flash game to run scripts? there is this game Evony and there are programs that do this but i was curious how they make the program to work.
Nice video mate, by any chance. Could you make an auto thing like this for minecraft? That would be amazing plus lots of views xD
+Your Nan is cancer I believe there's a couple that has already been made check craftbot
ah, ok ;D
What language does AutoIt use? Or is it like a standalone one that's only used by AutoIt?
Thank You for Info.
How I can Read value through DDE from another programme?
I'm pretty sure you just had to move the function to before it was used so that the program knows what it is trying to find.
He might have also needed another parenthesis at the end... or I could just be used to coding Python. I don't know if that's how this language works.
Yea, I thought it was JavaScript which you have to put functions before you call them, but it's not because I got functions to work out of order.
I create the bot with botchief plus.google.com/+brownlinda/posts/Tdfci9NRRSj
Hi, possible is, to make a script(bot) whose can react at wisual changes? example: something is black( thats ok.) and it changes colour at red(whatever) and now bot has to use left mouse button in x,y position.
Im using Sanboxie to run multiple accounts for same games
1. Do you know any software that can send multiple key strokes to the game apps but I 'm still be able to use my PC to surf webs and other works ?
2. Any software that can mimic my main app and send key strokes to multiple accounts at same time , for example when I press run all the accounts will run at the same time ?
hey im having trouble downloading the autoit script itself, i have the autoit finder tool and the tools downloaded but cant find the scripter itself :/
I am learning how to use Autoit, how do you stop a program when its in action?
Hhahahahhaha THIS IS GENIUS I LOVE IT!!!!
can u play other games when pilot is running? dos it bug ur mouse ifnu are using send right clicks(
I am trying to write a script that clicks on a certain position and then moves to several different locations (without letting go).
Would this work with MouseDown and MouseMove together?
Thanks man first good guide i see on making a bot :)
heehee, thank you! I hope you watch my other videos aswell. my goal was just to get people started, and show the basics. it has grown into somthing awsome.
The reason your function wasn't working is because you called it before you made the function... also putting the $ before the variables in the for loop of the function is making new variables with the same names
Could autoit be used with swf files as not a macro? (for example hacked clients etc..)
+EstBest69 yes. you are going to use the same technique that we used to create the IE objects in my other tutorials. ObjCreate... heres a quick example on "how" www.autoitscript.com/forum/topic/99696-make-a-gui-that-loads-a-local-swf-file/
you have really inspired me dude your awesome
+rob smith You're welcome! And Thank you for watching! I hope you stay for all my videos. :3
I have they are really interesting and I want to try to create one for my self one day that would be awesome
also it would be so cool if some how you could talk to your subscribers
+rob smith I do :D. if you contact me via skype I talk. :) I warn you, I'm much more boring in person. (heehee, j/king)
lol that would be awesome
+rob smith my Skype name is the same as my youtube name
Hi i just downloaded AutoIT i understand it hardly i wanna ask you about (width,height) how you know that? i'm using it for RSPS
Hello, Haskins
I Would Like To Ask You Some Problem I Have With Running My Script... IT WON'T RUN! Because My F5 Key Is Set To Refresh And Just Refreshes My Computer! Is There A Manual Way To Run? I Did See One But It Was Set To False.
Tools> Go........(f5)
Bots for Club Penguin... Code how could you dare. :D
R.I.P. Club Penguin
I click the link, but it does not work for me. Why is this? It says "This site cant be reached". Is there any reason why its doing this? Can anyone help? I really wanna start botting :/
Also subscribed and liked the video. I really enjoy your content Mr. Haskins!
The ai seems to use your actual mouse cursor to bot. How do you make the clicking virtual inside of the game?
can i get help with code for a bot i want to make how can i contact u do u got a mail i can send my question to u??
+Sander Heggland You could. Or I could just respond on here. Or you could contact me via skype. Or you could contact me on G+, or facebook, or twiter, or vine, or...... (you get the point. :) im usually avaiable at any time for questions (except when im asleep). Just use CodePrime8 then what ever media you want to contact me on. I think im on everything. if not, you could google CodePrime8. im pretty much then entire first results page.
How would you make it so when you hold down a key, it toggles between 3 positions while holding another key? idk if you can understand this, but like this:if(keyPress("X",number] ) {}I'm trying to spin the mouse around in the centre of my screen on command.
not quite sure I understand. like when you press and hold a key down it starts looping through those position? I would use _isPressed. if the key is true, perform the positions... www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm
Thank you for the fast reply!
I cannot seem to get WinActivate("....") to make the window active. Is there a way to find out what I am doing wrong? I tried a simple code with notepad to send a few letters and enters and that worked fine, but the game I was trying to auto, does not seem to do anything...... I'd love some suggestions. THanks.
Do you need to have the AutoIT program installed to use the script or is the program only used to edit the script ?
If you compile it, then it just runs. But when testing, you use the editor
@@CodePrime8 thank you for fast reply! :) Reason I ask.. want to create macros that can be run on many machines (without installing any software) :)
its possible to create some of bots that stay in spectator and rename them to clan site and server ip ?
for call of duty 4 modern warfare hope you help
when i start the automation and i want it to stop what key do i press?
Hey this looks cool but would it be possible to make a bot for pastebin like it connects with a different proxy every time to make a post?
+Health Haskins is their a way to hold down left mouse button??? sorry if you already mentioned had to skip a bit
+Proskynitis v Yes. use the function MouseDown("left") for the left mouse button, and ("right") or ("center"). Also make sure you move to the position you want. MouseMove.
+Heath Haskins Hello Heath.
i wanted to ask if there is a way to hold down arrow keys instead of pressing them? i Tried what you showed in the video but i cant make my avatar in a game to move. Any help is appreciated.
mahms012 which game? You should be able to use Send ("{LEFT Down}") to start pressing. Then use Send ("{LEFT Up}") TO STOP PRESSING
+Heath Haskins Sorry for bothering you but the game i am playing should be relatively simple to mod, its called pokemon planet .com
All i have to do is make my avatar move by holding up for 3-4 seconds and then down for 3-4 seconds until i encounter a battle. Since you dont know when you will encounter a battle i want the mouse to randomly click on a set place every 2 seconds lets say to automate my attacks. I am not sure if there is an easier way around this but at the moment i cant even make my avatar move. Thanks alot for reading :)
+Heath Haskins Ok my avatar is moving now, i was using the wrong brackets :/
I used the function For $x like you did in the video but i dont know how to make it stop. Even when i close the script the function is still functioning and the keyboard buttons are being pressed so literally dont know how to make it stop. Also if you have played pokemon you would know that you encounter battles randomly so in this case do you think i should set a timer to randomly click at a set place for my attacks? Sorry for bothering you again and any help is appreciated.
You basically hacked Club Penguin
pretty much.
Great video though!
Andrew TUBE Thank you! :)
+Heath Haskins I'm very interested in self self learning AI programs, do you think you could make a video about them?
Where would you download Autoit and all the tools you need to write a bot script ..?
Hi! I've been trying to make a simple bot for a game I am playing at the moment. There is just a few clicks needed, however every 10-30 minutes there is a bot test. Its very easy for a human, but I dont know how to make my bot click the right choises. There will appear 3 items, I am told to click one of the items. Is it a way to make the bot click the right item? There is a variety of like 9 different items. There is no punishment clicking the wrong item, but you will be teleported away from what you're doing. Is there a way to make the bot know when the anti-bot screen appears, so that I can make the bot go back to the location it was botting?
can autoit read a desktop screen ? i mean the hole data of a display?