Well over the last few days, I have had people asking how to program, where to get started, seeing people saying "oh im a complete n00b and dont know anything!"
Well. I have decided to make a guide, Just for people like you
And not just another "BLABLABLA COPY THIS INTO A COMPILER AND PRESS START"
But an actual guide which will help you understand, Just how these programs work.
__________________________________________________
Now then.
First you will need a program called Autoit. Downloaded here:
AutoIt Downloads - AutoItScript
Next, Just to give you a basic knowlege of how things work.
Complete these two tutorials on the website.
Tutorial - HelloWorld
Tutorial - Notepad
These two tutorials give you the absolute most basic understanding of how the program works (allowing you to become familiar with opening it, closing it, compiling scripts, running them, ect)
__________________________________________________
Now that you have completed the basic GUI tutorials, Im going to teach you some stuff that is a step up to get you going and help you understand just what commands and input functions cause what effects.
For starters. Lets open up the script editor, And make a new script from scratch.
For the first part of our script, We will add the Absolutely most basic function for any script, Is a hotkey for exiting it!
For those of you who are confused, I will break it down for you.PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
HotKeySet, This represents what hotkey you want the function you are setting up to be assigned to, for this key, we have set it to {ESC} Which is the escape key.
You will notice it says "Terminate" as well.
this is the name of the function tied to the hotkey, It does not have to be named Terminate, Or anything specific at all, It is just the word that binds the hotkey to a function.
Func Terminate()
This line, Means that everything between this line, and EndFunc is going to be, What the function named "Terminate" does. So since our hotkey is to close the program, We will insert. Exit 0 Which represents exiting the program.
__________________________________________________
Now, We have a function for closing out the program with just a simple keystroke, But first, We need something that the script does! For this, We need another hotkey! =P!
Looking back on what we have learned so far, Lets say...Put in something hotkeyed to the Left arrow on the keyboard (Since its used so little)
But wait! We dont have anything put into this command yet!PHP Code:
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
EndFunc
No point in having a key if it does nothing, So, What do you say, We make it type in something Offensive, And then, We will make it send the enter key!
Good! Now the left key, Is set to send You are a nerd! to whoever`s conversation you have open, Either messenger, or in a chatbox / chatroom.PHP Code:
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
Send("You are a nerd!{ENTER}")
EndFunc
And we have a function for exiting the program, But yet again! We have more work to do!
Now we need something to keep it from closing the second it opens.
So next, We will add in a sleep function!
With this in, The application will not close and will continue to act on hotkeys you input until the seriously long time runs out, Or until you close the program yourself.PHP Code:
Sleep(20000000)
Now then, Lets put all of this together!
Now save the script, And you can go to dropdown menu at the top of autoit`s editor, And click on "Tools" Where you can choose to either Compile the script into an exe file, Or you can just click Go, Which will run the lines of code instantly for a quick test run!PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
Send("You are a nerd!{ENTER}")
EndFunc
Sleep(20000000)
After you run the program, Just open up either notepad or an instant messenger window with a friend, And give it a shot! Either by pressing the left arrow on your keyboard, Or holding it down for superfast spam.
__________________________________________________
Now, I know your feeling cocky "I just made my first program!"
Well what good is it when you can only send the same line over and over and over?
No good at all! So lets fix that and add to the script!
Go ahead and completely get rid of that line that says.
"Send("You are a nerd!{ENTER}")"
And we will replace it with something new!
Now then, Let me explain how this works.PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
$file = FileOpen("temp.txt", 0)
$line = FileReadLine($file, 1)
Send($line, 1)
FileClose($file)
Send("{ENTER}")
EndFunc
Sleep(20000000)
$file = FileOpen("temp.txt", 0)
This part, Represents a text file that will be added by a script your going to add soon.
By inputing this function, Your program will have the text file open in its memory and recognize $file, As being, temp.txt
$line = FileReadLine($file, 1)
This part, Represents a line that is going to be read inside of the file.
Send($line, 1)
This represents, what line in the file is going to be sent.
FileClose($file)
This file. Closes the file allowing you to open a new one for other parts of the script.
Send("{ENTER}")
This one should be obvious, It sends the enter key!
_________________________________
Now with all of that out of the way, We need to have a text file created and readable each time you open it! So its time to do some more editing!
Now I will take the time to explain what we just added!PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
$file = FileDelete("temp.txt")
$passwd = InputBox("Can o Spam", "What will you spam today master?", "", "", "250", "120")
$file = FileWriteLine("temp.txt", $passwd)
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
$file = FileOpen("temp.txt", 0)
$line = FileReadLine($file, 1)
Send($line, 1)
FileClose($file)
Send("{ENTER}")
EndFunc
Sleep(20000000)
$file = FileDelete("temp.txt")
This will delete a previously existing temp.txt file, Preventing you from writing to multiple lines or accidentally gathering from a previous spamming. Definitely needed.
$passwd = InputBox("Can o Spam", "What will you spam today master?", "", "", "250", "120")
Now, This is a box input for every time you open the program, Where you can type in just what you want! Can o Spam represents the windows name, what will you spam today master? represents what the window says. And 250 120 represent the dimensions of the box itself in pixels, And $passwd represents the text you put into the box. We will be saving it to a notepad for safe keeping.
$file = FileWriteLine("temp.txt", $passwd)
This, the text input in action, Writing the information from the input box to a text file. For safekeeping =P
The completed script at this point, Should look like this!
_________________________________PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
$file = FileDelete("temp.txt")
$passwd = InputBox("Can o Spam", "What will you spam today master?", "", "", "250", "120")
$file = FileWriteLine("temp.txt", $passwd)
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
$file = FileOpen("temp.txt", 0)
$line = FileReadLine($file, 1)
Send($line, 1)
FileClose($file)
Send("{ENTER}")
EndFunc
Sleep(20000000)
Doesn't that look cute?
A small little line with such potential!
But for those who know me, I am never happy and always want it to be better and more perfect! <3
So lets move a few lines around, And remove a few lines!
Lets completely remove FileClose($file)
and lets move these lines out of the hotkey and up above it!
Now instead of opening the file every time you press the spam key, It only opens it at the very start of the program, And pressing the left key, Only sends from the notepad`s line.PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
$file = FileDelete("temp.txt")
$passwd = InputBox("Can o Spam", "What will you spam today master?", "", "", "250", "120")
$file = FileWriteLine("temp.txt", $passwd)
$file = FileOpen("temp.txt", 0)
$line = FileReadLine($file, 1)
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
Send($line, 1)
Send("{ENTER}")
EndFunc
Sleep(20000000)
_________________________________
Well you know what? I STILL dont like how clean the code looks in this cute little script. So lets make it even smaller and cleaner.
Lets completely remove the temporary text file out of the program!
Get rid of ALL of these files!
$file = FileDelete("temp.txt")
$file = FileWriteLine("temp.txt", $passwd)
$file = FileOpen("temp.txt", 0)
$line = FileReadLine($file, 1)
Send($line, 1)
FileClose($file)
Now, Return back to your function tied to the left arrow, And replace it with a very simple line.
When you are done, It should look, Exactly like this.PHP Code:
Send($passwd, 1)
Now go ahead and compile your script into an EXE file and test it out, And when you run it, You should be greeted with this screen!PHP Code:
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
$passwd = InputBox("Can o Spam", "What will you spam today master?", "", "", "250", "120")
HotKeySet("{LEFT}", "KingSpam")
Func KingSpam()
Send($passwd, 1)
Send("{ENTER}")
EndFunc
Sleep(20000000)
Type in what you want to spam to someone, Hold the left arrow on your keyboard, And bam! It will send endlessly! =P
Now I bet your wondering "Why did you make me do all of these methods when I could have just avoided the whole part about using notepad?
Well, I could be a jerk and say "I love jerking people around just to make them work harder" But, The honest answer is.
this is a tutorial to help teach you about programming and getting you into building applications to use, If I showed you one simple way to do it, Then you would come back some day and go "oh wow I wish I knew how to do this and this and blablabalbla"
So now, Instead of just knowing how to use input from a textbox and turn it into a way to spam someone endlessly. You now know how to do more advanced tasks such as saving data inputted to a textfile. And you also now know how to read from that text file! And delete it!
It may have seemed complex, Or going way out of the way at the moment to learn one simple task, But what it comes down to, Is you are Smarter now, And will be able to contribute more in the future faster.
_________________________________
In conclusion.
This has been a guide for learning to program/script with AU3.
More will come in the future if you are up for the challenge, But for now, Experiment, Study documentation online, and examine the function list for this on the Autoit online documentation webpage.
If you have questions, Feel free to ask and I will do my best to service you.
Oh and.
Happy Spamming.
~Aleena
Results 1 to 6 of 6
- 30 Jun. 2011 03:37pm #1
[AU3] Programming made simple! [Lesson One!] Message Spammer!
- 22 Oct. 2011 07:20pm #2
once i saw this my eyes started to hurt
Last edited by codes; 22 Oct. 2011 at 07:55pm.
- 22 Oct. 2011 07:33pm #3
- 22 Oct. 2011 07:55pm #4
never noticed my spelling was wrong
- 23 Oct. 2011 01:56pm #5
finally igot it +rep
---------- Post added at 01:56 PM ---------- Previous post was at 01:41 PM ----------
does the words show up in a text
- 06 Jan. 2012 07:05pm #6
I did it ! Im so proud of my self small step into the right direction