Jump to content

Recommended Posts

Posted

Hi,

I want to let my AutoIT script send the following sentence:

/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end

But this doesn't works:

Send("/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end")

I looked into the helpfile but couldnt figure it out.. anyone can help me out?

Posted

Send('/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end')

Notice the single quotes

Posted

Hi,

I want to let my AutoIT script send the following sentence:

/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end

But this doesn't works:

Send("/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end")

I looked into the helpfile but couldnt figure it out.. anyone can help me out?

Look at the syntax colouring, green is supposed to be string.
Posted

I found a problem, when I execute the script it types Ä instead of A:

/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD1", "TURNLEFT"); SetBinding("NUMPAD2", "MOVEFORWARD"); SetBinding("NUMPAD3", "TURNRIGHT"); else SetBinding("NUMPAD1"); SetBinding("NUMPAD2"); SetBinding("NUMPAD3"); end

Becomes:

/script if ( GetMinimapZoneText() == "Älterac Valley" ) then SetBinding("NUMPAD1", "TURNLEFT"); SetBinding("NUMPAD2", "MOVEFORWARD"); SetBinding("NUMPAD3", "TURNRIGHT"); else SetBinding("NUMPAD1"); SetBinding("NUMPAD2"); SetBinding("NUMPAD3"); end

How can I solve this ?

Posted

Try using the 2nd parameter of sending raw characters.

Sorry but I'm not that good in AutoIT, what do you mean with second parameter?

Posted (edited)

Send ( "keys" [, flag] )

flag

[optional] Changes how "keys" is processed:

flag = 0 (default), Text contains special characters like + and ! to indicate SHIFT and ALT key-presses.

flag = 1, keys are sent raw.

Send('/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end', 1)

'' and "" can be used interchangeably

Edited by gamepin126
Posted

Send('/script if ( GetMinimapZoneText() == "Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end', 1)

'' and "" can be used interchangeably

Thanks, but after I tried this it still inserted a Ä instead of A :) any other idea?
Posted

Suppose you are sending to a console type of screen with a shirt-state issue. You could try using ControlSend() or search the forum for _ControlSendPlus() UDF (user defined function) made by Pekster.

Posted

I figured that it has to do with "A

It first fires " then A

and if you do that on the keyboard you get Ä

but if you do the same with N you get "N

So it should first do " then SPACE then A which results in "A

is that possible with just 1 Send() command?

Posted

If the syntax is not case sensitive then try a small "a". Your could also try using Chr(34) that may help solve the issue.

Send('/script if ( GetMinimapZoneText() == ' & Chr(34) & 'Alterac Valley" ) then SetBinding("NUMPAD2", "MOVEFORWARD"); end')

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
×
×
  • Create New...