CheatingScumbag Posted March 15, 2015 Share Posted March 15, 2015 (edited) Hello, I've spent a lot of time this week (over 20 hours) trying to perfect a script that I need but with no real success. I've mostly used macro software that are user friendly but they aren't very efficient. I almost succeeded with one software but it caused problems with my mouse, the script wouldn't perform the actions I needed fast enough so it would move my mouse and cause problems. About the script: - There are 27 objects placed in horizontal lines, in total 3 rows with 9 objects in each row. They are equidistant from one another so it would look like this: 1 2 3 4 5 6 7 8 91 2 3 4 5 6 7 8 91 2 3 4 5 6 7 8 9 Each number is a bar with 2 colors like a percentage, when the percentage is 100% the bar is fully green and when it's 1% it's almost completely red, when it's 100% red the object disappears in this manner: 1 2 3 4 5 6 7 8 91 2 3 4 6 7 8 9 12 3 4 5 6 7 8 9 In this case the 5th object in the second row became completely red and disappeared, the remaining objects moved up 1 spot and there are now 28 objects. The goal of my script is to pixel search the red color at 29 different spots for the 29 objects at a specific coordinate of when the bar is 70% red, if the bar is 70% red then it will detect a red pixel instead of a green one at that coordinate: When it detects a red pixel, it will select the object by left clicking at the red pixel and then press delete to remove the object. Once this process is done, I will manually reselect the 28 objects with an addtional new 29th object with a box using my mouse, this last part will be manual, but if the first part that is scripted isn't instantanous so it nterferes with my mouse and I'm not able to reselect 29 objects with the newly added one. The bars will become red quickly, maybe 3-4 red pixels per second, so I have to be able to reselect 29 objects and enable the script to delete 1 object as fast as possible to be able to repeat this 3 times in a second. This is what my original script in that software looked like: Again, this script works, but it moves my mouse so I'm not able to reselect stuff quickly enough (I see my mouse moving on the screen and the final mouse location is different every time). When I press F1 the script should turn on, and constantly check for red pixels at those 29 locations, if one is found it will select it by clicking there and pressing delete. If another red pixel appears at the 29 spots a minute later it will do it again automatically without me pressing hotkeys. To disable the script I will repress F1, Edited March 15, 2015 by Melba23 Added spoiler Link to comment Share on other sites More sharing options...
DocTorCoder Posted March 15, 2015 Share Posted March 15, 2015 (edited) As I saw that script you have positions of those 27 objects. and when color is FF0000 it click on it then press "delete" key. You can create 2 arrays Xpos and Ypos which will contain all x and y positions. Then a for loop which will click and send delete key at Xpos and Ypos This will make things looks more simple. Not so much unnecessary code. For clicking use "ControlClick" and for keys use "ControlSend" - This if you use autoit. Is not so hard , but I will wait because it seems your script is a bot and this is against the rules: http://www.autoitscript.com/forum/index.php?app=forums&module=extras§ion=boardrules If will be accepted then I can help you with that. Not so hard! Edited March 15, 2015 by DocTorCoder DocTorCoder Link to comment Share on other sites More sharing options...
mpower Posted March 15, 2015 Share Posted March 15, 2015 (edited) Hi CheatingScumbag, welcome to the forums! Just wanted to ask what application you're trying to automate? I can see you were previously using Macro Recorder to write your script, but what is the actual target application you're automating? Edited March 15, 2015 by mpower Link to comment Share on other sites More sharing options...
JohnOne Posted March 15, 2015 Share Posted March 15, 2015 What in the world is that picture supposed to be? Post your script. 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...
CheatingScumbag Posted March 15, 2015 Author Share Posted March 15, 2015 (edited) It's to create skins for a game, not actually play the game. Basically, I want to change the appearance of units (their model) in the game depending on their health, so if a unit is wounded he will look different then when he's not wounded, but since there is a lot of units and the task is very repetitive I'm trying to automate it. Each unit has 29 angles or sides, like his back, left, right etc so you can see his model at different angles, I must delete all the 29 angles of a unit at x% health (red pixel at x,y location) and replace it with a new model that me or someone else designed in Photoshop or wherever, this new design will look different, have better texture, or show blood indicating that the unit is wounded etc. It doesn't affect game play as it's not part of the game, it's part of map editor implanted in the game allowing people to create map and change appearance of stuff inside the game to keep it interesting and then host the map with said changes for other players to try it and play it. It's actually a a 15 year old+ game and that's the only reason people still play it because some people are constantly improving the appearance of stuff and creating new maps keeping the game fresh and interesting but it's a lot of work to do so atm. Edited March 15, 2015 by CheatingScumbag Link to comment Share on other sites More sharing options...
JohnOne Posted March 15, 2015 Share Posted March 15, 2015 That's a lovely story indeed. Can you post your "I've spent a lot of time this week (over 20 hours) trying to perfect a script" code, so we can see what you tried? 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 March 15, 2015 Moderators Share Posted March 15, 2015 CheatingScumbag, I want to change the appearance of units (their model) in the game depending on their healthThat falls into the "game interaction" category and so is not a subject we are prepared to discuss here - thread locked. 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