Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 23:40

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

Advertisement



Help over Window Focus!

Discussion on Help over Window Focus! within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
TheAnonPanda's Avatar
 
elite*gold: 0
Join Date: Jan 2014
Posts: 54
Received Thanks: 26
Help over Window Focus!

I want to make an bot for all resolutions for League of Legends, but, i don't know how to make WindowFocus (my point: switches to that window - if active), here is my code so far:
Quote:
Global $resolution
; ------------------------------------------------------------------------------

MsgBox(0, "Desktop Resolution", _Desktop_Resolution() & " @ " & @DesktopRefresh & " Hertz")


Func _Desktop_Resolution()
Switch $resolution = ""
Case @DesktopWidth = 640 And @DesktopHeight = 480; Video Graphics Array
Case @DesktopWidth = 800 And @DesktopHeight = 480; Wide Video Graphics Array
Case @DesktopWidth = 854 And @DesktopHeight = 480; Full Wide Video Graphics Array
Case @DesktopWidth = 800 And @DesktopHeight = 600; Super Video Graphics Array
Case @DesktopWidth = 960 And @DesktopHeight = 540; Quarter Full HD
Case @DesktopWidth = 1024 And @DesktopHeight = 576; Wide Super Video Graphics Array
Case @DesktopWidth = 1024 And @DesktopHeight = 600; Wide Super Video Graphics Array
Case @DesktopWidth = 1024 And @DesktopHeight = 768; eXtended Graphics Array
Case @DesktopWidth = 1152 And @DesktopHeight = 864; eXtended Graphics Array Plus
Case @DesktopWidth = 1280 And @DesktopHeight = 720; Wide eXtended Graphics Array
Case @DesktopWidth = 1280 And @DesktopHeight = 768; Wide eXtended Graphics Array
Case @DesktopWidth = 1280 And @DesktopHeight = 800; Wide eXtended Graphics Array
Case @DesktopWidth = 1280 And @DesktopHeight = 960; Super eXtended Graphics Array
Case @DesktopWidth = 1280 And @DesktopHeight = 1024; Super eXtended Graphics Array
Case @DesktopWidth = 1360 And @DesktopHeight = 768; Wide eXtended Graphics Array
Case @DesktopWidth = 1366 And @DesktopHeight = 768; High Definition (720p)
Case @DesktopWidth = 1440 And @DesktopHeight = 900; Wide Super eXtended Graphics Array
Case @DesktopWidth = 1400 And @DesktopHeight = 1050; Wide Super eXtended Graphics Array
Case @DesktopWidth = 1600 And @DesktopHeight = 900; High Definition Plus (900p
Case @DesktopWidth = 1600 And @DesktopHeight = 1200; Ultra eXtended Graphics Array
Case @DesktopWidth = 1680 And @DesktopHeight = 1050; Wide Super eXtended Graphics Array Plus
Case @DesktopWidth = 1920 And @DesktopHeight = 1080; Full High Definition (1080p)
ControlFocus("[CLASS:PVP.net Client]", "", "");
MouseClick("left", 1413, 890, 1620)
EndSwitch
EndFunc
Results: It didn't worked(i'm testing at 1920x1080 case, since that's my resolution)
TheAnonPanda is offline  
Old 06/22/2014, 16:20   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
I think you got the Switch-Case Statement wrong. Case accepts values for example
Code:
Switch 5
Case 5
;....
You want to use Select I think
Code:
Select
Case @DesktopWidth = 640 And ....
alpines is offline  
Thanks
1 User
Old 06/22/2014, 20:13   #3
 
TheAnonPanda's Avatar
 
elite*gold: 0
Join Date: Jan 2014
Posts: 54
Received Thanks: 26
No, i wan't to Window Focus (click on League of Legends launcher in taskbar or similar)
TheAnonPanda is offline  
Old 06/22/2014, 20:37   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Then you're probably looking for WinActivate() although your switch statement looks weird to me.
alpines is offline  
Thanks
1 User
Old 06/22/2014, 21:29   #5
 
TheAnonPanda's Avatar
 
elite*gold: 0
Join Date: Jan 2014
Posts: 54
Received Thanks: 26
Yeah, can you please tell me how it works and how do i make it to switch to League of Legends?
-Don't mind the switch statement, it's perfect for me.
TheAnonPanda is offline  
Old 06/23/2014, 14:18   #6
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Code:
WinActivate("window title")
window title is your client title.
You can find it via AutoIt Window Info or by holding the mouse over the icon in the taskbar.
alpines is offline  
Thanks
1 User
Old 06/23/2014, 17:50   #7
 
TheAnonPanda's Avatar
 
elite*gold: 0
Join Date: Jan 2014
Posts: 54
Received Thanks: 26
One more question sir, i cound't find it on google, here it is: The Script: WinActivate("PVP.net Client")
MouseClick("left", 1413, 890, 1620)
MouseClick("left", 1402, 365, 1620)
MouseClick("left", 1402, 365, 1620)
MouseClick("left", 473, 846, 1620)
Works fine and the cases too, but, it doesen't stops clicking, it just shows LoL launcher and don't clicks and continues as it should, the mouse just simply clicks where you put it!
TheAnonPanda is offline  
Old 06/23/2014, 17:54   #8
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
If you'd post more of the script we can identify the problem. Here is no loop so it shouldn't click non-stop.
alpines is offline  
Thanks
1 User
Old 06/23/2014, 18:00   #9
 
TheAnonPanda's Avatar
 
elite*gold: 0
Join Date: Jan 2014
Posts: 54
Received Thanks: 26
WinActivate("PVP.net Client")
MouseClick("left", 1413, 890, 1620)
MouseClick("left", 1402, 365, 1620)
MouseClick("left", 1402, 365, 1620)
MouseClick("left", 473, 846, 1620)
This is the script, the mouse just keeps clicking, but, not where it should, should i make video?
TheAnonPanda is offline  
Old 06/23/2014, 18:08   #10
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Are you sure your coordinates and the amount of clicks are right?
Because 1620 clicks seems a bit unusual to me.
Here's the page to the documentation of MouseClick, maybe it'll help you
alpines is offline  
Thanks
1 User
Old 06/23/2014, 18:12   #11
 
TheAnonPanda's Avatar
 
elite*gold: 0
Join Date: Jan 2014
Posts: 54
Received Thanks: 26
Thanks bro, the number of clicks was wrong, i tought 1620 was the delay one!
TheAnonPanda is offline  
Old 06/23/2014, 18:50   #12
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
If that's so it's still wrong because the delay goes from 0 (instant) to 100 (slowest).
alpines is offline  
Old 06/23/2014, 20:09   #13
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
I don't really understand how does he want to delay it but you can use Sleep(1620) in between the clicks I think.
berkay2578 is offline  
Reply


Similar Threads Similar Threads
Frage Neues Kostüm Window(Window)
05/15/2013 - Metin2 Private Server - 11 Replies
Nabend. :) Ich habe da eine Frage, und zwar, ich habe mein Inventar etwas verändert das es so aussieht: http://s14.directupload.net/images/130513/l8u8u9m h.png Nun ist meine Frage, wie kann man machen, das die Kostüme nicht mehr in das Kleine Fenster gehen, sondern in den Kostüm Bereich im Inventar? Die Slots im Inventar sind bereits definiert.
JULY 19 2012 THIS FOR WINDOW 7 AND VISTA AND ALSO FOR WINDOW XP WALLHACK
07/27/2012 - Soldier Front Hacks, Bots, Cheats & Exploits - 11 Replies
DETECTED In window xp
Is there a way to stop the freeze when window isn't in focus?
10/25/2009 - Shaiya - 7 Replies
as the subject asks... Is there a way to stop the freeze when window isn't in focus?



All times are GMT +2. The time now is 23:40.


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.