PDA

View Full Version : [Other] [Mac/Osx] Hacking Applescript and WoW to Hell (Window positioning glory)



ViralInfection
02-08-2010, 05:46 PM
Hi Guys,

Posting to you from the Mac world of things, I created a very nasty hack for position your World Of Warcraft on Mac/OSX.

Requirements:

World Of Warcraft installed
Duplicated (CMD+D) World Of Warcraft clients

I name mine the following:

Box of Warcraft 1
Box of Warcraft 2
Box of Warcraft 3
Box of Warcraft 4

This script assumes you name yours the same way.

Working on a Sony XBR 1080 TV. Read below for tips on modification.


Modification Tips:

World of Warcraft loads it position from $HOME/Library/Preferences/com.blizzard.World\ of\ Warcraft.prefs

World of Warcraft does NOT play nice with AppleDisplayScaleFactor.

To setup your configuration you'll need to launch your World of Warcraft client position it where you'd like it, and close it (this saves WindowBounds & ZoomedWindowBounds) to com.blizzard.World\ of\ Warcraft.prefs which you can then paste in the script for each client. However AppleDisplayScaleFactor effects WoW position in weird ways, like it constantly wants to center wow if it cannot find enough space, this can be avoided by copying the exact values from com.blizzard.World\ of\ Warcraft.prefs after you've just closed it.

While scripting this I used terminal to cat com.blizzard.World\ of\ Warcraft.prefs after each change, thus getting the values I liked, you'll need to do this annoying processing again and again to get those values.




-- sets the windows position to 0,44
do shell script "echo '#Current User\\World of Warcraft\\Client\\HWCpuIdx
1
#Current User\\World of Warcraft\\Client\\HWMemIdx
0
#Current User\\World of Warcraft\\Client\\HWSoundIdx
0
#Current User\\World of Warcraft\\Client\\HWVideoID
168
$Current User\\World of Warcraft\\Client\\MoveLogFile
ClientMovement.txt
#Current User\\World of Warcraft\\Client\\SendErrorLogs
1
$Current User\\World of Warcraft\\Client\\WindowBounds
332,44,800,644
$Current User\\World of Warcraft\\Client\\ZoomedWindowBounds
336,44,1712,1076' > $HOME/Library/Preferences/com.blizzard.World\\ of\\ Warcraft.prefs"


tell application "World of Warcraft"
activate
end tell

--adjusts the size of the rest of the wow accounts, launches them, and then resets the scale back to default size

do shell script "defaults write NSGlobalDomain AppleDisplayScaleFactor 0.42"

-- set the windows position to while under AppleDisplayScaleFactor
do shell script "echo '#Current User\\World of Warcraft\\Client\\HWCpuIdx
1
#Current User\\World of Warcraft\\Client\\HWMemIdx
0
#Current User\\World of Warcraft\\Client\\HWSoundIdx
0
#Current User\\World of Warcraft\\Client\\HWVideoID
168
$Current User\\World of Warcraft\\Client\\MoveLogFile
ClientMovement.txt
#Current User\\World of Warcraft\\Client\\SendErrorLogs
1
$Current User\\World of Warcraft\\Client\\WindowBounds
0,98,800,644
$Current User\\World of Warcraft\\Client\\ZoomedWindowBounds
0,0,0,0' > $HOME/Library/Preferences/com.blizzard.World\\ of\\ Warcraft.prefs"

tell application "Box of Warcraft 1"
activate
end tell

do shell script "echo '#Current User\\World of Warcraft\\Client\\HWCpuIdx
1
#Current User\\World of Warcraft\\Client\\HWMemIdx
0
#Current User\\World of Warcraft\\Client\\HWSoundIdx
0
#Current User\\World of Warcraft\\Client\\HWVideoID
168
$Current User\\World of Warcraft\\Client\\MoveLogFile
ClientMovement.txt
#Current User\\World of Warcraft\\Client\\SendErrorLogs
1
$Current User\\World of Warcraft\\Client\\WindowBounds
0,722,800,1322
$Current User\\World of Warcraft\\Client\\ZoomedWindowBounds
0,0,0,0' > $HOME/Library/Preferences/com.blizzard.World\\ of\\ Warcraft.prefs"

tell application "Box of Warcraft 2"
activate
end tell

do shell script "echo '#Current User\\World of Warcraft\\Client\\HWCpuIdx
1
#Current User\\World of Warcraft\\Client\\HWMemIdx
0
#Current User\\World of Warcraft\\Client\\HWSoundIdx
0
#Current User\\World of Warcraft\\Client\\HWVideoID
168
$Current User\\World of Warcraft\\Client\\MoveLogFile
ClientMovement.txt
#Current User\\World of Warcraft\\Client\\SendErrorLogs
1
$Current User\\World of Warcraft\\Client\\WindowBounds
0,1343,800,1944
$Current User\\World of Warcraft\\Client\\ZoomedWindowBounds
0,0,0,0' > $HOME/Library/Preferences/com.blizzard.World\\ of\\ Warcraft.prefs"

tell application "Box of Warcraft 3"
activate
end tell

do shell script "echo '#Current User\\World of Warcraft\\Client\\HWCpuIdx
1
#Current User\\World of Warcraft\\Client\\HWMemIdx
0
#Current User\\World of Warcraft\\Client\\HWSoundIdx
0
#Current User\\World of Warcraft\\Client\\HWVideoID
168
$Current User\\World of Warcraft\\Client\\MoveLogFile
ClientMovement.txt
#Current User\\World of Warcraft\\Client\\SendErrorLogs
1
$Current User\\World of Warcraft\\Client\\WindowBounds
0,1969,800,2570
$Current User\\World of Warcraft\\Client\\ZoomedWindowBounds
0,0,0,0' > $HOME/Library/Preferences/com.blizzard.World\\ of\\ Warcraft.prefs"

tell application "Box of Warcraft 4"
activate
end tell

do shell script "defaults write NSGlobalDomain AppleDisplayScaleFactor 1.0"


--entering your teams information - yes copied from some other post (lost link pm me for credit plz)
--Lead
set firstString to "ACCOUNT_NAME_1"
set secondString to "PASSWORD_HERE"
--1st Slave
set thirdString to "ACCOUNT_NAME_2"
set fourthString to "PASSWORD_HERE"
--2nd Slave
set fifthString to "ACCOUNT_NAME_3"
set sixthString to "PASSWORD_HERE"
--3rd Slave
set seventhString to "ACCOUNT_NAME_4"
set eigthString to "PASSWORD_HERE"
--4th Slave
set ninthString to "ACCOUNT_NAME_5"
set tenthString to "PASSWORD_HERE"

delay 1

tell application "System Events"
tell application "World of Warcraft" to activate
keystroke firstString
keystroke tab
keystroke secondString
keystroke return
end tell

delay 1

tell application "System Events"
tell application "Box of Warcraft 1" to activate
keystroke thirdString
keystroke tab
keystroke fourthString
keystroke return
end tell

delay 1

tell application "System Events"
tell application "Box of Warcraft 2" to activate
keystroke fifthString
keystroke tab
keystroke sixthString
keystroke return
end tell

delay 1

tell application "System Events"
tell application "Box of Warcraft 3" to activate
keystroke seventhString
keystroke tab
keystroke eigthString
keystroke return
end tell

delay 1

tell application "System Events"
tell application "Box of Warcraft 4" to activate
keystroke ninthString
keystroke tab
keystroke tenthString
keystroke return
end tell

READY TO MULTIBOX ON MAC

* Note to site/forum admins - I HATE CHARACTER LIMITS ON SEARCHES. For example: MAC = 3 chars, OSX = 3 chars, WTF?

PS: Shoutouts to Void for kicking ass, <3 PÄinz

lacitpo
02-22-2010, 04:19 AM
I'm assuming this doesn't, but does your script allow resizing outside of the constraints placed on wow windows while dragging the bottom right corner?

shadewalker
02-26-2010, 03:40 PM
you can use the terminal to make your wow's smaller than normal but the ratio restraints will stay the same.

use the following command then launch the clients you want smaller. note that you may want to change the .75 to a number better for you.

defaults write NSGlobalDomain AppleDisplayScaleFactor .75

after launching the clients issue

defaults write NSGlobalDomain AppleDisplayScaleFactor 1

to get new programs to launch at the standard size.