Jump to content

Getting Window Size


Ganzor
 Share

Recommended Posts

Here is the script I am trying to make...I am trying to grab the size of the window in an if statement. Is there a command to do it?

;AutoLogin script for Eve Online
;Game must be in full screen
;Must have logged in once manually before using this script

;initialize variables
$num = 0
$width = 1680
$height = 1050
$account = "AccountName"
$pass = "Password"
$gamepath = "C:\Program Files\CCP\EVE\eve.exe"

#requireadmin
;Run the 'Eve Online' Game
Run($gamepath)

;Go through a while loop until the window is active, in full screen, and the commands are sent.
;PS: Yes, I know WinSize is not a real command, I'm looking for a real command to replace it.
While $num < 1
If WinSize=($height,$width) Then
    If WinActive("EVE") Then
        $num = 1
        Sleep(250)
        Send("{TAB}{TAB}")
        Send("^a")
        Send($account)
        Send("{TAB}{TAB}")
        Send($pass)
        Send("{ENTER}")
    EndIf
EndIf
WEnd
Link to comment
Share on other sites

  • Developers

I saw a related command: WinGetClientSize("")

When trying to use it I keep getting a syntax error.

$size = WinGetClientSize("")
If $size[0]=($width) & $size[1]=($height) Then

What is the correct syntax?

The client size is different from the window size... anyways: your IF is coded wrong ... use AND not &

:)

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

Link to comment
Share on other sites

The client size is different from the window size... anyways: your IF is coded wrong ... use AND not &

Awesome, got that part working :-) One last question, if AND replaces &, what replaces '!=' - NotEqual?

Edit: I think I found it - this will check to make sure the background at that point is black, correct?

$color = PixelGetColor(10, 100)

If Hex($color, 6) = Not 000000 Then

Edited by Ganzor
Link to comment
Share on other sites

Awesome, got that part working :-) One last question, if AND replaces &, what replaces '!=' - NotEqual?

Edit: I think I found it - this will check to make sure the background at that point is black, correct?

$color = PixelGetColor(10, 100)

If Hex($color, 6) = Not 000000 Then

If Hex($color, 6) <> 000000 Then ...............?

Link to comment
Share on other sites

If Hex($color, 6) <> 000000 Then ...............?

Ignore whats after the then...I just wanted to make sure that it would check the pixel color correctly :-) What are the <> for? Are they necessary? (It's my first day trying out autoit, sorry about all the questions :))

Link to comment
Share on other sites

  • Developers

your If is wrong... should be:

If Hex($color, 6) <>  "000000" Then

Because Hex returns a string and the "= not" is something totally different .

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...