Jump to content

Very Basic Script help :)


Salryn
 Share

Recommended Posts

Hiya, I just got AutoIT-3 in an attempt to make what I hope to be a very simple macro, heres what I want it to do, I play an MMORPG (online game) and I have to press about 8 keys 1 pause 2 pause 3 and so on so I would like to make a script that does it for me then stops, I would like it to also be done via a hotkey, here is what I want it to do

The hotkey would be nice if it was Ctrl+Shift B

<> Macro Start <>

Type /g Buffing Inc on << %td >>

Press Shift 2

Press 1

Pause 3

Press 2

Pause 3

Press 3

Pause 3

Press 4

Pause 3

Press 5

Pause 3

Press 6

Pause 3

Press Shift 1

<> Macro End <>

could anyone spare a little of there time to make that and compile it? I havnt got a clue how to do it

Edited by Salryn
Link to comment
Share on other sites

Link to comment
Share on other sites

ok here we go

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

AutoIt Version: 3.2.2.0

Author: myName

Script Function:

Template AutoIt script.

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

; Script Start - Add your code below here

WinWaitActive("Vanguard: Saga of Heroes")

Send("1")

WinWait("3") **broken here**

Send("2")

WinWait("3")

Send("3")

WinWait("3")

Send("4")

WinWait("3")

Send("5")

WinWait("3")

Send("6")

WinWait("3")

Send("7")

WinWait("3")

Send("8")

I just worked out that WinWait isnt the pause command.. but I cant find what is Iv searched "Wait" "Pause" "WinPause" "WinWait" "Hold" "WinHold"

Edited by Salryn
Link to comment
Share on other sites

Getting there, except for it wont work any longer.. :whistle: wont run I got it to type something in the game but now its nay working laddy

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

AutoIt Version: 3.2.2.0

Author: myName

Script Function:

Template AutoIt script.

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

; Script Start - Add your code below here

WinWaitActive("Vanguard: Saga Of Heroes")

Send("/g Starting Buffs on %td {Enter}")

Send("+2")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("6")

Sleep("2500")

Link to comment
Share on other sites

Kind of anoying how I have to keep making another reply as I cant edit my post.. oh well I have it working! and it works splendedly :whistle: however I now need to run it in the background and press a hotkey when I need to run it, could you help me out with that little bit please Bert, iv look at the hotkey section of the help file but it doesnt contain the string for making it start it just says like pause and terminate the script I just want it to start and then when its done go into standby mode so I can press it again when I need it :)

Link to comment
Share on other sites

Kind of anoying how I have to keep making another reply as I cant edit my post.. oh well I have it working! and it works splendedly :whistle: however I now need to run it in the background and press a hotkey when I need to run it, could you help me out with that little bit please Bert, iv look at the hotkey section of the help file but it doesnt contain the string for making it start it just says like pause and terminate the script I just want it to start and then when its done go into standby mode so I can press it again when I need it :)

Use the HotkeySet to call a function:

Like

HotkeySet ("{LALT}", "MyFunction")

While 1
Sleep (100)
Wend

Func MyFunction ()
;Do Stuff...
EndFunc
Link to comment
Share on other sites

Ok so check this for me, Im not quite understanding it, thats alot of new stuff for me to look at in a short space, say CTRL LSHIFT and Q to run the macro how would it look?

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

AutoIt Version: 3.2.2.0

Author: myName

Script Function:

Template AutoIt script.

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

; Script Start - Add your code below here

HotkeySet ("{LALT}", "MyFunction")

While 1

Sleep (100)

Wend

Func MyFunction ()

;Do Stuff...

EndFunc

WinWaitActive("Vanguard: Saga of Heroes")

Send("+2")

Send("/g Buffing %td{!} {Enter}")

Send("1")

Sleep("2500")

Send("2")

Sleep("2500")

Send("3")

Sleep("2500")

Send("4")

Sleep("2500")

Send("5")

Sleep("2500")

Send("/g Buffing complete on << %td{!} >> {Enter}")

Send("+1")

Link to comment
Share on other sites

Read up on Send() they have all the controls... "#r" = Windows + R......

You have really been making this kid work for his code haven't you :whistle:

Let me give you a little help.

Hotkeyset binds a key to a function. Functions are created and defined through "Func...EndFunc" statements

The last bit of code you posted was very close to doing exactly what you want. However, notice where it says ";Do Stuff" in that code. That should be where you put what you want the function to do when called.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...