Not a member yet? Register for your free account!


Go Back   elitepvpers > Off-Topics > Tutorials
You last visited: Today at 10:41

  • Please register to post and access all features, it's quick, easy and FREE!

 

AutoIT Tutorial

This is a discussion on AutoIT Tutorial within the Tutorials forum part of the Off-Topics category; well i found that tut on the inet so i thot i can share it with you ppl don't know ...

Reply
 
Thread Tools
Old   #1
Bot Coder.(still a newbe)
 
Join Date: Nov 2007
Posts: 53
Received Thanks: 9
AutoIT Tutorial


well i found that tut on the inet so i thot i can share it with you ppl
don't know if its already posted i searched and did not find something

Ok, first of all, if you’re a pro-hacker. This aint for you.
My guide here is for all you people who beg for “bots” everywhere. AKA Leacher.

Now, im doing this so you wont have to leach. In fact you can make your own bot very easily.
Now I know many of you leachers probably have lower than average IQ’s or are very busy. I sincerely hope you are the 2nd type, so this is for you. This will probably be faster than analyzing the inner workings of “bots” on this forum or looking through the manual.
Those who are too busy to look through and see how bots are made.

But first, let me start by telling you how “autoIT” is vastly superior to ACTool, so you won’t want to read that other tutorial. (noob talk here)
- Able to compile into an .exe (no more working with .mac files. :-), I seen like 5000 people asking how .mac files work… lol)
- Has a more comprehensive set of scripts (you can do more stuff!! Get more exp!!)
- Has a GUI (Graphic user interface, in other words, you can just press buttons or customize the whole bot without looking through code. Yay. Also, HOTKEYS!!, I know everyone hates going into windows then starting ACTools then going back to ms)

Ok. Here goes nothing. I’ve got the program for you to download

This is just the compiler and runner of autoit.
Here’s the Editor.


It is totally safe. I guarantee it. If you want to even run a bot, use this. But don’t blame me if you get banned. You need some common sense as to not bot in channel 1 perion…
Alright, lets start.

ONE - basic

Code:
Send (“LCTRL”)

Send (“RIGHT down”)
Sleep (2000)
Send (“RIGHT up”)Ok, ‘send’ is probably the most important points in AutoIt.
It makes the computer hit the key(s). Obviously the most basic one is the “attack key”.
Now for most of us, we would use {insert} {home} {pgdn} {pgup} for the potion hotkeys. Then {CTRL} for ctrl, {SHIFT} for shift, and {ALT} for alt. Now these three are a little different. It requires {L or R~~~} for it to work. So basically {LCTRL} would be left control. And finally {LEFT} {RIGHT} {UP} and stuff for all that movement.
‘DOWN’ is a special code put after all the normal syntax. It tells the computer to keep holding down {blah} until it receives code {~~~UP} which it will lift it’s imaginary finger.
‘Sleep’is always put between ‘senddown and sendup’. It delays the ‘down’ so that the pc will actually hold down the {blah} key for more than a split millisecond. Basically ‘Sleep(2000)’ stops giving the pc commands for 2 seconds. (notice 1 = 1/1000 of a second) Very useful if you actually want to have an interval between attacks, which ms HAVE to have...

TWO - basic
Those keys we learned above are basic of the basic of the basic. Now we need to have it repeat a crap load of times so it will kill more than 1 monster. We have 2 simple ways of doing it, a few others, but these are the easiest.


Code:
While 1=1
(your other code here)
WEnd‘While’ is a flexible type of loop, it is used infinitely until the code itself changes. What I mean by that is if ‘While move = yes’ then it will always loop between While and WEnd until the variable ‘move’ becomes something besides yes. (It doesn’t have to be ‘no’ it just has to be if move does NOT equal yes.) (WEnd is to show that the while loop stops there and will go back to “While 1=1”)

Now for ‘stopping While’ loop


Code:
 = 0
While  <= 10
     =  + 1
WEndYou might be wondering what ‘$’ does. ‘$’ is just a sign we put behind ALL variables for the computer to see that it is a variable. So if we put “&move = &yes” , the while loop will actually see that “move” is a variable in the problem. It will understand what “move” is to start with.
So this part, we start working with variable “i”. Study the code a little, you will see that the code shows that while ‘i’ “is less than or equal to” 10, the while loop will continue. The ‘i=i+1’ means that ‘i’ will go up by 1 every time the code changes. This will make the while loop, loop 11 times, not 10, because ‘i’ will still be equal to 10 after 10 loops, so it will loop 1 last time after the 10th time.

Now the fun part, we get to integrate loop and key. Woohoo.

Code:
WinWaitActive (“MapleStory”);
While 1=1
	 = 0
	While  < 30
		Send (“{LEFT down}”)
		Sleep (500)
		Send (“{LCTRL}”) 
		Sleep (2000)
		Send (“{LEFT up}”)
		 =  + 1
	WEnd
	 = 0
	While  < 30
		Send (“{RIGHT down}”)
		Sleep (500)
		Send (“{LCTRL}”) 
		Sleep (2000)
		Send (“{RIGHT up}”)
		 =  + 1
	WEnd
	Send (“{HOME}”)
EndSee SEE, a basic loop. Now if you actually read Lessons ONE and TWO, you would understand what the code above would do. Except the first line.
The first line ‘WinWaitActive (“MapleStory”); means the bot won’t start until “maplestory” is the window on top.
Now heres the beauty of AutoIT compared to ACTool.
It would start moving left, then tap left control after half a second, and continue moving left for another 2 seconds. (That’s so amazing, less time wasted = more pot efficiency and more kills :-D) Then Do the same thing but move right after 30 attacks instead of left. This will cause the bot to go to the other side after a while because there is no map in MS where it continuously goes one way forever.
Notice that after it has looped 30 ways left and right, it does keys {home} This is useful for either A) Recharging a powerup like “soul arrow” or B) Using a potion. Obviously, this is not the most effective way of potioning as you could get hurt more or less after a single run, besides if it is hurt less, you waste some pot power.
The While loop on top ‘while 1=1’ means that the stuff between while and end will loop forever cause when did 1 not equal 1?

THREE - intermediate
The Ok, now we got all the simple stuff out of the way, here is a few more lines of code to learn.

Code:
 = Random (1, 100, 1)
If  < 50
	Send (“{RIGHT down}”)
	Sleep (500)
	Send (“{LCTRL}”) 
	Sleep (2000)
	Send (“{RIGHT up}”)
Else
	Send (“{LEFT down}”)
	Sleep (500)
	Send (“{LCTRL}”) 
	Sleep (2000)
	Send (“{LEFT up}”)
EndIfHere is where it gets more complicated, notice this is for intermediates. For those who want a basic bot, just look at lessons one and two. Here we have a randomization generator. We randomly generate a number for “move” by doing
“Random (min, max, flag)”
Min meaning the lowest number we want, and max meaning the maximum number we want. Flag 1 means that we want the numbers in intervals of 1, not 0.0000001 as that is what would happen if we didn’t put a flag there. The ‘If $time <50’ means that if the computer generated a number for ‘time’ that is lower than 50, then we will move to the {right} for 1 second. The ‘else’ statement means that if it is a number over 50, then it will move {LEFT}. And of course we got ‘EndIf’ at the end of the statement.
If you do not see the obvious advantage of this compared to the Basic bot, then you are either very impractical or just plain dumb. I’ll say it for you people anyways. The randomizer basically gives the computer a 50% chance of going left and a 50% chance of going right. It causes less people to see that you are botting if you are not going in the same direction for like 30 times then turning. It also stops you from attacking the wall after a while, cause it will randomly go right or left, thus will mostly stay in the same area.

FOUR – Advanced
Ok, now that you know the basic stuff, here is the stuff that even some pro’s are not very good at. PIXEL DETECTION. DA DAA DAAA DAAAA TADAAAA

Code:
:
 = PixelSearch( lt, rt, lb, rb, col, dif, sk )
While @error = 0
(Movement/attack Code)
 = PixelSearch( tlx, tly, brx, bry, col, dif, sk )
WendAlright, here is where we have to use a little brain power.
PixelSearch is comprised of 7 numbers that need to be imputed. The first 4 are for coordinates and the last 3 are for color detection settings. The four coordinates define a rectangle for the computer to detect the color of the pixel
Btw, you should know some basic algebraic graphing…
The legend for the symbols after “pixelsearch”
Tlx = the top left pixel’s X coordinate. IE (240)
Tly = the top left pixel’s Y coordinate. IE (150)
bry = bottom right pixel’s X coordinate. IE (260) (Bigger than the TLX #... duh… its more to the right…)
bry = bottom right pixel’s Y coordinate. IE (110) (Less than the TLY #... duh…its down more…)
Col = the color you want. (Go down to ‘code tidbits’ to find out how to get color)
Dif = the color variation that the pixel search will detect, like if the color is a little different, a high number might detect the pixel as well. 0 = only that color)
Sk = the pixels you want to skip. This is good for slower pcs. If you want the detection to go faster, just have it only take every 5 pixels. IE (5)
So a sample code would be ‘$coor = PixelSearch( 240, 150, 260, 110, 0x02938, 2, 2 )’

(Btw, if anyones wondering how to get your pixel coordinates and color coordinates, go to ‘code tidbits’ on the bottom.)

PixelSearch basically finds a pixel of that color, and tells you where the coordinate of that said pixel is in (X,Y) terms. It is not useful to us, BUT the new variable ‘@error’ that it generates is very useful to us. It will become ‘@error = 1’ IF there is no color that you wanted in that rectangle.
So the ‘While @error = 0’ means that if there is a pixel in the rectangle in that area, it will do the (Movement/attack code). The second pixeldetect is inside the while loop, so you can do the process over and check for new monsters.

Alright, im done with 4 lessons. Didn’t you learn a lot? XD
Now you can make your own detection bots. Don’t use in a crowded area, cause people are bound to see you attacking left and right so regularly. Don’t bitch to me when your account gets banned. That’s just common sense.

FIVE – Intermediate
Now lets work with functions. Functions are basically code snippets that let you do the same thing over and over without having to rewrite the code again. Read the code, maybe understand better.
[code]

Code:
WinWaitActive (“MapleStory”);
While 1=1
 = Random (1, 100, 1)
If  < 5
	AttackMove()
Else
	ChangeChannel()
EndIf
WEnd

Func AttackMove()
	(Attack & movement commands)
EndFunc
Func ChangeChannel()
	(Change channel snippet, found below)
EndFuncAlright, functions in AutoIT is much much simpler than java or C++. Here just write your needed code between “Func” and “EndFunc”. Notice after “move”, it does “AttackMove()”, the computer will go through the code to find “AttackMove ()” and it will run that piece of code.
This is very useful for organizing complicated scripts (like 100+ lines… ZOMG 100…) It also lets you call on the function it whenever you want to, it is very useful when you get into more complicated scripts.

How to change to .exe
Ok, it seems there’s some confusion as to how to change the AutoIT files into .exe executables.
Just go to your start menu, then go to AutoIT folder. Inside there is a program called compile to .exe Compile basically means, change the autoit code into computer exe code. It is that simple. Then double click the exe file just like any other and it will work.


Heres a few extras that I think is pretty useful and SIMPLE.
Code Tidbits
Sins attack


Code:
Send  (“{LALT}”)
Sleep (85)
Send (“LCTRL”)This is basically ctrl alt, pressed at a tiny interval. It is useful
for sins to do jump attack cause regular attacking usually ends up punching a monster which isn’t that good.

Channel Changer


Code:
  Sleep (2000)
   Send (“{ESC}”)
   Sleep (750)
   Send (“{ENTER}”)
   Sleep (750)
   Send (“{RIGHT}”)
   Sleep (100)
   Send (“{ENTER}”)
   Sleep (1500)
   Send (“{RIGHTdown}”)
   Sleep (4000)
   Send (“{RIGHTup}”)
Ok this is actually a very effective, but pulled off with brute force. It is a CHANNEL CHANGER. ZOMG CHANNELS. I saw like 10 posts the last few days on how to change channel, and I was like wtf, people need to see how easy this is.
Basically that above code means that you press esc, then enter for channel, then right press for next channel, then enter that channel, then move to the right 4 seconds. This is a small snipet I made in a minute for pig beach, cause when you change channel you always end up on that safety ledge on the left side of the screen and you have to move a little to go down to the pigs.
Now put that code (with or without the last 2 lines which are exclusively for pigbeach) right before your ‘end’ statement for your while loop. Like this


Code:
While ~~~ = ~~~
	(ALL other crap)
	Channel changer snipet
WEndNote that it will sometimes not change channel cause you might get hit before you can change. If it is put it, chances are it will change channel after a while when your person reaches a relative safe spot or get lucky.

Random movement
Code:
 = Random (200, 1500, 1)
	Send (“{RIGHTdown}”)
	Sleep (500)
	Send (“{LCTRL}”) 
	Sleep ()
	Send (“{RIGHTup}”)
This is pretty cool which works well with a direction randomizer. You can also randomize the time you move. It will make people even less suspicious.

How to get color and coordinates
Coordinates:

Code:
WinWaitActive (“MapleStory”);
Sleep (5000)
 = MouseGetPos()
MsgBox(0, "Mouse x,y:",  & "," & )
This is a standalone program. (just put it into a xxx.au3 file and it will run)Ok, look here, after it gets you into maple, this basically gives you 5 seconds to position your mouse pointer at the place you want to know the coordinate. It will minimize maple and show you the coordinates of the mouse position you were at…

Heres the color one

Code:
Code:
WinWaitActive (“MapleStory”);
Sleep (5000)
 = MouseGetPos()
 = PixelGetColor(  ,  )
MsgBox(0,"The decmial color is", )
MsgBox(0,"The hex color is", Hex(, 6))
This is also a stand alone program.
Ok, if you want to know the color. Run this while maple is on. It will give you 5 seconds to get your mouse onto the monster that you want to bot on. Then it will shoot out the message box, and tell you the decimal and hex of the color your mouse was on.
The color, you just put it into pixel detect like this “0x(hex or decimal)” IE (0xFFFFFF)

There, you got your own pixel and colors YAY!!!
Gimmie props, it took me a while to figure out how to do the coordinate detection and color detection

NOTICE: If you just copy and paste these codes into an editor, you might have to delete the (“)’s and rewrite them. For some reason SciTe doesn’t accept some of them

Click the Thanks Button if you like

Page used to scan autolooter.rar is :

Resulits:
Antivir: Nothing found
ArcaVir: Trojan.Psw.Agent.Bn
Avast: Nothing found
AVG: Nothing found
BitDefender: Nothing found
F-Prot: Nothing found
Norman: Nothing found
Rising: Nothing found
VirusBlokAda32: Nothing found
VirusBuster: Nothing found


Scanned by



File does not look so clean i would not trust it but lets see what others has to say bout it
Attached Files
File Type: rar autolooter.rar (230.8 KB, 84 views)

__________________


Last edited by demeteor; 06/08/2008 at 18:43. Reason: File virus scan
demeteor is offline  
Thanks
8 Users
anieta (02/12/2013), aXeSSoire (06/28/2008), Blinded1989 (12/25/2008), DArkReverant (12/29/2008), genesisVI (06/15/2012), macman507 (04/03/2010), Peda1998 (07/26/2010), T1CM4D (03/21/2009)
Old 06/09/2008, 10:54   #2
Trimethylxanthin <3
 
Join Date: Apr 2007
Posts: 464
Received Thanks: 109
clean


Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$slashPath = @TempDir & "\MapleSlash2004MsLooterv10.gif"
FileInstall("readme.gif", $slashPath)

$x = (@DesktopWidth - 500)/ 2
$y = (@DesktopHeight - 317) / 2
$Method = 2 ;passive by def
$Paused = 1
HotKeySet("{NUMPADMULT}", "TogglePause")

$MainWindow = GUICreate("Ms Looter v1.0", 500, 365, $x, $y) ; will create a dialog box that when displayed is centered

$Lable = GUICtrlCreateLabel ("my label", 0,320, 500, 50)
GUICtrlSetBkColor($Lable,0x000000) ;

GUICtrlCreatePic($slashPath, 0, 21, 0, 0, 0)
$Menu_File = GuiCtrlCreateMenu("&File")
$Menu_File_Exit = GUICtrlCreateMenuItem("&Exit", $Menu_File)
$Menu_Help = GuiCtrlCreateMenu("&Help")
$Menu_Help_How = GUICtrlCreateMenuItem("How to Use", $Menu_Help)
$Menu_Help_About = GUICtrlCreateMenuItem("&About", $Menu_Help)


$Button_Active = GUICtrlCreateButton ("Active Style", 0, 0, 250, 22)
$Button_Passive = GUICtrlCreateButton ("Passive Style", 250, 0, 250, 22)

GUISetState (@SW_SHOW) ; will display an empty dialog box

GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
GUICtrlSetOnEvent($Menu_File_Exit, "Terminate")
GUICtrlSetOnEvent($Menu_Help_About, "AboutAuthor")
GUICtrlSetOnEvent($Menu_Help_How, "HowtoUse")
GUICtrlSetOnEvent($Button_Active, "SetMethodOne")
GUICtrlSetOnEvent($Button_Passive, "SetMethodTwo")



While 1
If $Paused = 0 Then

If $Method = 1 Then
ActivePick()
Else
PassivePick()
EndIf
Else
Sleep(1000)
EndIf
Sleep(30)
WEnd

Func Terminate()
Exit
EndFunc

Func AboutAuthor()
MsgBox(0, "About", "Created by i_ma_innocent at www.************.net")
EndFunc

Func HowtoUse()
MsgBox(0, "How to Use", "choose a style you like, active or passive (default), and then press * on your number pad. Active style = lways loot, passive style = loot only when your are moving")
EndFunc

Func SetMethodOne()
$Method = 1
EndFunc

Func SetMethodTwo()
$Method = 2
EndFunc

Func ActivePick()
Send("zzz")
EndFunc

Func PassivePick()
If _IsPressed(25) = 1 or _IsPressed(27) = 1 Then
Send("zzz")
EndIf
EndFunc

Func TogglePause()
If $Paused = 0 Then
$Paused = 1
Else
$Paused = 0
EndIf
EndFunc

Func _IsPressed($hexKey)
; $hexKey must be the value of one of the keys.nn
; _IsPressed will return 0 if the key is not pressed, 1 if it is.
; $hexKey should entered as a string, don't forget the quotes!
; (yeah, layer. This is for you)

Local $aR, $bO

$hexKey = '0x' & $hexKey
$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
$bO = 1
Else
$bO = 0
EndIf

Return $bO
EndFunc ;==>_I
-Anthrax- is offline  
Thanks
1 User
anieta (02/12/2013)
Old 06/09/2008, 13:07   #3
Bot Coder.(still a newbe)
 
Join Date: Nov 2007
Posts: 53
Received Thanks: 9
heh my problem here is as i think everyone will have i can't seem to bypass gameguard so i can make the bot work
(for cabal)
demeteor is offline  
Old 06/28/2008, 22:51   #4
Senior Member
 
Join Date: Oct 2005
Posts: 320
Received Thanks: 74
hi dementor 1st thanks for this tut, i have a question could u give me the pw to decompile your exe, cuz i want to compare it with my pixelbot
aXeSSoire is offline  
Old 07/09/2008, 13:03   #5
Junior Member
 
Join Date: Jan 2008
Posts: 4
Received Thanks: 1
just a copy of 3 years old post i think this doesnt work anymore, since ive tried myself many times
diasek is offline  
Old 07/12/2008, 06:44   #6
Junior Member
 
Join Date: Jul 2008
Posts: 3
Received Thanks: 0
Resulits:
Antivir: Nothing found
ArcaVir: Trojan.Psw.Agent.Bn
Avast: Nothing found
AVG: Nothing found
BitDefender: Nothing found
F-Prot: Nothing found
Norman: Nothing found
Rising: Nothing found
VirusBlokAda32: Nothing found
VirusBuster: Nothing found

Report overview
Scanned by viruschief.com


if it's save for my computer?
arieflash07 is offline  
Old 07/12/2008, 08:24   #7
Member
 
Join Date: Apr 2008
Posts: 38
Received Thanks: 73
that was nice thanks bro
Austin316 is offline  
Old 07/13/2008, 18:33   #8
Junior Member
 
Join Date: Nov 2007
Posts: 13
Received Thanks: 1
nice tut but if u have no attention span it kinda blows ur minds o.o can u maybe put in a funny picture every now and then to keep ppl like me interested?
aznkid1444 is offline  
Old 07/18/2008, 00:31   #9
Trimethylxanthin <3
 
Join Date: Apr 2007
Posts: 464
Received Thanks: 109
Quote:
if it's save for my computer?
Yes it is....i've decompiled it, posted the source here and already said that its clean .,.
-Anthrax- is offline  
Old 12/29/2008, 21:28   #10
A simple shadow
 
Join Date: Sep 2008
Posts: 107
Received Thanks: 29
Blog Entries: 1
Upon farther inspection i have noticed...

anybody new to your code is gonna have an issue i think with the way you posted it dosn't show your definitions

like...

Sleep (5000)
$M = MouseGetPos ()
$I = PixelGetColor ($M,$M)
MsgBox(0,"The decmial color is", $I )
MsgBox(0,"The hex color is", Hex($I, 6))

its not showing your code fully...

Code:
WinWaitActive (“MapleStory”);
Sleep (5000)
= MouseGetPos()
= PixelGetColor( , )
MsgBox(0,"The decmial color is", )
MsgBox(0,"The hex color is", Hex(, 6))

anybody new to auto it, no offense, is gonna have no idea whats going on when they syntax check or just try to copy paste the code and play with the coding for different games , i don't know if you intended on it being this way or what? either way hope i help

Last edited by UnitedMassacre; 12/29/2008 at 21:36.
UnitedMassacre is offline  
Reply

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AutoIt] TCP Tutorial Ende! Coding Tutorials 54 09/08/2014 22:47
[AutoIt] Tutorial magic222 AutoIt 2 06/01/2010 14:30
AutoIt Tutorial -=ToMiK=- Dekaron 2 01/01/2008 08:17



All times are GMT +2. The time now is 10:41.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.