t0ddie Posted October 18, 2005 Posted October 18, 2005 (edited) i am trying to create a bot for Diablo II. the window for the game is full screen sometimes, window mode.. and depending on the computer,different resolutions. so i need an idea for detecting this screen so my bot can add info (see attached screenshot) when it starts the game. the bot will run diablo II.exe then should click a few things to get to this screen here. i need a way to detect that it has gotten to this screen and to proceed. Edited October 18, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Mr.Llama Posted October 18, 2005 Posted October 18, 2005 Well... You could use a command (i forgot which) to get the screen resolution. Then use WinWaitActive so you can tell when the screen is up. Also, I suggest using Sleep(5000) after the WinWaitActive Command.
Faleira Posted October 19, 2005 Posted October 19, 2005 why not just have the script run d2loader and force it to load under the resolutions u want it to? it's been a while since i've played d2, so if d2loader doesn't work anymore or something, sorry [quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]
t0ddie Posted October 19, 2005 Author Posted October 19, 2005 (edited) well the window may also be named random things. i can just make it check the active window.and i would basically do some type of pixelcheck.but i would need it to check a certain color on the screen that may be in different places on different computershow can i apply this? i can get width, height, x and y.. but how would i tell the script where to pixelcheck depending on what the results are?EDIT:why not just have the script run d2loader and force it to load under the resolutions u want it to? it's been a while since i've played d2, so if d2loader doesn't work anymore or something, sorryi dont want to force the user to use the window size that i specify Edited October 19, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
markusss Posted October 19, 2005 Posted October 19, 2005 (edited) / Edited March 10, 2010 by Felix N.
t0ddie Posted October 19, 2005 Author Posted October 19, 2005 no. i DONT want a set resolution. i want to detect what the user has as their setup. then i would need to get the information about their window and use some sort of formula to determine what coordinates to check the pixel color at, since the coordinates will vary depending on each screen size and resolution, the problem is coming up with the formula. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Rraney Posted October 19, 2005 Posted October 19, 2005 (edited) Try using WinGetTitle(""), it returns the active window's title. Build a Hot key to signal the script when you are in the application to pull the name, then do a look up on the window size. HotKeySet("{PAUSE}", "TitleSize") ; set default screen size $Screen_Width = 0 $Screen_Height = 0 $inf = "NO" ;----------------------------------------------------------------------------------- ; Hot Key function ;----------------------------------------------------------------------------------- func TitleSize() $_title = WinGetTitle("") $_pos = WinGetClientSize($_title) $Screen_Width = $_pos[0] $Screen_Height = $_pos[1] $info = "YES" EndFunc ;----------------------------------------------------------------------------------- ; Main Loop. Just an idle script launched. ;----------------------------------------------------------------------------------- While (1) ;if we have an active title and size do something if $info = "YES" then Startaction() Endif WEndno. i DONT want a set resolution. i want to detect what the user has as their setup.then i would need to get the information about their window and use some sort of formula to determine what coordinates to check the pixel color at, since the coordinates will vary depending on each screen size and resolution, the problem is coming up with the formula. Edited October 19, 2005 by Rraney
markusss Posted October 19, 2005 Posted October 19, 2005 THIS ONLY WORKS IN FULLSCREEN Ok if i understand you right, you want to get the color at a certain point, right? Btw if you would tell me/us what you want to do your bot in the end, like does it log you on, we could help you better i think. So say the point you want to get the color of is 320,500 and your screen resolution is 1280x1024 do: 320/1280=0.25 500/1024=0.48828125 those are your "formula" Now you get the screen resolution with @DesktopWidth and @DesktopHeight. To find out the color of the pixel disregarding the resolution you do this: $xofpoint=@DesktopWidth*0.25;we found this number above $yofpoint=@DesktopHeight*0.48828125;we found this number above $color = PixelGetColor($xofpoint,$yofpoint) MsgBox(0,"The decmial color is", $color) MsgBox(0,"The hex color is", Hex($color, 6)) I hope this helped you, if not be more specific with what you want BTW, If you would set the resolution, you wouldn't have to deal with that. THats why i told you the switch. HF Felix N. (tdlrali)
t0ddie Posted October 19, 2005 Author Posted October 19, 2005 no it would need to work in fullscreen and window. and it doesnt have to get the color of anything, i just thought it would be one possibility. i just need some sort of trigger that lets me know im at that screen, without having to adjust the users settings. autoit window info tells me nothing. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Rraney Posted October 19, 2005 Posted October 19, 2005 If you do a [CTRL][ALT][DEL] to bring up the task manager, what does it say in the application window for your game? no it would need to work in fullscreen and window. and it doesnt have to get the color of anything, i just thought it would be one possibility.i just need some sort of trigger that lets me know im at that screen, without having to adjust the users settings. autoit window info tells me nothing.
t0ddie Posted October 19, 2005 Author Posted October 19, 2005 when it first starts up its diablo II.exe then the window appears and it changes to game.exe Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
t0ddie Posted October 20, 2005 Author Posted October 20, 2005 if anyone plays diablo look to see what i mean. i tried looking at the window with "autoit window info" and it provides no information. i just need something that will let me know when the user is at that screen. anyone here that plays diablo want to help out? Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
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