Automatic 'login' script
Posted: Mon Feb 18, 2013 7:35 am
Login.lua
This script automatically starts a client, clicks the account, selects the character and enters the game. Then it starts the bot and passes any left over arguments to the bot. This script is only required if you want to initially start the game client with a script.
Installation:
Limitations:
userfunction_login.lua
You can also use the killClient() command to kill the current client before you start another with the login function.
This script automatically starts a client, clicks the account, selects the character and enters the game. Then it starts the bot and passes any left over arguments to the bot. This script is only required if you want to initially start the game client with a script.
Installation:
- - Put login.lua in your 'rom' folder.
- Put shortcut links to your game clients in your 'rom' folder, preferably renamed to something short, eg. rom4u. If you only use one client then name the link "rom" and it will be used by default. No need to use the "client" argument. If you want to change the default then change the variable at the top of the userfunction_login.lua file.
- - A Version of my 'fastlogin' addon with the 65 or 108 login buttons.
- The userfunction_login.lua installed in the userfunction folder.
- rom/login acc:accountnum char:charnum client:shortcutname
"acc" and "char" are mandatory but "client" is optional if the default link "rom" exists.
- From the Micromacro console
Code: Select all
rom/login acc:48 char:2 client:rom4u path:cot_tele
- Or starting multiple clients from a batch file
Code: Select all
FOR /F "tokens=1 delims=" %%A in ('cd') do SET folder=%%A
START ../../micromacro.exe "%folder%/login.lua" acc:45 char:1 client:rom4u path:path1
START ../../micromacro.exe "%folder%/login.lua" acc:46 char:1 client:rom4u path:path2
START ../../micromacro.exe "%folder%/login.lua" acc:47 char:1 client:rom4u path:path3
- As of version 3 there are no limitations. Clients can be started at the same time. The login script keeps track of which bot has the active window.
- - It makes sure it connects to the just-started client. It wont get mixed up if other clients are already open.
- Because __WIN and __PROC are already set, when the bot starts, it doesn't need the 'character' argument to know which client to connect to.
- The mouse clicks are accurate regardless of the window shape or size.
- The shortcuts don't need the NoCheckVersion set. The script handles it.
- It avoids conflicts when multiple logins need the clients active at the same time, so you can start them at the same time.
userfunction_login.lua
- This file has all the actual login functions. This is the only file required to make use of the new restart options available in the LoginNextChar userfunction.
- - Put shortcut links to your game clients in your 'rom' folder, preferably renamed to something short, eg. rom4u. If you only use one client then name the link "rom" and it will be used by default. No need to use the "client" argument. If you want to change the default then change the variable at the top of the file.
- New option: I've added support for a server/link list. It will still default to 'rom' link so if you only use the one link you don't need to use the server/link list. But if you do use more than one link, you can include a file in the same folder as userfunction_login.lua, called 'ServerLinkList.lua', for the other links besides 'rom'. So you can still avoid having to use the client argument. Eg. mine looks like this- The userfunction.login.lua goes in the "userfunctions" folder.Code: Select all
ServerLinkList = { ["Sin City"] = "rom4u", ["Angel City"] = "rom4u", }
- Changed in version 3 to be more user friendly.
- login(charnum, accountnum, "shortcutname")
Code: Select all
login( 2,48, "rom4u")