spheresus Posted December 27, 2007 Share Posted December 27, 2007 I'm a total nub here so all I do is copy and paste code and learn by trial and error. I created a simple macro that searches for a pixel color and presses the 9 key if not found, if the color is found it does nothing. I doubled checked every thing including the proper coord for pixelsearch rectangle area and the decimal number of the pixel color I want to check for. What I did was I took a screen shot (jpeg) of the game and with my picture editor blew up jpeg to max to get pixel color of a specific pixel. I used autoit program to get the decimal number of the pixel. Now in theory my macro should look for and find that pixel if it's there if it's not it will press 9 which in turn will make my character perform a move which will activate a attack and make the icon with the pixel color stay up for several seconds. My macro always presses 9 with or with out the pixel color in icon. Here is the code, I hope you guys can help me out.Global $PausedHotKeySet("{PAUSE}", "TogglePause")HotKeySet("{ESC}", "Terminate")HotKeySet("+a", "ShowMessage") ;Shift-aWhile 1 Sleep(100)WEndFunc TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("")EndFuncFunc Terminate() Exit 0EndFunc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Func ShowMessage()PixelSearch (253, 68, 380, 94, 8716291)If @error Then Send("9") Else EndIfEndFunc Link to comment Share on other sites More sharing options...
star2 Posted December 27, 2007 Share Posted December 27, 2007 hi as for the script is should be OK but I think u really should check the coords and the color u r usingu can use the [ WinGetPos ] for getting the coords [ x , y ] - (check help file)and I recommend this helpful tool by Valuater to get ur color from Herehope this was helpful [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u] Link to comment Share on other sites More sharing options...
spheresus Posted December 27, 2007 Author Share Posted December 27, 2007 hi as for the script is should be OK but I think u really should check the coords and the color u r using u can use the [ WinGetPos ] for getting the coords [ x , y ] - (check help file) and I recommend this helpful tool by Valuater to get ur color from Here hope this was helpful I solved the problem and it had nothing wrong to do with the code. After more trial testing I found out the culprit is that the screen capture didn't capture the exact same pixel colors as the actual game when it's running. It must have something to do with the jpeg format the game captures screenshots with. I need to capture screen shots with 100% accurate color can the bitmap format do it and if so any one know a good screen capture program? Link to comment Share on other sites More sharing options...
James Posted December 27, 2007 Share Posted December 27, 2007 Do you mind not posting a ridiculous title such as this one. Gives us information on the problem, something like, "Screen capture problem" or "Reading co-ords..." etc etc Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted December 27, 2007 Share Posted December 27, 2007 Yes JamesB, every who askes a question needs help.. so no need to ask for help. Just ask the question Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
James Posted December 27, 2007 Share Posted December 27, 2007 Yes, but I was on about the title of it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
spheresus Posted December 28, 2007 Author Share Posted December 28, 2007 Do you mind not posting a ridiculous title such as this one. Gives us information on the problem, something like, "Screen capture problem" or "Reading co-ords..." etc etcSorry I'm new here but I'll keep that in mind, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now