Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» ~=?{The future is here, TastyExploit officially open to the public}?=~
Tue Mar 02, 2010 11:00 pm by Dami

» My first aa script
Tue Mar 02, 2010 7:00 am by wafflemaster

» the real story behind Maverin
Tue Mar 02, 2010 1:33 am by SoundOfDeat

» Random spam
Mon Mar 01, 2010 11:52 pm by Danny1994

» [Request] EMS v56 Exe
Mon Mar 01, 2010 12:39 am by Dami

» [Blacklist] NX-Trading Blacklist.
Mon Mar 01, 2010 12:38 am by Danny1994

» I have a question regarding the meso farmer
Sat Feb 27, 2010 10:30 pm by Dami

» What are you listening to now?
Sat Feb 27, 2010 7:57 pm by Noname111111

» Video(s) Of The Day
Sat Feb 27, 2010 7:37 pm by Noname111111

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
free forum
 



[Tut] AutoIT Advanced Tutorial

View previous topic View next topic Go down

[Tut] AutoIT Advanced Tutorial

Post by SoundOfDeat on Tue Feb 09, 2010 3:00 am

Hello Dafo, this is my tut about AutoIT V3, I will teach you the basic of AutoIt in a few steps, I'm also gonne learn you some other functions that might be helpfull. Also I am still updateing this tread. Lets start!

Open a new script, I will start learning you make a minigame with massage boxes.

Index:

Part 1 = MsgBox Functions
Part 2 = Sleep Functions
Part 3 = Loop Functions
Part 4 = Hyperlink Functions
Part 5 = Beep Function
Part 6 = Koda (Formdesign)
Part 7 = Hotkeyset Function & Your fist tool
Part 8 = Call Functions
Part 9 = All tests

--------------------------------------------------------------------------

Part 1, MsgBox functions (Basic)

Spoiler:


Type:

Code:

MsgBox (0,"Test","This is my 1st minigame")

MsgBox = Massage Box
0 = The flag, what kind of massage box.

Code:

0 = OK button
1 = OK and Cancel
2 = Abort, Retry, and Ignore
3 = Yes, No, and Cancel
4 = Yes and No
5 = Retry and Cancel
6 = Cancel, Try Again, Continue

"Test" = The name of the massage box
"This is my 1st minigame" = The tekst that will come in the massage box.


Type:

Code:

MsgBox (0,"Test","This is my 1st minigame")
MsgBox (4,"Test","Yes or No?")

Code:

4 = Yes & No massage box.

Allright, now when you save the script and run it, you will get a massage box with a OK button: This is my 1st minigame. When you click on Ok, you will get another massagebox with Yes & No. But nothing happens when you click on Yes or No, and we want to change that.

We will give: MsgBox (4,"Test","Yes or No?") a name, how do we do that? with $.

Code:

$1 = MsgBox (4,"Test","Yes or No?")

It doesn't have to be 1$ it can be anything you want to but dont forget to put the $ behind.

Alright now we are gonne work with:

Code:

if
EndIf

Code:

MsgBox (0,"Test","This is my 1st minigame")
$1 = MsgBox (4,"Test","Yes or No?")

if $1 = 6 Then
MsgBox (0,"Test","You clicked on Yes")
MsgBox (0,"Test","You did not click on No")

Endif

$1 = the name of the msgbox above, and 6 = “Yes” button in AutoIt.

if $1 = 7 Then
MsgBox (0,"Test","You clicked on No")
Endif

$1 = the name of the msgbox above, and 7 = “No” button in AutoIt.

Code:

Ok = 1
Cancel = 2
Abort = 3
Retry = 4
Ignore = 5
Yes = 6
No = 7
Try Again = 10
Continue = 11

So when you press on Yes (6) you will get a msgbox with: You clicked on Yes, and after that, you get a msgbox with: You did not click on No.
And when you click on No (7) you will get a msgbox with: You clicked on No.

Only when you click on Yes/No you will get that msgbox.

NOTE: You can not name a msgbox the same everytime, if you used: $1 = msgbox, you can not use $1 for a other msgbox, then it has to be $2 or $whateveryouwant
MsgBox Test
Spoiler:

Test:

Alright, I will give you a little test now, you may PM me the script, and I will send you a reply back what you did wrong, or if its correct.

Alright

make 4 Ok massageboxes, with the title: “This is my first test”
Tekst may be anything, but it has to be real words.

Make 2 Yes/No massageboxes, I want if you click Yes you get 2 Ok massage boxes and if you click on No 2 Ok massage boxes.

Make 1 Ok/Cencel massagebox, I want if you click on Ok, you get one Ok massagebox, if you click on cencel the program must close.

NOTE: You do not have to do this, this is a test for yourself.

--------------------------------------------------------------------------

Part 2, Sleep Functions


Spoiler:


Alright, now I will start with the function “sleep”

The function sleep allows you to pause the script for a while.

Code:

Sleep (1000)

It will sleep 1000 miliseconds now (that is one second) for example you can do this:

Code:

$1 = MsgBox (4,"Test","Click yes and I will sleep, click No and I will tell you how long I will sleep.")

If $1 = 6 Then
Sleep (2000)
MsgBox (0,"I woke up","I woke up")
EndIf

If $1 = 7 Then
MsgBox (0,"Sleep","I am gonne sleep 3 seconds now")
Sleep (3000)
MsgBox (0,"I woke up","I woke up")
EndIf

You can copy this script if you want and test it, or change some fuctions. You can also do this:

Code:

Sleep (1) * 1000

Now it will sleep 1 second, * 1000 = x 1000, 1 x 1000 = 1000 so it will sleep 1000 miliseconds (1second)
Sleep Test
Spoiler:


Test:


Alright, I will give you a little test now, you may PM me the script, and I will send you a reply back what you did wrong, or if its correct.

I want you make a msgbox with a Yes/No button, when I click on Yes the script must sleep 5 seconds, when I click on No the script has to sleep 3 seconds, and you may NOT use numbers that are bigger then 10.

After that 5 or 3 seconds I want a ok msgbox with Hello as title and text, when you clik on Ok, the script must sleep 2 seconds, and you MUST use numbers that are bigger then 1000.

After that I want a msgbox with Exit as title and nothing as tekst.
--------------------------------------------------------------------------

Part 3, Loop Functions


Spoiler:


Alright I will teach you 2 kinds if loops,

Code:

While 1
Wend

&

For
Next

Lets start with While 1.

Example:

Code:

While 1
MsgBox (0,"Loop","This is a Loop")
Sleep (1000)
$2 = MsgBox (4,"Exit","Would you like to exit the loop?")

If $2 = 6 Then
ExitLoop
EndIf

If $2 = 7 Then
MsgBox (0,"Ok","Ok")
EndIf

Wend

MsgBox (0, "Exit","You exited the loop")

Alright, The moment you typed: While 1, the loop starts, if you don’t make a function to exit the loop, You can only exit the program to right click on the right bottom at the autoit icon, and exit script. So first you will get a MsgBox with: This is a Loop, then it will pause 1 second, then you get a choice, if you click Yes you will exit the loop.

If $2 (the name of the MsgBox) = 6 (Yes) Then
ExitLoop (Exit the loop)
EndIf ( Ends the function)

If you click on No you will get a MsgBox with Ok.

If $2 (the name of the MsgBox) = 7 (No) Then
MsgBox (0,"Ok","Ok")
EndIf (Ends the function)

After that you will get to the line “Wend” Wend meands it will go back to while 1, while 1 always needs a wend or it will give an error. No the script will restart.

Alright now I will explain how to Use

Code:

For
Next

For $i = 5 to 1 Step -1

MsgBox (0, "CountDown", $i)

Next

MsgBox (0, "No Loop","You will get this massage 1 time and then I will exit")
[/Code]

Alright, you wil get 5 times the same massage, and then the script will continue and you will get a other massage. If you change 5 to 10 for example, you will get that msgbox 10 times. So when the script reaches Next it will continue.

--------------------------------------------------------------------------

Part 4, Hyperlink Function

Spoiler:


Ok this is really simple, I will teach you how to create a hyperlink in a tool/program.

You may just copy this:
Or you can make your own “Program” in Koda (Formdesign)

I will teach you how to use Koda (Fordesign) later so just copy this and paste it in a clean script.

Code:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
[B]#include <IE.au3>[/B]
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Hyperlink", 200, 63, 302, 218)
$Group1 = GUICtrlCreateGroup("HyperLink", 8, 8, 185, 49)
[B]$Label1 = GUICtrlCreateLabel("http://damiproductions.darkbb.com", 16, 32, 171, 17)[/B]
[B]GuiCtrlSetColor($Label1, 0x0000FF)
GUICtrlSetCursor (-1, 0)[/B]
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         Exit

   EndSwitch

If $nMsg = $Label1 Then
   _IECreate ("http://damiproductions.darkbb.com", 1, 1, 0)
EndIf

WEnd

Code:

nMsg = on click

So If $nMsg = $label1 Then

Means: If you click on $label1 (http://damiproductions.darkbb.com) it will auto open internet and link you to that site, but only if you have this bellow it:

Code:

_IECreate ("http://damiproductions.darkbb.com", 1, 1, 0)

You can replace http://damiproductions.darkbb.com by a other site if you like to, then it will link to that site if you click on it.

#include has to be there to let _IECeate work.


GuiCtrlSetColor($Label1, 0x0000FF) makes $Label1 (http://damiproductions.darkbb.com) blue (color of a hyperlinks)

GUICtrlSetCursor (-1, 0) sets curser to an hand, when you move on $label1, so people will notice that it is a hyperlink.

NOTE: A if function must always be between EndSwitch and Wend. Or it wont work.

I will not explain more about this because its really simple to understand.

So this should be the end result:

Code:

If $nMsg = $label1 Then
_IECreate ("http://damiproductions.darkbb.com", 1, 1, 0)
EndIf

--------------------------------------------------------------------------

Part 5, Beep function

Spoiler:


This is not very usefull, but I am still gonne teach you this because it can be usefull to allert you.

Open a new script and wright this:

Code:

Beep (1000,3000)

1000 is the frequentie
3000 is 3 seconds, how long the beep is on.

Example:

Code:

$name = MsgBox (4,"Beep”,”Do you want to know a secret?")

If $name = 6 Then
Beep (1000,3000)
EndIf

If $name = 7 Then
MsgBox (0,"Beep","I’m still gonne tell you")
Beep (1000,3000)
EndIf

You need to have your sound on to hear the beep, your computer makes a sound “Beep” Thats all I can tell about it.

A other example: you can make a attack counter, but you don’t know how to make a U/A, so when you reach 100 attacks you get a Beep, then you know you have to move.
--------------------------------------------------------------------------

Part 6, Koda (FormDesign)

Spoiler:


Alright, click on tools, and then on “Koda (FormDesign)” now there will pop up a screen with allot of .

I will not fully explain Koda, because this is very easy to understand.
I want you to make a simpel desgin.
[Spoiler=Test]

The title of the tool/program we are gonne make has to be: My first AC

How to do this: Click on Form1 at the left, and change the name of Caption to: My first AC. Now you will see that the name changes, do not do anything with Name leave that as it is.

Now make a group: the name of the group has to be: AutoClicker
In that group you make a label, name that label to: AutoClicker
Behind the label that you named: AutoClicker, you make another label called Off.
Now form the group and Form1 to a small window.

Now it looks something like this: Picture

Ok, save this, if you did that press F10.

Alright, now you got this:

Code:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("AC", 162, 63, 302, 218)
$Group1 = GUICtrlCreateGroup("AutoClicker", 8, 8, 145, 49)
$Label1 = GUICtrlCreateLabel("AutoClicker", 32, 32, 58, 17)
$Label2 = GUICtrlCreateLabel("Off", 112, 32, 18, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         Exit

   EndSwitch
Wend

--------------------------------------------------------------------------

Part 7: Hotkeyset & Your first tool

Spoiler:


Code:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

HotKeySet("{F1}","AC")

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("AC", 162, 63, 302, 218)
$Group1 = GUICtrlCreateGroup("AutoClicker", 8, 8, 145, 49)
$Label1 = GUICtrlCreateLabel("AutoClicker", 32, 32, 58, 17)
$Label2 = GUICtrlCreateLabel("Off", 112, 32, 18, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         Exit

   EndSwitch

Global $ACL = False

Wend

F1 = what key you activate the script.
ACL = the name of the function its gonne activate
Global $ACL = False = that the function is off, we gonne need this for later.

Alright now type bellow “Wend”

Code:

Func ACL()

Example:

Code:

Wend

Func ACL()

We are gonne start with changing some Data, we are gonne change Off to: On, and we are gonne change the color from black to green.

Code:

GUICtrlSetData($Label2, "On")
GUICtrlSetColor($Label2, 0x00FF00)

Alright, now we done that, we are gonne activate the AC

Code:

$ACL = Not $ACL
If $ACL = True Then

$ACL = Not $ACL = that you $ACL is True, and you can make it false with the same hotkey (True = on, False = Off) its hard to explain tough.

If $ACL = True Then = If $ACL is on then run this script.

Your still following me?

Now type this:
Code:

Do

MouseClick("Left")

Until $ACL = False

Do/Until = another kind of loop, it keeps doing MouseClick("Left") until you stop it (With the hotkey F1)

Because there is no “Sleep” it will click on max speed. But! We are not done yet.
Bellow “Until $ACL = False you wright this:

Code:

GUICtrlSetData($Label2, "Off")
GUICtrlSetColor($Label2, 0x000000)

If you put the AC Off (False) $Label2 (Off) that we changed to “On” at the top, back to Off. The color we changed to green at the top we change back to Black.

Code:

Color:

0x0000FF = Blue
0x00FF00 = Green
0xa0FFa0 = Light Green
0xFF0000 = Red
0xFFFFFF = White
0xF08080 = Pink
0x000000 = Black

To end the script you wright:

Code:

EndIf
EndFunc

So now it must look something like this:

Code:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("AC", 162, 63, 302, 218)
$Group1 = GUICtrlCreateGroup("AutoClicker", 8, 8, 145, 49)
$Label1 = GUICtrlCreateLabel("AutoClicker", 32, 32, 58, 17)
$Label2 = GUICtrlCreateLabel("Off", 112, 32, 18, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         Exit

EndSwitch

HotKeySet("{F1}","ACL")

Global $ACL = False

WEnd

Func ACL()
GUICtrlSetData($Label2, "On")
GuiCtrlSetColor($Label22, 0x00FF00)

$ACL = Not $ACL
If $ACL = True Then

Do

MouseClick("Left")

Until $ACL = False

GUICtrlSetData($Label1, "Off")
GuiCtrlSetColor($Label22, 0x000000)
EndIf
EndFunc

Save it and compile your script now run it. You made your fisrt AutoClicker!

--------------------------------------------------------------------------

Part 8 Call functions:

Spoiler:


Alright let me give a little discription about the Call funtion, the Call function will call a Func, and nothing more, for example:

Code:

Helloworld()

Func helloworld()

MsgBox (0,”HelloWorld!”,”This is my world!”)

EndFunc

$1 = MsgBox (4,”Repeat?”,”Do you want to repeat?”)

If $1 = 6 Then
Call (“HelloWorld”)
EndIf

If $1 = 7 Then
MsgBox (0,”Alright”,”I am gonne Exit now”)
EndIf

Alright, first you will get a MsgBox with: This is my world! Then you get another MsgBox with a question if you would like to repeat it, when you press Yes (6) it will Call the Func HellowWorld, really easy to understand huh . When you click on No you get a MsgBox with: I am gonne Exit now. And its gonne Exit.
--------------------------------------------------------------------------

Part 9 Tests:

MsgBox Test
Spoiler:

Test:

Alright, I will give you a little test now, you may PM me the script, and I will send you a reply back what you did wrong, or if its correct.

Alright

make 4 Ok massageboxes, with the title: “This is my first test”
Tekst may be anything, but it has to be real words.

Make 2 Yes/No massageboxes, I want if you click Yes you get 2 Ok massage boxes and if you click on No 2 Ok massage boxes.

Make 1 Ok/Cencel massagebox, I want if you click on Ok, you get one Ok massagebox, if you click on cencel the program must close.

NOTE: You do not have to do this, this is a test for yourself.

Sleep Test
Spoiler:


Test:
Alright, I will give you a little test now, you may PM me the script, and I will send you a reply back what you did wrong, or if its correct.

I want you make a msgbox with a Yes/No button, when I click on Yes the script must sleep 5 seconds, when I click on No the script has to sleep 3 seconds, and you may NOT use numbers that are bigger then 10.

After that 5 or 3 seconds I want a ok msgbox with Hello as title and text, when you clik on Ok, the script must sleep 2 seconds, and you MUST use numbers that are bigger then 1000.

After that I want a msgbox with Exit as title and nothing as tekst.
The big test!
Spoiler:


Test:

Alright, in this test I will ask allot of things you should know by now.

First I want a Yes/No msgox with the title: Question and as text: Is this my 1st test?

When you click on Yes I want to see a countdown from 8 to 0 and after that countdown a Beep that is 1 second long. When the Beep is done I want a Yes/No MsgBox with a question Again? When you click on Yes it has to do the countdown again, when I click on No, it has to sleep 3 seconds and then a Ok MsgBox with Ok, and then it exits.

When you click on No I want to see a Ok MsgBox with as text: I am gonne sleep 10 seconds after that I want to see a little Koda form design with a hyperlink in it that works.
avatar
SoundOfDeat
Silver Member
Silver Member

Posts : 397
Join date : 2009-11-08
Age : 23
Location : Loging in....

http://damiproductions.darkbb.com

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by Dureitor on Tue Feb 09, 2010 1:34 pm

nice tutorial.
I have problems with autoit, my bot works fine but if I'm on msn keyboard goes mad, as if he were pressing the shift key.

but now use a bot made in C # would like to know to be the problem, if there is any way to fix

thanks in advance and forgive my poor English

Dureitor
New member
New member

Posts : 38
Join date : 2009-08-17

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by Eltax on Tue Feb 09, 2010 4:10 pm

[Tut] AutoIT Advanced Tutorial ?

You should rename. This isnt any advanced stuff...
avatar
Eltax
New member
New member

Posts : 53
Join date : 2009-11-30
Location : Denmark

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by Dami on Tue Feb 09, 2010 5:11 pm

Change the learn words to teach, as you cannot learn for other people. But you can teach them Razz
avatar
Dami
Dragon
Dragon

Posts : 1414
Join date : 2009-08-10
Age : 27
Location : Finland

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by SoundOfDeat on Tue Feb 09, 2010 11:42 pm

I will do that in a min Dami Razz

@Dureitor, don't use capitals, and your shift bug should be fixed, had the same problem.
avatar
SoundOfDeat
Silver Member
Silver Member

Posts : 397
Join date : 2009-11-08
Age : 23
Location : Loging in....

http://damiproductions.darkbb.com

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by Dureitor on Wed Feb 10, 2010 1:50 am

SoundOfDeat wrote:I will do that in a min Dami Razz

@Dureitor, don't use capitals, and your shift bug should be fixed, had the same problem.
not use capital letters, that's not explained to me to be the problem, for example use this car attack
Code:
ControlSend("MapleStory", "", "", "{a}")

in principle have no problem, but the problem is after 15 min or 30 min, only if I am chatting or writing something

Dureitor
New member
New member

Posts : 38
Join date : 2009-08-17

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by SoundOfDeat on Fri Feb 12, 2010 1:17 am

Then the loop is still running I gues, or isn't that where yr talking about?
avatar
SoundOfDeat
Silver Member
Silver Member

Posts : 397
Join date : 2009-11-08
Age : 23
Location : Loging in....

http://damiproductions.darkbb.com

Back to top Go down

Re: [Tut] AutoIT Advanced Tutorial

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum