BladeZ Posted November 27, 2005 Share Posted November 27, 2005 In the game diablo II there is a glove type of thing that covers your mouse and wheni try to get any colour inside the game it gives me the colour of the glove. i was wondering if there is any way i can get the correct colour by adding one pixel to the x,y of the mouse. is this possible? -BladeZ Link to comment Share on other sites More sharing options...
Valuater Posted November 27, 2005 Share Posted November 27, 2005 maybe give this a try expandcollapse popup;*********** Use ************** ; Press Esc to terminate script ; Press F8 to open a color dialog box and choose a color ; Or ; Press F9 to get the color under the mouse pointer ; by Valuater...... Enjoy!!! ;****************************** #include <GuiConstants.au3> #include <Misc.au3> Global $var, $Color_win, $pos HotKeySet("{F8}", "Color_Box") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "Get_Color") ToolTip('Get Color - is Running',0,0) While 1 Sleep(100) WEnd ;;;;;;;; Func Color_Box() $var = _ChooseColor (2) Show_Color() EndFunc Func Terminate() Exit 0 EndFunc Func Get_Color() $pos = MouseGetPos() $Svar = PixelGetColor( $pos[0] , $pos[1]) $var = "0x" & Hex($Svar,6) Show_Color() EndFunc Func Show_Color() GUIDelete($Color_win) ClipPut($var) $Color_win = GUICreate("RGB Color = " & $var, 290, 150, -1, -1) GUISetBkColor($var) GUISetFont(9, 400, -1, "MS Sans Serif") GUICtrlCreateLabel(" This Color has been Copied to the ClipBoard " & @CRLF & @CRLF & " Just Paste it wherever you would like"& @CRLF & @CRLF & @CRLF & " Mouse position X=" & $pos[0] & " Y=" & $pos[1] , 10, 10, 270, 100) GUICtrlSetFont(-1, 9, 650) If $var = 0x000000 Then GUICtrlSetColor( -1, 0xFFFFFF) $OK_Btn = GUICtrlCreateButton("&OK", 100, 110, 80, 30) GUISetState() While 2 $msg1 = GUIGetMsg() If $msg1 = $OK_Btn Or $msg1 = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete($Color_win) EndFunc 8) Link to comment Share on other sites More sharing options...
Shinies Posted November 27, 2005 Share Posted November 27, 2005 This is a funny thing blizzard does to try and kill autoit working on Diablo II. I found a way around it though. What you have to do is, take a screen shot of what ur trying to get the pixel of and look at it in paint, it shows the real pixel. Link to comment Share on other sites More sharing options...
BladeZ Posted November 27, 2005 Author Share Posted November 27, 2005 that still doesnt work it just gets the colour of the glove -BladeZ Link to comment Share on other sites More sharing options...
Shinies Posted November 27, 2005 Share Posted November 27, 2005 Thats weird. I know for a fact it works cuz i use it all the time. Tell me exactly what u are trying to do? Link to comment Share on other sites More sharing options...
BladeZ Posted November 27, 2005 Author Share Posted November 27, 2005 (edited) Thats weird. I know for a fact it works cuz i use it all the time. Tell me exactly what u are trying to do?im trying to get the colour of the health ball then check if its diffrent if it is drink a potionEDIT: Alright i did this Paint: Hex: 0x5E0001Diablo II: Hex: 0x585858-BladeZ Edited November 27, 2005 by BladeZ Link to comment Share on other sites More sharing options...
Shinies Posted November 27, 2005 Share Posted November 27, 2005 Hmm, that should have worked then. Here, an example. Click on the image i linked. See that health bar, in game the pixel would be the glove. In the screenshot u can see that the true color is Hex: 0x600000 Dec: 6291456 And the mana would be Hex: 0x000060 Dec: 96 does that work? Link to comment Share on other sites More sharing options...
BladeZ Posted November 27, 2005 Author Share Posted November 27, 2005 hmmm nvm i guess its just not working... i think my monitors colors are messed up or something thanks for the help though Link to comment Share on other sites More sharing options...
Shinies Posted November 27, 2005 Share Posted November 27, 2005 well dont give up, its definantly do-able, are u using the auto-it window info tool? and another thing, the color on the bar changes from one place to another, so u have to look for a bit in the middle with a consistant color Link to comment Share on other sites More sharing options...
greenmachine Posted November 27, 2005 Share Posted November 27, 2005 (edited) Ok, I'm going to assume you're in windowed mode for right now, because it's the best way for these kinds of things. Now, I have this idea. You could set a hotkey, say ctrl+alt+g (for "getpixel") that calls a function whenever you press the hotkey. Then, in the function, do PixelGetColor( MouseGetPos (0) - 10, MouseGetPos (1) - 10 ) This gets the color of the pixel 10 pixels up and 10 pixels left of the mouse, which should be out of the glove. You can modify the -__ values to suit your needs. -- EDIT -- Of course, you also should either export those values to a .txt file for further review (including x and y coordinates), or show them in a MsgBox. And you're going to want Opt("MouseCoordMode", 2) and Opt("PixelCoordMode", 2) to get coordinates according to client area only. Edited November 27, 2005 by greenmachine Link to comment Share on other sites More sharing options...
BladeZ Posted November 27, 2005 Author Share Posted November 27, 2005 Ok, I'm going to assume you're in windowed mode for right now, because it's the best way for these kinds of things. Now, I have this idea. You could set a hotkey, say ctrl+alt+g (for "getpixel") that calls a function whenever you press the hotkey. Then, in the function, do PixelGetColor( MouseGetPos (0) - 10, MouseGetPos (1) - 10 ) This gets the color of the pixel 10 pixels up and 10 pixels left of the mouse, which should be out of the glove. You can modify the -__ values to suit your needs. -- EDIT -- Of course, you also should either export those values to a .txt file for further review (including x and y coordinates), or show them in a MsgBox. And you're going to want Opt("MouseCoordMode", 2) and Opt("PixelCoordMode", 2) to get coordinates according to client area only. hmmm greenmachine you just brought my priject back to life ty Link to comment Share on other sites More sharing options...
greenmachine Posted November 27, 2005 Share Posted November 27, 2005 Glad I could help. I had dealt with the same problem, so I had a good idea what was frustrating you. It confused me for a long time too - the color under the mouse always showed up as some sort of gray when I used the window info tool. Link to comment Share on other sites More sharing options...
t0ddie Posted November 27, 2005 Share Posted November 27, 2005 (edited) i had the same problem and thats exactly what i did except i didnt need to change the coordinates. you will find pixelgetcolor returns the correct color even though autoit window info does not. if you move curser around you can see on autoitwindowinfo however.. the color does change.. it just goes back to gray when you let it sit still for a split second. i have another problem though regarding diablo 2. if anyone is interested in helping... im making a bot but im stuck in one place. i need some autoit code that will detect when i am at the login screen. so when im on the screen the detection flag would be 1 and when im not on the screen it would be 0 or not even the screen really matters. i just need to detect whether im logged in or not i want it to work in all resolutions and window sizes. i would like to be able to detect when the bot has successfully logged in. also i cant detect when/if the bot happens to return to the login screen or other screens before that (simply detect if its logged in or not) i need somehting more reliable than the pixelchecking im doing now because even with a fixed window size and position, sometimes the color is off. i dont think pixelchecking is the solution but im all ears. so if anyone knows a simple way to detect whether you are logged in, or not logged in.. thats all i really need. all that pixel checking is just an idea.. but its one i have tried and its not reliable send me a private message if you would like some source code i currently have and leave your instant messenger screenname and which instant messenger you use. Edited November 27, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like 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