Sign in to follow this  
Followers 0
MBJ

Controlsend command help.

10 posts in this topic

hi everyone im new on the forums and new to autoit3, i used autoit2 a little bit but im by no means an expert.

okay so down to the problem heres my script...

AutoItSetOption ( "TrayAutoPause" , 0 )

While 1

ControlSend("Sword of the New World", "", "ToolbarWindow322]", "^{SPACE}")

Sleep(5000)

WEnd

so my problem is it wont send CTRL SPACE to the game. im not getting any errors when i run it, it just wont send the keystrokes.

also im not sure if i did the loop correct for it to go on for infinit repeat.

any help would be much apreaciated

thanks in advance

Share this post


Link to post
Share on other sites



Welcome to AutoIt... well OK... Welcome to AutoIt3! :whistle:

You can take a shot at assigning focus first with ControlFocus(), but you may be dealing with a game that use GameGuard or some such to block simulated keyboard/mouse actions.

:lmao:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

kk ill try that, i dont think they use game guard. i made a script that would send it but it only works if its active. but i want it to send to inactive window so i can use my computer while it bots ^____^.

no idea how to use controlfocus() i will give it a shot though. i will prbably beback in a few hours asking for more help :whistle:

thanks lol

k so i tried stil nothing.

AutoItSetOption ( "TrayAutoPause" , 0 )

While 1

ControlFocus ( "Sword of the New World", "", "ToolbarWindow322" )

ControlSend("Sword of the New World", "", "ToolbarWindow322", "^{SPACE}")

Sleep(5000)

WEnd

Edited by MBJ

Share this post


Link to post
Share on other sites

bump

i need help really bad

sorry for the bump though lol

Share this post


Link to post
Share on other sites

bump

i need help really bad

sorry for the bump though lol

Can you post the data from AutoIt's Window Info Tool (Au3Info.exe) on that control?

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Something here I doubt is correct:

ControlSend("Sword of the New World", "", "ToolbarWindow322", "^{SPACE}")

Somehow I doubt that the controlID is ToolbarWindow322 - you could try:

- first you will need to give focus (activate) the game screen

WinActivate("Sword of")

- try to send this to an empty control and see what's happening:

ControlSend("Sword of the New World", "", "", "^{SPACE}")

- try to shorten the title

ControlSend("Sword of", "", "ToolbarWindow322", "^{SPACE}")

or

ControlSend("Sword of", "", "", "^{SPACE}")

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Can you post the data from AutoIt's Window Info Tool (Au3Info.exe) on that control?

:whistle:

>>>> Window <<<<

Title:

Class: Shell_TrayWnd

Position: 0, 994

Size: 1280, 30

Style: 0x96000000

ExStyle: 0x00000088

>>>> Control <<<<

Class: ToolbarWindow32

Instance: 2

ID:

Text: Aplicaciones en ejecución

Position: 112, 994

Size: 1026, 30

ControlClick Coords: 76, 18

Style: 0x52009345

ExStyle: 0x00000000

>>>> Mouse <<<<

Position: 188, 1012

Cursor ID: 2

Color: 0x326EE9

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Inicio

1:15

Área de notificación

Aplicaciones en ejecución

Aplicaciones en ejecución

and

>>>> Window <<<<

Title: Sword of the New World

Class: Granado Espada

Position: 0, 0

Size: 1286, 992

Style: 0x16CA0000

ExStyle: 0x00000100

>>>> Control <<<<

Class:

Instance:

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

>>>> Mouse <<<<

Position: 349, 609

Cursor ID: 0

Color: 0x151E16

>>>> StatusBar <<<<

>>>> Visible Text <<<<

>>>> Hidden Text <<<<

i wasnt sure whitch to get info from or i was supposed to get from both. im complete newbz0r

Share this post


Link to post
Share on other sites

>>>> Window <<<<

Title:

Ahh, first clue -- no title...

Class: Shell_TrayWnd

Position: 0, 994

Size: 1280, 30

Style: 0x96000000

ExStyle: 0x00000088

The class is handy. You can use the Shell_TrayWnd class instead of the absent title.

It's a small tool bar, only 30 pixels high and going all the way across the bottom of the screen (which is 1280x1024)...

In short... this is your desktop's Windows tool bar, not the game's toolbar -- Why didn't you say so?

>>>> Control <<<<

Class: ToolbarWindow32

Instance: 2

ID:

Text: Aplicaciones en ejecución

Position: 112, 994

Size: 1026, 30

ControlClick Coords: 76, 18

Style: 0x52009345

ExStyle: 0x00000000

The ClassNameNN is correct: ToobarWindow322

But that's for the whole ToolBar, not for a particular app's (or game's) toolbar item.

If you want to AutoIt script stuff on the Windows toolbar, download PaulIA's excellent AUTO3LIB UDF and check out the help file that comes with it for the A3LToolbar.au3 functions.

>>>> Mouse <<<<

Position: 188, 1012

Cursor ID: 2

Color: 0x326EE9

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Inicio

1:15

Área de notificación

Aplicaciones en ejecución

Aplicaciones en ejecución

OK, now we're on to the actual game window:

>>>> Window <<<<

Title: Sword of the New World

Class: Granado Espada

Position: 0, 0

Size: 1286, 992

Style: 0x16CA0000

ExStyle: 0x00000100

>>>> Control <<<<

Class:

Instance:

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

>>>> Mouse <<<<

Position: 349, 609

Cursor ID: 0

Color: 0x151E16

>>>> StatusBar <<<<

>>>> Visible Text <<<<

>>>> Hidden Text <<<<

No control info, which is normal in games because they are drawn graphics.

i wasnt sure whitch to get info from or i was supposed to get from both. im complete newbz0r

What you need to do is pick one or the other. You mixed the window title for the game with the control ClassNameNN from the Windows tollbar. Either send your Ctrl-Space to the game or the toolbar, don't mix them. Presumably you want it to go to the game. I think enaiman may have called it above:

ControlSend("Sword of the New World", "", "", "^{SPACE}")

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

it actually is working but it wont press controlkey

Share this post


Link to post
Share on other sites

too old topic, but i playing the same game, and trying do just a

ControlSend("Sword of the New World", "", "", "^{SPACE}")

but X-Trap_2705 close the game, anyone have a hothint forme?

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  
Followers 0