Nyarly Posted January 12, 2015 Share Posted January 12, 2015 (edited) Hello everyone, I'm a QA Tester at a big video game editor (i can provide proofs), and it was decided that we needed tools for automation to help us in our work. So i'll be honest with you, i'm currently developping a bot to run hardware tests, playthroughs, and game loops. I do not intend to share the program, i'll be only using it at work to help us develop better games. I hope you'll be able to help me despite the FAQ. I'm not coming here for the same goal and I wouldn't have come if I could do it on my own. So, what I did is separate the task in two parts. One that records my inputs on a block note with each line being : timer based on @SEC, @MSEC and the difference with the time at the entrance of the loop. the direct key pressed code and saves it at the end of the session. The other one opens the file, stores it in an array (for perfs), and then loops to execute every input at the time given, using the same timing method. My lines to send the inputs are as below : ControlSend(("WindowName"), "", "[CLASS:WinsowClass; INSTANCE:1]", "{LEFT}") Send ("{LEFT 10}") I put both, and added 10 to send because it's not always sending the commands. Randomly (the same code and file will run differently), the tool will forget inputs. Using consolewrite, I'm sure every command is properly handled. Perfs looks good, and every command that is sent is working fine. But I'm currently successfully sending only 80% of the commands. It doesn't seem to be linked with the key pressed duration, i tried various values. (5 to 100 ms) So i'm left with : sending does not always send, or the game doesn't always receive the info. Could someone help me ? Shall I / Am I allowed to add more of my code ? Thanks. Edited January 12, 2015 by Nyarly Link to comment Share on other sites More sharing options...
JohnOne Posted January 12, 2015 Share Posted January 12, 2015 Let's see proof please. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Nyarly Posted January 12, 2015 Author Share Posted January 12, 2015 '> Good enough? Link to comment Share on other sites More sharing options...
iamtheky Posted January 12, 2015 Share Posted January 12, 2015 (edited) https://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm maybe setting the sendkeydelay and sendkeydowndelay (and mouse delays if you are playing with that input), rather than sleep will help. Also checking things after each movement: get the rightmost pixel of the object being moved, move left, check to make sure that pixel changed color. If not, log it and repeat that step. And dont post your code (save for generic snippets to illustrate an issue), it does not matter that your efforts are job related. Edited January 12, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Nyarly Posted January 12, 2015 Author Share Posted January 12, 2015 (edited) https://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm maybe setting the sendkeydelay and sendkeydowndelay rather than sleep will help. Also checking things after each movement: get the rightmost pixel of the object being moved, move left, check to make sure that pixel changed color. If not, log it and repeat that step. And dont post your code, it does not matter that your efforts are job related. Thank you. I have those values by default, i tried with them a bit and didn't succeed, i'll try more then. This pixel solution seems nice, i'll see how I can implement that, thanks! Noted, I won't post anything. It's not a known issue with send atleast ? I wonder if I could code my own send function.. Edited January 12, 2015 by Nyarly Link to comment Share on other sites More sharing options...
JohnOne Posted January 12, 2015 Share Posted January 12, 2015 Send is notoriously dodgy, ControlSend however should be fine, but it depends how well the app is responding. SendKeepActive is also worth a try. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 13, 2015 Moderators Share Posted January 13, 2015 Nyarly,We have been discussing this thread amongst the moderating team and I am afraid we have decided that we will not accept it for 2 reasons: - 1. It does specifically deal with game interaction, which the Forum rules expressly prohibit. We accept that you are doing it for professional reasons, but we hope you can accept that any help given to you would also be available to any passing botters.- 2. You mention "records my inputs [...] the direct key pressed code". This is another no-go area as explained hereSo...thread locked. >However, as we are satisfied that you are indeed who you say you are, exceptionally we would suggest that anyone who does wish to help you should do so via PM. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts