YaBoy Posted January 28, 2007 Share Posted January 28, 2007 (edited) got it Edited January 31, 2007 by YaBoy Link to comment Share on other sites More sharing options...
YaBoy Posted January 28, 2007 Author Share Posted January 28, 2007 can someone please help me? Link to comment Share on other sites More sharing options...
Paulie Posted January 28, 2007 Share Posted January 28, 2007 (edited) Instead of doing this: MouseMove(190,63) MouseDown("left") MouseUp("left")oÝ÷ Ù:ò¶¬jëh×6 MouseClick("Left", 190,63) oÝ÷ Ø l¡«2¢é'£âÅéFzШÑzÛ«Ëax1 À½©nzÚrh¯'Ê¢jZè¶axqÂ+a¶¬jëh×6 If PixelGetColor(507, 212) = 5B5B5F ThenoÝ÷ Ù*¯+aÆ®¶sbbWVÄvWD6öÆ÷"SrÂ#"ÃbÒT#T#TbFV And don't bump your post after just 24 minutes. Wait a few hours before bumping. Edited January 28, 2007 by Paulie Link to comment Share on other sites More sharing options...
YaBoy Posted January 28, 2007 Author Share Posted January 28, 2007 (edited) I tried this: If Hex(PixelGetColor(507, 212),6) = 5B5B5F Then And I get this error: The hex number doesnt show up in pink color. Only the 5 does. Edited January 31, 2007 by YaBoy Link to comment Share on other sites More sharing options...
J0ker Posted January 28, 2007 Share Posted January 28, 2007 Use decimal colorIf PixelGetColor(507, 212) = "5987167" Thenit should work. Link to comment Share on other sites More sharing options...
YaBoy Posted January 28, 2007 Author Share Posted January 28, 2007 (edited) It compiles, but it still stops before the if statement. The macro just stops and terminates. All I want is when I click here it will continue if it gets that color. So this is the only code I really need: MouseClick("Left", 190,63) If PixelGetColor(507, 212) = "5987167" Then MouseMove(186,63) MouseDown("left") MouseUp("left") MouseMove(186,63) MouseDown("left") MouseUp("left") EndIf but its not working, have any other ideas what I can do/use? AND BTW, When I use code for a message box to tell me the decimal and hex number it gives me different numbers then the Window AutoIt tool one. Edited January 28, 2007 by YaBoy Link to comment Share on other sites More sharing options...
herewasplato Posted January 28, 2007 Share Posted January 28, 2007 ...AND BTW, When I use code for a message box to tell me the decimal and hex number it gives me different numbers then the Window AutoIt tool one.I do not usually post to threads that involves games, but the problem the OP is having might be related to the settings within the "AutoIt Window Info" tool. See my post here: http://www.autoitscript.com/forum/index.ph...st&p=289130 Another way to get this type of info is to make your own tool:Opt("MouseCoordMode", 0) ;0 = relative coords to the active window ;Opt("MouseCoordMode",1) ;1 = absolute screen coordinates (default) ;Opt("MouseCoordMode",2) ;2 = relative coords to the client area of the active window HotKeySet("{ESC}", "Terminate") If Opt("MouseCoordMode") = 0 Then $var = "window" If Opt("MouseCoordMode") = 1 Then $var = "screen" If Opt("MouseCoordMode") = 2 Then $var = "client" While 1 $pos = MouseGetPos() $pgc = PixelGetColor($pos[0], $pos[1]) ToolTip("Press ESC to exit" & @CR & $var & " x: " & $pos[0] & ", y: " & $pos[1] & @CR & $pgc) Sleep(100) WEnd Func Terminate() ClipPut("If PixelGetColor(" & $pos[0] & ", " & $pos[1] & ') = "' & $pgc & '" Then') Exit EndFunc ;==>TerminateAfter you have learned a bit out which MouseCoordMode mode you wish to operate in, change which "Opt" line is remarked out in the little tool above, run the code, place the mouse over the pixel of interest, press the Esc key to exit the script, paste the contents of the clipboard into the script that you are writing... later [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
YaBoy Posted January 28, 2007 Author Share Posted January 28, 2007 I do not usually post to threads that involves games, but the problem the OP is having might be related to the settings within the "AutoIt Window Info" tool. See my post here: http://www.autoitscript.com/forum/index.ph...st&p=289130 Another way to get this type of info is to make your own tool:Opt("MouseCoordMode", 0) ;0 = relative coords to the active window ;Opt("MouseCoordMode",1) ;1 = absolute screen coordinates (default) ;Opt("MouseCoordMode",2) ;2 = relative coords to the client area of the active window HotKeySet("{ESC}", "Terminate") If Opt("MouseCoordMode") = 0 Then $var = "window" If Opt("MouseCoordMode") = 1 Then $var = "screen" If Opt("MouseCoordMode") = 2 Then $var = "client" While 1 $pos = MouseGetPos() $pgc = PixelGetColor($pos[0], $pos[1]) ToolTip("Press ESC to exit" & @CR & $var & " x: " & $pos[0] & ", y: " & $pos[1] & @CR & $pgc) Sleep(100) WEnd Func Terminate() ClipPut("If PixelGetColor(" & $pos[0] & ", " & $pos[1] & ') = "' & $pgc & '" Then') Exit EndFunc ;==>TerminateAfter you have learned a bit out which MouseCoordMode mode you wish to operate in, change which "Opt" line is remarked out in the little tool above, run the code, place the mouse over the pixel of interest, press the Esc key to exit the script, paste the contents of the clipboard into the script that you are writing... later That tool does help, thanks. But, the script stops and terminates soon before the if statement. It hits to enter cave, then thats when I put my if statement in(Dont proceed unless you see this color) Which could be from 5 secs to 1 min. It just ends. Any suggestions? Link to comment Share on other sites More sharing options...
herewasplato Posted January 29, 2007 Share Posted January 29, 2007 ...(Dont proceed unless you see this color)...Then you need a delay. Perhaps the Do/Until loop that I sent you via PM might work. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
YaBoy Posted January 29, 2007 Author Share Posted January 29, 2007 I tried sir. The script doesnt stop, its still running, but when I enter the cave, I stop. I just stand there and it doesnt proceed. But I see the script still active on the bottom right of my toolbar. Link to comment Share on other sites More sharing options...
herewasplato Posted January 29, 2007 Share Posted January 29, 2007 I tried sir. The script doesnt stop, its still running, but when I enter the cave, I stop. I just stand there and it doesnt proceed. But I see the script still active on the bottom right of my toolbar.Not being a gamer, I'm not sure if your game reports the correct mouse positions back to the OS and hence AutoIt. Perhaps others out there know a bit more about "The Realm Online". [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
YaBoy Posted January 29, 2007 Author Share Posted January 29, 2007 well the game is played right off the desktop, doesnt take up a full screen or nothing. you can run multiple clients at once. Link to comment Share on other sites More sharing options...
YaBoy Posted January 29, 2007 Author Share Posted January 29, 2007 (edited) got it Edited January 31, 2007 by YaBoy Link to comment Share on other sites More sharing options...
Paulie Posted January 29, 2007 Share Posted January 29, 2007 OMG so many unnecessary lines of code! :D Please replace this: MouseMove(190,63) MouseDown("left") MouseUp("left")oÝ÷ ÙhØb±«¢+Ù5½Õͱ¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÄäÀ°ØÌ¤ Link to comment Share on other sites More sharing options...
YaBoy Posted January 29, 2007 Author Share Posted January 29, 2007 (edited) got it Edited January 31, 2007 by YaBoy Link to comment Share on other sites More sharing options...
herewasplato Posted January 30, 2007 Share Posted January 30, 2007 ...Because PixelGetColor isnt workingOr something is not right about the PixelGetColor line that you have written. The script executes the lines after the WinWaitActive line (see below) within a fraction of a second. After the MouseUp, the script checks for the color, sees that it does not = "5987167" and skips to the EndIf. You are going to have to tell the script to wait between the MouseUp and the "If PixelGetColor" line.WinWaitActive("Cave Entrance","")MouseMove(190,63)MouseDown("left")MouseUp("left")If PixelGetColor(505, 212) = "5987167" ThenMaybe a gamer can tell you how to debug your code, seeing the video did not help me any... or you might want to just play the game as a human. :-) [size="1"][font="Arial"].[u].[/u][/font][/size] 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