Jump to content

Cant Read Text In Window


Guest John Renauld
 Share

Recommended Posts

Guest John Renauld

:whistle: Im try to open my Diablo II expansion at startup up of my computer (Wich i still dont know how to copy into the starup). I got it all down until the password screen. I want the program to wait till the right Window is opened.

Example:

IfWinActive, Diablo II, Password, Goto EnterPassword

B) The problem is that it doesnt read the word Password in the window. I tried making it uppercase or lower case but i got nothing. Maybe its the program itself. Maybe its because it all templates and nothing but. BUT I NEED AN ANSWER PLZ.

Srry for caps. Apreciate any replys.

Link to comment
Share on other sites

It's ugly but it works. This script will read all account settings from a file, start Diablo and log an account in. You will be left in the 'lobby'.

SetEnv, Load_Delay, 0
SetEnv, Game_Delay, 0
SetEnv, CharLocation, 0

SetEnv, SettingsFile, %A_SCRIPTDIR%\\DiabloSettings.ini

IniRead, Load_Delay, %SettingsFile%, Settings, D2LoadDelay
IniRead, D2Path, %SettingsFile%, Settings, D2Path
IfEqual, D2Path, , RegRead, D2Path, REG_SZ, HKEY_CURRENT_USER, Software\\Blizzard Entertainment\\Diablo II, InstallPath
IniRead, D2Executable, %SettingsFile%, Settings, D2Executable
IfEqual, D2Executable, , SetEnv, D2Executable, Diablo II.exe
IniRead, D2_Title, %SettingsFile%, Settings, D2Title

Gosub, StartDiablo
Gosub, InitAccount
Gosub, AccountLogon
Gosub, CharLocation
Exit


StartDiablo:

Run, %D2Path%\\%D2Executable% %Diablo_Switches%, %D2Path%
Sleep, %Load_Delay%
WinActivate, Diablo II,,
Sleep, 1000
WinMove, Diablo II,, 0, 0, default, default
Sleep, 1000
Return

InitAccount:

IniRead, Account_Name, %SettingsFile%, Slot%Slot_Number%, AccountName
IniRead, Account_Password, %SettingsFile%, Slot%Slot_Number%, Password
IniRead, CharLocation, %SettingsFile%, Slot%Slot_Number%, Char_Location
IniRead, Realm_Selection, %SettingsFile%, Slot%Slot_Number%, Realm
IfEqual, Realm_Selection, West, Gosub, WestLogon
IfEqual, Realm_Selection, East, Gosub, EastLogon
Return

WestLogon:

Sleep, 1000
Send, {ESCAPE}
;Bring us to the realm-selection screen

Sleep, 1000
MouseMove, 408, 403
LeftClick, 408, 403
Sleep, 1000
;Move to realm selection, click on realm selection and pause

MouseMove, 296, 374
LeftClick, 296, 374
LeftClick, 296, 374
Sleep, 1000
MouseMove, 404, 374
LeftClick, 404, 374
Sleep, 5000
Return

EastLogon:

Sleep, 1000
Send, {ESCAPE}
;Bring us to the realm-selection screen

Sleep, 1000
MouseMove, 408, 403
LeftClick, 408, 403
Sleep, 1000
;Move to realm selection, click on realm selection and pause

MouseMove, 300, 400
LeftClick, 300, 400
LeftClick, 300, 400
Sleep, 1000
MouseMove, 404, 374
LeftClick, 404, 374
Sleep, 5000
Return

AccountLogon:

Send, {TAB}
Sleep, 1000
Send, %Account_Name%
Sleep, 1000
Send, {TAB}
Sleep, 1000
Send, %Account_Password%
Sleep, 1000
Send, {ENTER}
Sleep, 8000
Return

CharLocation:

IfEqual, CharLocation, 1, Send, {ENTER}
IfEqual, CharLocation, 2, Send, {RIGHT}{ENTER}
IfEqual, CharLocation, 3, Send, {DOWN}{ENTER}
IfEqual, CharLocation, 4, Send, {RIGHT}{DOWN}{ENTER}
IfEqual, CharLocation, 5, Send, {DOWN}{DOWN}{ENTER}
IfEqual, CharLocation, 6, Send, {RIGHT}{DOWN}{DOWN}{ENTER}
IfEqual, CharLocation, 7, Send, {DOWN}{DOWN}{DOWN}{ENTER}
IfEqual, CharLocation, 8, Send, {RIGHT}{DOWN}{DOWN}{DOWN}{ENTER}

Sleep, 6000
Return

A little reading goes a long way. Post count means nothing.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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