Sign in to follow this  
Followers 0
scythetleppo

Diablo Ii - Detect Window Size (scrap)

9 posts in this topic

$darkred = 4522241
$lightred = 16711680
$darkblue = 55
$lightblue = 255

if not processexists("Game.exe") then 
;this process assumes game.exe, you can add errors here or whatever
endif

If Not WinActive("Diablo II","") Then WinActivate("Diablo II","")
WinWaitActive("Diablo II", "")
WinMove("Diablo II", "", 0, 0)
WinSetOnTop ("Diablo II", "", 1)
Sleep(1000)
WinWaitActive("Diablo II")
Sleep(100)

$w6401 = PixelGetColor(77,424)
$w6402 = PixelGetColor(577,424)
$f6401 = PixelGetColor(67,400)
$f6402 = PixelGetColor(577,400)
$w8001 = PixelGetColor(90,570)
$w8002 = PixelGetColor(750,570)
$f8001 = PixelGetColor(75,514)
$f8002 = PixelGetColor(744,514)

if $w6401 > $darkred and $w6401 < $lightred and $w6402 > $darkblue and $w6402 < $lightblue then
    splashtexton("Color", "Windowed 640 res", 200, 200)
    sleep(10000)
elseif $f6401 > $darkred and $f6401 < $lightred and $f6402 > $darkblue and $f6402 < $lightblue Then
    splashtexton("Color", "Fullscreen 640 res", 200, 200)
    Sleep(10000)
elseif $w8001 > $darkred and $w8001 < $lightred and $w8002 > $darkblue and $w8002 < $lightblue Then
    splashtexton("Color", "Windowed 800 res", 200, 200)
    sleep(10000)
elseif $f8001 > $darkred and $f8001 < $lightred and $f8002 > $darkblue and $f8002 < $lightblue Then
    splashtexton("Color", "Fullscreen 800 res", 200, 200)
    sleep(10000)
else
    splashtexton("Color", "Not Recognized.", 300, 200);if you aren't getting the res
    sleep(10000)
EndIf

This code will tell you if D2 is running in Windowed 640, Fullscreen 640, Windowed 800 or Fullscreen 800 (the only possible resolutions). If it is not working for you, please tell me so I can make it more universal, but it should work.

Diablo title must be "Diablo II" for this simple code.

Share this post


Link to post
Share on other sites



why you dont use :

WinGetSize()

=?=


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

why you dont use :

WinGetSize()

=?=

doesn't that say diablo is 800 if its windowed 800 and fullscreen 800?

Share this post


Link to post
Share on other sites

dunno, test it :)


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

dunno, test it :)

I'm not finding it >< is it included with beta?

edit: oh is this it?

Wingetclientsize

I'll try it

Edited by scythetleppo

Share this post


Link to post
Share on other sites

Yeah, it reports that it is 800, fut it doesn't know ifit's fullscreen or not, which offsets the click points.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Nice effort and all, but this script could be replaced with a couple lines of code.

$a_size = WinGetPos("Diablo II")
If @error = 1 Then
MsgBox(0,"Diablo Size", "Window not found")
Else
MsgBox(0,"Diablo Size","Width: "& $a_size[2]&" Height: "&$a_size[3])
EndIf

Similarly, you can use WinGetState to see if it is in windowed or fullscreen mode. No messy pixel functions.

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Nice effort and all, but this script could be replaced with a couple lines of code.

$a_size = WinGetPos("Diablo II")
If @error = 1 Then
MsgBox(0,"Diablo Size", "Window not found")
Else
MsgBox(0,"Diablo Size","Width: "& $a_size[2]&" Height: "&$a_size[3])
EndIf

Similarly, you can use WinGetState to see if it is in windowed or fullscreen mode. No messy pixel functions.

Once again: things that should have been brought to my attention YESTERDAY (when I asked =[ )!

Share this post


Link to post
Share on other sites

Once again: things that should have been brought to my attention YESTERDAY (when I asked =[ )!

No need to get upset, I was just trying to help out :)

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

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