Sign in to follow this  
Followers 0
Nufan1121

Send function to DirectX Window - Help!

16 posts in this topic

Hi there, i'm trying to create a benchmark script that will install directx, open and run a benchmark program called 'the last remnant' and then run a core temp program that will give readings of temperature and load.

So far the first and last missions are accomplished, however i can only seem to load the benchmark utility window but it only SOMETIMES sends the enter, up, down functions to the window.

My main issue is it lacks window information that the other windows did to make it easy sending functions to.

Here is the error-ness part of my script:
 

ShellExecute("F:BenchmarkTestSetupBinariesTLRBench.EXE")
WinWaitActive("The Last Remnant")
ControlClick("The Last Remnant", "","[CLASS:Button; INSTANCE:2]")
Sleep(30000)
WinActivate("[CLASS:LaunchUnrealUWindowsClient]", "")
Sleep(2000)
Send("{UP}")
Sleep(2000)
Send("{ENTER}")

And here is the window information:

>>>> Window <<<<
Title: The Last Remnant
Class: LaunchUnrealUWindowsClient
Position: 40, 9
Size: 1286, 749
Style: 0x14CA0000
ExStyle: 0x00040100
Handle: 0x002D03F0
 
>>>> Control <<<<
Class:
Instance:
ClassnameNN:
Name:
Advanced (Class):
ID:
Text:
Position:
Size:
ControlClick Coords:
Style:
ExStyle:
Handle:
 
>>>> Mouse <<<<
Position: 599, 173
Cursor ID: 0
Color: 0x010001
 
>>>> StatusBar <<<<
 
>>>> ToolsBar <<<<
 
>>>> Visible Text <<<<
 
 
>>>> Hidden Text <<<<
 
I enjoy working things like this out - i come from a C# and java background and i find coding interesting. How ever this is starting to take up alot of my time and being new to this language i can't seem to get my head around the issue. What made me sign up and seek help was after reading somewhere that auto it has difficulty communicating with directx applications (although i'm not sure if that is true) it's most likely just my coding.

Any help is greatly appreciated.

-Nufan1121.

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please take a look at our forum rules before posting.
 

  • Launching, automation or script interaction with games or game servers, regardless of the game.
Edited by danwilli

Share this post


Link to post
Share on other sites

Oh sorry... i really didn't think of this as a game... i use it for a benchmarking tool.

I will respect the rules of the forum but is there no way i can be pointed in the direction of somewhere that CAN help me? 

Again, didn't mean to arouse suspicion - my intentions are genuine. 

-Nufan1121.

Share this post


Link to post
Share on other sites

Hi Nufan1121,

It's great to have you join our community, and I'm sorry that I had to start out your experience like this, but unfortunately we are very strict about this rule.

The way you handled the news of the forum rules once informed was great, and I do not doubt your intentions at all.  That being said, I cannot discuss the matter any further.

I hope that this doesn't put you off, and I hope to see you around in the future asking other autoit related questions :)

Welcome to the forums!

Share this post


Link to post
Share on other sites

Nufan1121,

I will echo danwilli's comments - welcome and thanks for your understanding. :)

But I am sure it is quite clear to you why I will now lock the thread. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Nufan1121,

I have just been told that there is benchmarking tool for this game - are you running that rather than the game itself? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi Melba, i am indeed using the benchmark utility found here: http://archive.na.square-enix.com/remnant/pc.html

I completely understand the rules, i have been on other forums where the protection of the scripts and code practice itself champions the need for genuine coders understanding due to those who would miss use it.

It is sad that i have to find a work around for this particular program as it is the one my work place uses for benchmarking. If it were my way i would use prime95 or another more... code friendly... utility. 

Appreciate you're interest.

Nufan1121
 

Share this post


Link to post
Share on other sites

Nufan1121,

Then as you are using the utility and not the game, I am happy for the thread to remain open and for you to receive help as long as it remains limited to the benchmark utility only. :)

All,

I will deal with any deviation from the above restriction very severely - so be warned. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thank you Melba, i am happy to abide by those rules.

Again, my main issue is that the send functions only sometimes work with the directX window. If you would like to download the benchmark itself you will see after clicking the TRLBench.exe in the binaries folder, you are presented with a window with 2 options (which the 'Instance 2' portion of my script takes care of' and then a directx window starts to load.

This window has poor window information and from what i have gathered from other forums a difficult accepting input other than real time user. 

My goal is for the benchmark options of 'Loop mode' and then Start' to be selected.

At a minimum this would require the send functions of 'Up' 'Enter' 'Down' 'Enter' for it to start the program in loop mode, alas it's just not happening.

If anyone can shed light on this troublesome situation i'm sure i would not be the only one in the future to thank you on this post.

-Nufan1121

Share this post


Link to post
Share on other sites

Or can anyone suggest any other methods of mouse/keyboard input other than send and mouseclick by pixel? I have tried both and only Send seems to be working (when it wants to). My main concern is that it's not actually the input send command that is at fault, but the focus on the window itself. How ever as mentioend above i seem to be lacking information from the window to ensure it's focus.

Any takers?

-Nufan1121

Share this post


Link to post
Share on other sites

Nufan1121,

If the benchmark utility interface is anything like the game itself then it may well be protected by similar anti-botting measures. If so then there is little chance of AutoIt being able to interact with it - and for obvious reasons I would not be happy with any discussions on how to get around such things. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi again Melba,

That sounds acceptable to me. Do you think it's worth attempting to change the dll setup files to change the standard settings of the benchmark or is that even more unlikely?

Share this post


Link to post
Share on other sites

Nufan1121,

Well over my head - I have no idea what you are talking about. Sorry. :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi, Nufan. What OS are you running the benchmark tool on? I encountered this app back in 2009, maybe I'll take a look at it again just to clarify the level of manipulation it supports (without, as Melba pointed out, breaking their rules).


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Hi JLogan, thank you for joining the quest.

I'm running on windows, specifically XP at work, but to 'build' the script i'm running windows 8.

So far i've managed to get directx9 to install (needed for the benchmark to run), then the benchmark itself, along with a simple and small CPU temperature measurement utility and finally a stopwatch to time the benchmark (sometimes we leave our computers on for 24/48 hours while testing countless other units.)

As a n00bie to the language the script is very simple but it works, if i ever managed to get it to do exactly what i need then i will optimize it, but at this rate i'm close to ditching the language and heading back to C# to see if there is an easier way.
 

#RequireAdmin
 
;Run and Install DirextX
 
ShellExecute(@ScriptDir & "BenchmarkTestSetupDirectXDXSETUP.exe")
WinWaitActive("Installing Microsoft® DirectX®") 
Send("{TAB}")
Send("{ENTER}")
Send("{ENTER}")
WinWaitActive("Installing Microsoft® DirectX®","Installation Complete")
Send("{ENTER}")
 
;Run The Benchmark
 
   ShellExecute(@ScriptDir & "BenchmarkTestSetupBinariesTLRBench.EXE")
   WinWaitActive("The Last Remnant")
   ControlClick("The Last Remnant", "","[CLASS:Button; INSTANCE:2]")
   Sleep(20000)
 
;Mutes Volume
 
   Send ("{VOLUME_MUTE}")
 
;Run HWMontior
 
ShellExecute(@ScriptDir & "TemperatureTestHWMonitorHWMonitor.exe")
WinWaitActive("CPUID Hardware Monitor")
WinSetOnTop("CPUID Hardware Monitor", "", 1)
WinMove("CPUID Hardware Monitor", "", 836, 149, 530, 500)
 
;StopWatch
 
ShellExecute(@ScriptDir & "TemperatureTestStopwatchStopWatch.exe")
WinWaitActive("Stop Watch")
WinSetOnTop("Stop Watch", "", 1)
WinMove("CPUID Hardware Monitor", "", 644, 529, 644, 529)
ControlClick("Stop Watch", "","[CLASS:WindowsForms10.BUTTON.app.0.378734a; INSTANCE:3]")
 
;Termination Window
 
$MessageReponse = MsgBox(262144, "Benchmark Test" , "If the test passes click ok to exit script")
if $MessageReponse = 1 Then
   Send ("{VOLUME_UP}")
   ProcessClose("HWMonitor.exe")
   ProcessClose("TLRBench.exe")
   ProcessClose("StopWatch.exe")
   Send ("{VOLUME_UP}")
EndIf

Share this post


Link to post
Share on other sites

Hi all,

To anyone interested in this project i thought i would let you know of my current advancements:

By sending MouseWheel functions instead i have been able to communicate with the directx window flawlessly and access the menu in an up and down directional way. How ever, i am still having issues with the MouseClick and Send {ENTER} functions only working half of the time... it's a problem that i am dedicated to get around and this advancement has made me all the more keen. 

What this means is i am now able to toggle the Loop Benchmark option making this useful for prolonged duration benchmark tests... something i'm sure someone in the big wide world might want to replicate one day and hopefully stumble across this code, be it with this benchmark or another one using directx. 

I will post the finished script when i am 100% it will work every time. I am also keen to re produce the finished script int he C# language and compare results.

-Nufan1121

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