Jump to content
Sign in to follow this  
tom13

Send a long sentence?

Recommended Posts

tom13

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?

Share this post


Link to post
Share on other sites
MHz

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

Notice the single quotes

Share this post


Link to post
Share on other sites
pixels75

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.

Share this post


Link to post
Share on other sites
tom13

Thanks :)

Share this post


Link to post
Share on other sites
tom13

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 ?

Share this post


Link to post
Share on other sites
MHz

Try using the 2nd parameter of sending raw characters.

Share this post


Link to post
Share on other sites
tom13

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?

Share this post


Link to post
Share on other sites
MHz

Send('text', 1) ; The 1 is the 2nd parameter of the function call.

Share this post


Link to post
Share on other sites
gamepin126

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

Share this post


Link to post
Share on other sites
tom13

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?

Share this post


Link to post
Share on other sites
MHz

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.

Share this post


Link to post
Share on other sites
tom13

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?

Share this post


Link to post
Share on other sites
MHz

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')

Share this post


Link to post
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
Sign in to follow this  

×