Jump to content
HankHell

can anyone good at math help me?

Recommended Posts

HankHell

I'm trying to mathematically represent the center of each quadrant, regardless of screen resolution; as in my example:

 

screenquadrant1.png

Current x= and y= are based off of 1920x1080 resolution of course

(yes I know @DesktopHeight / 4 works too)

Edited by HankHell

Share this post


Link to post
Share on other sites
gillesg

Quadrant 1 : @desktopWidth/4   , @DesktopHeight/4

Quadrant 2 : 3 * @desktopWidth/4   , @DesktopHeight/4

Quadrant 3 : @desktopWidth/4   , 3 * @DesktopHeight/4

Quadrant 4 : 3 * @desktopWidth/4   , 3 * @DesktopHeight/4

 

  • Like 1

Share this post


Link to post
Share on other sites
HankHell

thank you so much

Share this post


Link to post
Share on other sites
HankHell
31 minutes ago, gillesg said:

Quadrant 1 : @desktopWidth/4   , @DesktopHeight/4

Quadrant 2 : 3 * @desktopWidth/4   , @DesktopHeight/4

Quadrant 3 : @desktopWidth/4   , 3 * @DesktopHeight/4

Quadrant 4 : 3 * @desktopWidth/4   , 3 * @DesktopHeight/4

 

I kept wanting to address it as an even integer

Share this post


Link to post
Share on other sites
HankHell

Assign("Hankhell", "Stupid")

Share this post


Link to post
Share on other sites
Jos
3 hours ago, HankHell said:

I kept wanting to address it as an even integer

Meaning what exactly? Which event?

2 hours ago, HankHell said:

Assign("Hankhell", "Stupid")

Is this a new form of trying to get attention or bumping?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
HankHell
30 minutes ago, Jos said:

Meaning what exactly? Which event?

Is this a new form of trying to get attention or bumping?

JOs

no, just trying to add little humor. I was trying to address 1/4th of the screen instead of 1/3rd. I don't know why you mods seem to pick on me after my .bat post, the question has been solved thanks a bunch to @gillesg

Share this post


Link to post
Share on other sites
HankHell

Problem Solved:

Quote

 

#include <MsgBoxConstants.au3>

HotKeySet("{F1}", "GetMpos") ;press F1 to get your current mouse position

HotKeySet("{F2}", "FindCenter") ;F2

HotKeySet("{F3}", "FindCenterLeft") ;F3
HotKeySet("{F4}", "FindCenterRight")    ;F4
HotKeySet("{F5}", "FindTopCenter")  ;F5
HotKeySet("{F6}", "FindBottomCenter")   ;F6

HotKeySet("{F7}", "FindTopLeftCorner")  ;F7
HotKeySet("{F8}", "FindTopRightCorner") ;F8
HotKeySet("{F9}", "FindBottomLeftCorner")   ;F9
HotKeySet("{F10}", "FindBottomRightCorner") ;F10

HotKeySet("{1}", "FindQ1")  ;1
HotKeySet("{2}", "FindQ2")  ;2
HotKeySet("{3}", "FindQ3")  ;3
HotKeySet("{4}", "FindQ4")  ;4

;HotKeySet("{5}", "FindBetweenQ1Q2Center")  ;5
;HotKeySet("{6}", "FindBetweenQ1Q3Center")  ;6
;HotKeySet("{7}", "FindBetweenQ2Q4Center")  ;7
HotKeySet("{8}", "FindBetweenQ3Q4Center")   ;8

HotKeySet("{ESC}", "End") ;ESC to close the program

While 1
    Sleep(100)
WEnd

Func GetMpos()

    $Mpos = MouseGetPos()
    $Mpos_x = $Mpos[0]
    $Mpos_y = $Mpos[1]

    Msgbox($MB_SYSTEMMODAL,"Mouse Coords", "x=" & $Mpos_x & " " & "y=" & $Mpos_y)

EndFunc

Func FindCenter()
    MouseMove((@DesktopWidth / 2), (@DesktopHeight / 2), 0)
    GetMpos()
EndFunc

Func FindCenterLeft()
    MouseMove(0, (@DesktopHeight / 2), 0)
    GetMpos()
EndFunc

Func FindCenterRight()
    MouseMove(@DesktopWidth, (@DesktopHeight / 2), 0)
    GetMpos()
EndFunc

Func FindTopCenter()
    MouseMove((@DesktopWidth / 2), 0, 0)
    GetMpos()
EndFunc

Func FindBottomCenter()
    MouseMove((@DesktopWidth / 2), @DesktopHeight, 0)
    GetMpos()
EndFunc

Func FindBottomRightCorner()
    MouseMove(@DesktopWidth, @DesktopHeight, 0)
    GetMpos()
EndFunc

Func FindTopRightCorner()
    MouseMove(@DesktopWidth, 0, 0)
    GetMpos()
EndFunc

Func FindBottomLeftCorner()
    MouseMove(0, @DesktopHeight, 0)
    GetMpos()
EndFunc

Func FindTopLeftCorner()
    MouseMove(0, 0, 0)
    GetMpos()
EndFunc

Func FindQ1()
    MouseMove((@DesktopWidth / 4), (@DesktopHeight / 4), 0)
    GetMpos()
EndFunc

Func FindQ2()
    MouseMove ((3 * @DesktopWidth / 4), (@DesktopHeight / 4), 0)
    GetMpos()
EndFunc

Func FindQ3()
    MouseMove ((@DesktopWidth / 4), (3 * @DesktopHeight / 4), 0)
    GetMpos()
EndFunc

Func FindQ4()
    MouseMove ((3 * @DesktopWidth / 4), (3 * @DesktopHeight / 4), 0)
    GetMpos()
EndFunc

Func FindBetweenQ3Q4Center();Between quadrant 3 and quadrant 4 Center
    MouseMove(@DesktopWidth / 2, ((@DesktopHeight /2) + (@DesktopHeight /4)), 0)
    GetMpos()
EndFunc

Func End()
    Exit
EndFunc

 

will clean code up later

Edited by HankHell

Share this post


Link to post
Share on other sites
Jos
1 hour ago, HankHell said:

I don't know why you mods seem to pick on me after my .bat post,

we don't pick on people unless they ask for it, like you did here! ;)

.. and the first line in that post was actually a sincere question as you did not define what event you were referring to. 
Whatever....

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
HankHell
24 minutes ago, Jos said:

we don't pick on people unless they ask for it, like you did here! ;)

.. and the first line in that post was actually a sincere question as you did not define what event you were referring to. 
Whatever....

Jos

that's not cool though, you shouldn't pick on forums members if you want to support your language (or fourms). You mods are extremely rude to members that want to support the community, and to those that ask for help. just simply because you are a developer means you know more about the language than anyone else just diving into it (like I did) that doesn't mean you should poke fun at others for not knowing as much as you do. I have helped several fourm members already, and I still get treated this way. <code updated>

Edited by HankHell

Share this post


Link to post
Share on other sites
Jos

What isn't cool, us picking on people that ask for it? 
You are kidding right?  Stop asking for it and blend in is what I would suggest and you see we will be pretty helpful. ;)

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
HankHell
3 minutes ago, Jos said:

What isn't cool, us picking on people that ask for it? 
You are kidding right?  Stop asking for it and blend in is what I would suggest and you see we will be pretty helpful. ;)

Jos

how is helping forums member and contributing to the website not "blending in" dude jos, you are the worst mods I've ever seen on any fourm. and yet I still contribute and update my code for others to enjoy.

Share this post


Link to post
Share on other sites
Somerset

Stop! Opinionated aversions do not go over well.


 

Spoiler

 

Share this post


Link to post
Share on other sites
HankHell
8 minutes ago, Somerset said:

Stop! Opinionated aversions do not go over well.

it's not opinionated, it's 100% the truth, however this is getting off topic now. my point is that I've made 44 other posts since then, and the mods gonna hold me against the 3rd and 4th posts? really sucks that I get trolled because of me wanting to share something with the community

 

Edited by HankHell

Share this post


Link to post
Share on other sites
UEZ
Global $aResult = FindCenterRectangle(0, 0, @DesktopWidth, @DesktopHeight)
ConsoleWrite("Center x: " & $aResult[0] & @CRLF)
ConsoleWrite("Center y: " & $aResult[1] & @CRLF)


Func FindCenterRectangle($fX1, $fY1, $fX2, $fY2) ;x1,y1 left upper coordinate, x2,y2 right bottom coordinate
    Local $iW = $fX2 - $fX1, $iH = $fY2 - $fY1
    Local $aCoordinate[2] = [$fX1 + $iW / 2, $fY1 + $iH / 2]
    Return  $aCoordinate
EndFunc

 


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Jos
4 hours ago, HankHell said:

it's not opinionated, it's 100% the truth, however this is getting off topic now. my point is that I've made 44 other posts since then, and the mods gonna hold me against the 3rd and 4th posts? really sucks that I get trolled because of me wanting to share something with the community

 

I actually didn't remember but see now how right I was in that last post... fuck it. :idiot:

Jos

  • Like 1

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×