HomeForumHelpSearchLoginRegister

Login with username, password and session length
 
Pages: [1]
  Print  
Author Topic: Macro Tutorial  (Read 1016 times)
dark_lord
Newbie
*
Posts: 2


View Profile Email
« on: September 26, 2008, 12:32:59 AM »

Hi !

I wanted to know if it is possible to have more than one macro in the same program...
Logged
Admin
Administrator
*****
Posts: 59


View Profile WWW Email
« Reply #1 on: September 30, 2008, 10:29:04 PM »

Of course...you would only need to use more functions and hotkeys. If you want two macros for example, you could use:

Code:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.1
Author: www.d3portal.com
   Name: Simple Macro Tutorial


#ce ----------------------------------------------------------------------------

Opt('SendKeyDelay', 205) ; Default is 5
Opt('SendKeyDownDelay', 195) ; Default is 5
Opt('MouseClickDownDelay', 35) ;Default is 10

HotKeySet("{F11}","cast")
HotKeySet("{F12}","function2")
HotKeySet("{F10}","end")

While 1
Sleep(100) ; I put a sleep here so our script doesn't use 100% of the CPU.
WEnd


Func cast()
Send("W")
Send("{F6}")
MouseClick("Right")
MouseClick("Right")
Sleep(100)
Send("{F7}")
MouseClick("Right")
MouseClick("Right")
Sleep(300)
Send("W")
Sleep(200)
Send("{F5}")
MouseClick("Right")
MouseClick("Right")
Sleep(100)
Send("{F2}")
EndFunc

Func function2()
        ;Some code here
EndFunc

Func end()
Exit
EndFunc



There you go
Logged
Tregan
Newbie
*
Posts: 1


View Profile Email
« Reply #2 on: May 03, 2009, 08:06:03 AM »

Thenks
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
© 2008-2009 D3portal