Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 18:38

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help] Autoit - Detect Screen resolution

Discussion on [Help] Autoit - Detect Screen resolution within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 32
Received Thanks: 2
[Help] Autoit - Detect Screen resolution

Hi everyone.

I Have made a gear swapper for Diablo 3. Me and my friend bot use it but i am wanting to know what to change/ understand how to make it detect the screen size so i dont have to mod it everytime i change things in it.

I am still very new to using Autoit


Code:
#RequireAdmin
#region --- CodeWizard generated code Start ---
#endregion --- CodeWizard generated code Start ---
Global $Paused
Global $count = 0
HotKeySet("{F1}", "CE")
While 1
	Sleep(5)
WEnd
Func CE()
	If $count < 1 Then
		ControlSend("Diablo III", "", "", "{SPACE}"); Hotkey
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		MouseMove(1835, 475, 0)
		MouseDown("Left")
		MouseMove(1775, 825, 0)
		MouseUp("Left")
		MouseClick("Right", 1825, 825, 1, 0)
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		MouseMove(962, 450, 0)
		Global $count = 1
	ElseIf $count >= 1 Then
		ControlSend("Diablo III", "", "", "{SPACE}"); Hotkey
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		ControlClick("Diablo III", "", "", "Right", 1, 1825, 825) ;Weapon
		ControlClick("Diablo III", "", "", "Right", 1, 1775, 825) ;Shield
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		Global $count = 0
	EndIf
EndFunc   ;==>CE
Thanks in advance
ladygrace3 is offline  
Old 10/22/2012, 12:23   #2
 
H@CT0R's Avatar
 
elite*gold: 0
Join Date: Apr 2012
Posts: 1,214
Received Thanks: 153
@desktopheight
@desktopwidth

H@CT0R is offline  
Old 10/22/2012, 13:12   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 32
Received Thanks: 2
Quote:
Originally Posted by H@CT0R View Post
@desktopheight
@desktopwidth

Would i have to insert anything into where the pixels should be clicked? as the ones i have in are for a bigger monitor?
ladygrace3 is offline  
Old 10/22/2012, 14:09   #4


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
Yes. You should use dinamic Values like @desktopwidth / x.
@desktopheoght (1280px) / 0,701369863 would be 1825
Lawliet is offline  
Old 10/23/2012, 05:19   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 32
Received Thanks: 2
Quote:
Originally Posted by Lawliet! View Post
Yes. You should use dinamic Values like @desktopwidth / x.
@desktopheoght (1280px) / 0,701369863 would be 1825
Sorry i suck at learning lol
I am still having trouble understanding, so are you able to insert it into my code so i can see exactly how it is done as it will help me understand

Thanks
ladygrace3 is offline  
Old 10/23/2012, 19:34   #6
 
elite*gold: 0
Join Date: Oct 2009
Posts: 557
Received Thanks: 160
princip of dynamic values in context to screens:

These values change in depence of your screen-size.
You declare a percentage/fraction of a screen, so everyone can use it, with every screenresolution.

For Example you have a Screenwidth of 2000px and want to click at 1500.
Declare this Coordination with a percentage to your screen => 3/4*ScreenWidth and not the static value 1500.
So somebody else with the screen width 1000 also clicks at the same Koordinate like you => 750px; 3/4 of 1000.

I dont know your screen resolution so we can't finish your code, or insert dynamic values.

Another idea would be to easy the way geting the coordinations. For example take transparent guis, which can be moved and resized, to easy restrict the area a click can be set.

Jonas93
Jonas_93 is offline  
Old 10/24/2012, 01:00   #7
 
elite*gold: 0
Join Date: Sep 2008
Posts: 32
Received Thanks: 2
Quote:
Originally Posted by Jonas_93 View Post
princip of dynamic values in context to screens:

These values change in depence of your screen-size.
You declare a percentage/fraction of a screen, so everyone can use it, with every screenresolution.

For Example you have a Screenwidth of 2000px and want to click at 1500.
Declare this Coordination with a percentage to your screen => 3/4*ScreenWidth and not the static value 1500.
So somebody else with the screen width 1000 also clicks at the same Koordinate like you => 750px; 3/4 of 1000.

I dont know your screen resolution so we can't finish your code, or insert dynamic values.

Another idea would be to easy the way geting the coordinations. For example take transparent guis, which can be moved and resized, to easy restrict the area a click can be set.

Jonas93
Sorry my screen res is 1900,1080
ladygrace3 is offline  
Old 10/24/2012, 08:49   #8
 
elite*gold: 0
Join Date: Oct 2009
Posts: 557
Received Thanks: 160
Code:
#RequireAdmin
#region --- CodeWizard generated code Start ---
#endregion --- CodeWizard generated code Start ---
Global $Paused
Global $count = 0
Global $sHeight = @DesktopHeight
Global $sWidht = @DesktopWidth
HotKeySet("{F1}", "CE")
While 1
	Sleep(5)
WEnd
Func CE()
	If $count < 1 Then
		ControlSend("Diablo III", "", "", "{SPACE}"); Hotkey
		ControlSend("Diablo III", "", "", "{I}"); Inventory


;;;;;;;;;EXAMPLE;;;;;;;;;;;;;		
MouseMove(($sWidth * 0,965789473684),($sHeight*0,439814814815), 0)
;;;;;;;;;EXAMPLE;;;;;;;;;;;;;		


                MouseDown("Left")
		MouseMove(1775, 825, 0)
		MouseUp("Left")
		MouseClick("Right", 1825, 825, 1, 0)
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		MouseMove(962, 450, 0)
		Global $count = 1
	ElseIf $count >= 1 Then
		ControlSend("Diablo III", "", "", "{SPACE}"); Hotkey
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		ControlClick("Diablo III", "", "", "Right", 1, 1825, 825) ;Weapon
		ControlClick("Diablo III", "", "", "Right", 1, 1775, 825) ;Shield
		ControlSend("Diablo III", "", "", "{I}"); Inventory
		Global $count = 0
	EndIf
EndFunc   ;==>CE
Get these values by dividing your resolution with the coordinates.
Jonas_93 is offline  
Reply


Similar Threads Similar Threads
[Help] Screen resolution
11/16/2011 - CO2 Private Server - 4 Replies
Hi everyone. It is possible to add screen resolution for my private server ? If yes, can you explain how or give a guide ? Thanks.
screen resolution
03/23/2011 - Archlord - 4 Replies
any1 knows how we can change the relosution ? from ini files i need to learn ty all
Needing Help> SF Screen Resolution
12/03/2010 - Soldier Front - 4 Replies
Hi, I need help regarding my SF screen resolution. I just upgraded from xp 64 bit to windows7 ultimate 64 bit. My desktop resolution during my xp64 is at 1920x1080 (since i own a 23 inch LCD monitor) and ingame 1280x720 (the highest). I used to play SF in whole screen. (no black screens on the sides) But now when i upgraded to windows 7. I can only play in only almost half screen. (same settings, desktop stands at 1920x1080, and ingame 1280x720)
Needing Help> SF Screen Resolution
12/02/2010 - Soldier Front Philippines - 1 Replies
Hi, I need help regarding my SF screen resolution. I just upgraded from xp 64 bit to windows7 ultimate 64 bit. My desktop resolution during my xp64 is at 1920x1080 (since i own a 23 inch LCD monitor) and ingame 1280x720 (the highest). I used to play SF in whole screen. (no black screens on the sides) But now when i upgraded to windows 7. I can only play in only almost half screen. (same settings, desktop stands at 1920x1080, and ingame 1280x720)
Screen resolution help!!!
01/20/2008 - Off Topic - 1 Replies
Ok on my other computer i set the resolution to like 1280x1000 or w/e it is. Well it asked me to restart before it would take effect and now everytime i start the computer it goes thorugh the normal startup but right before windows begins where you can select which use you wish to be my screen goes black and a blue box pops up saying that monitor resolution needs to be set lower. I dont knwo what to do now. If anyone can help me on this i will appreciate it. I just need to know if there are any...



All times are GMT +1. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.