The first challenge posed to me was crashing clients and getting them to come back up. This can be done multiple ways. We can open the shortcut and launch the game, click play, enter password, select character, hit enter and off we go. The issue is when there are multiple clients up and I am not sure which folder to reopen. Sure I could get my head together and remember which account is in what position on the screen or I could entertain myself by asking hotkey net to check for which account is missing from the formation. This same check will be used to open all accounts. Below is the check used to open one account. I'll duplicate it for 4 accounts as well. Passwords will be entered as PASSWORD as well as any other sensitive information if it exists. You will see my character names. Say hi sometime! Below is the script used to rename windows if they exist. If they do not exist they will be launched.
By renaming the window in the beginning of the script it will handle issues when a client is lost on zoning. Each time we zone, the window is renamed to "Anarchy Online - charactername" Perhaps I could not rename the character windows and instead use scripts to send commands to each char name. For the purpose of easily switching characters while refering to each as ao1 ao2 ao3 etc, I rename them. My thinking may evolve but it works for me.
Initial scripts will be loaded with // comments. As I expand on them and learn, I will remove the comments assuming you have learning as well or already know.
pastebin.com/kKhArD5R
Code:
// anything with // is a comment. It is ignored by code. I use it to communicate notes to myself as well as readers
//Once you get the hang of it you can delete all the lines starting with // I paste it into excel then delete each row that starts with // YMMV
//with scroll lock on I press shift+alt+Ctrl+r to activate the hotkey
<hotkey ScrollLockOn shift ctrl alt r>
// substitute local with ip if a networked pc is used to run clients
<sendpc local>
//using this I look for a window to already exist with the character name. If it does, it is renamed so the following check will return false.
<RenameWin "Anarchy Online - Tyreento" ao1>
//If the above did not rename anything then it will launch the client. It it does exist then the check will return false. No other checks are in place so nothing occurs.
<if WinDoesNotExist "ao1">
//If this proceeds, the above checks were false and the game is not running this character
<open "C:\Users\Aaron\Desktop\AO shortcuts\AnarchyOnline ao1">
//The first window opening is the license agreement. 10000 allows for a ten second wait until the window shows up
<waitforwin "End User License Agreement:" 10000>
//once the window pops up, we identify it and make it active for keys
<targetwin "End User License Agreement:">
//2 second pause to allow window time to receive input
<wait 2000>
//enter to accept license agreement. I have seen some use code that will click Rmouse button on the agree button bases on the x,y location on screen
<key enter>
//Here we are looking for the patcher to load
<waitforwin "Anarchy" 10000>
//Patcher is up. Now we target the window to accept keys
<targetwin "Anarchy">
//give the patcher 3 sec to load.
<wait 3000> //Let patcher load
//hit enter to "Play"
<key enter>
//if a delay is not entered here then it will proceed to enter the password on the patcher screen since it is named "anarchy online". Not helpful. So the 8 second delay is added to wait for the "play" to process
//then patcher to go away and the game to load. 8 seconds may not be necessary but as more clients are loaded it may take more time to proceed.
<wait 8000>
//8 seconds passed, patcher is down, no other window should start with the name "Anarchy Online" unless it's the login screen. Now let's look for it.
<waitforwin "Anarchy Online" 10000>
// boom it there, now lets target it for commands
<targetwin "Anarchy Online">
//because I use a different folder for every account, the account name is already defaulted and I have to just type the password
<text PASSWORD>
//wait 1 second to give time for the password to be typed
<wait 1000>
//hit enter so password can be accepted
<key enter>
//wait for character select screen otherwise "enter" will not be effective
<wait 2500>
//character is already defaulted, lets play! If you intend to use a different character than the last one you played, you may need to broadcast up or down depending where the character is located
//on the roster. I suggest pressing up however many character slots you can have THEN press down once for each slot your intended character is down from the top
<key enter>
//now we wait for the window labeled by the character name. wait can be as long as needed in case you load slower. once window shows up the wait will stop. If wait is not applied the next "if" will not process correctly since it will see "Anarchy Online - Tyreento" as "Anarchy Online"
<waitforwin "Anarchy Online - Tyreento:" 20000>
//repeat the first command that would rename the character window to ao1 which is called on later. completing this step will cause the first 2 steps to report false and nothing will happen with this script.
//if hotkey is pressed again, nothing will occur even in the hotkeynet window
<RenameWin "Anarchy Online - Tyreento" ao1>
<endif>
Learn more about if/else from hotkeynet at http://www.hotkeynet.com/ref/if.html