Sign in to follow this  
Followers 0
spheresus

What's wrong with my script, I doubled checked every thing

7 posts in this topic

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 $Paused

HotKeySet("{PAUSE}", "TogglePause")

HotKeySet("{ESC}", "Terminate")

HotKeySet("+a", "ShowMessage") ;Shift-a

While 1

Sleep(100)

WEnd

Func TogglePause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

Func Terminate()

Exit 0

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func ShowMessage()

PixelSearch (253, 68, 380, 94, 8716291)

If @error Then

Send("9")

Else

EndIf

EndFunc

Share this post


Link to post
Share on other sites



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


[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]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Yes JamesB,

every who askes a question needs help.. so no need to ask for help. Just ask the question

:)


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

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

Sorry I'm new here but I'll keep that in mind, thank you.

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