Page 38 of 46

Re: rock5's "fastLogin Revisited"

Posted: Sun Apr 06, 2014 3:00 pm
by Notorious
rock5 wrote:@Notorious, I think I found the problem. The gameState function was sometimes reporting that it was at the character selection even though it wasn't. So it would try to click the character then press Enter. This caused the Enter to cancel the login process. As you may know, if you cancel the login, it pops up the server selection screen.

I found what I think is a better pointer. Here is a version of userfunction_login.lua using the new address. It should only work with latest official version of rom 6.0.7 as it's using a static address. Tell me if it works and I'll see about adding a pattern search for it so it will work with all versions.
Hi rock5
I found a new problem, now after login to account and server bot not selected character. MM does not report any error just stop at "Chose account xx"

Re: rock5's "fastLogin Revisited"

Posted: Sun Apr 06, 2014 9:28 pm
by rock5
I ran through my relog test script twice, going through all my alt characters twice, and I didn't get that problem. If it gets to the character selection screen but doesn't try to click the character then it is either waiting for the gamestate to change or it's waiting for the client to become the foreground window.

If it's waiting for the client to become the foreground window then you should see the client icon flashing in the Windows taskbar, well that's what you see in Windows 7. You can double check whether this the problem by clicking on the client window when it gets stuck to make sure it's the active window. If it doesn't resume then that wasn't the problem.

If it's waiting for the gamestate to change then that means the gamestate is reporting the wrong state. I'll probably have to add some print messages to figure out what's happening.

Re: rock5's "fastLogin Revisited"

Posted: Tue Apr 08, 2014 12:20 pm
by Notorious
Hmm with this script all works great:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">

<onLoad>

function relog()
   -- 2 CharLists for 2 clients running at the same time
   SetCharList({{
      {account=2 , chars= {3,4,5,6,7,8}},
      {account=3 , chars= {1,2,3,4,5,6,7,8}},
      {account=4 , chars= {1,2,3,4,5,6,7,8}},
   

   },{
      {account=5 , chars= {1,2,3,4,5,6,7,8}},
      {account=6 , chars= {1,3,4,5,6,7,8}},
      
   }})

      SetChannelForLogin("random")
	  SetRestartClientSettings(2,"rom")
      LoginNextChar()
      loadProfile()
      loadPaths(__WPL.FileName)
	  
   
end
relog()
</onLoad>
</waypoints>
Later I again test the full script

Re: rock5's "fastLogin Revisited"

Posted: Wed Apr 09, 2014 5:24 am
by Notorious
I know what causes the error :D
http://www.solarstrike.net/phpBB3/viewt ... =27&t=3811
When bot mode is enable script stops after "Click account X". In normal mode all is ok.
I know you have not support this project, but I use it often and I like it.

Re: rock5's "fastLogin Revisited"

Posted: Wed Apr 09, 2014 9:25 am
by rock5
Yeah, I'm wary of using the model file now, because I know it can cause problems. If I want to improve performance I usually just rename the texture fdbs and only use the 'fx' folder in the models folder. Just to keep it simple.

Re: rock5's "fastLogin Revisited"

Posted: Tue Apr 29, 2014 7:08 pm
by cibervagos
Hi all. I have a little problem. When I use ChangeCharRestart() or login() MM never select my character. I put some print() in userfunction_login and MM stuk here.

Code: Select all

	 repeat
		rest(4000)
	until gameState() == 2
I never use model or any other modified file. Sorry for my english. I not english speaker.

Re: rock5's "fastLogin Revisited"

Posted: Tue Apr 29, 2014 9:34 pm
by rock5
What does it return as the gameState()? Just add a print that prints it inside the loop.

Re: rock5's "fastLogin Revisited"

Posted: Wed Apr 30, 2014 11:41 am
by cibervagos
Ty for ur help. I solved it. gameState() = 0 in character selection screen. So I changed my userfunction_login from

Code: Select all

	repeat
		rest(4000)
	until gameState() == 2
to

Code: Select all

	repeat
		if gameState() ~= juego then
			local juego = gameState();
			print("Debugg gameState Seleccion PJ ..."..juego.."\n");
		end
		rest(4000)
	until gameState() == 0
Now work fine for me. Ty.

Re: rock5's "fastLogin Revisited"

Posted: Wed Apr 30, 2014 7:23 pm
by rock5
I'm happy you got it working but that's not really a fix. A gamestate of 0 means it thinks it's between states. I'm surprised your fix works. I'm not sure what's going on there but I'm working on a new version that uses a better memory address for the character selection screen. Hopefully it will work for you.

Re: rock5's "fastLogin Revisited"

Posted: Fri May 16, 2014 11:43 pm
by Notorious
How to kill the client when the last char end?

Re: rock5's "fastLogin Revisited"

Posted: Fri May 16, 2014 11:58 pm
by rock5

Code: Select all

if IsLastChar() then
    killClient()
    error("Client killed. Stopping bot")
end
You would use that before calling LoginNextChar() or ChangeChar().

Re: rock5's "fastLogin Revisited"

Posted: Sat May 17, 2014 2:44 am
by ZZZZZ
rock5 wrote:

Code: Select all

if IsLastChar() then
    killClient()
    error("Client killed. Stopping bot")
end
You would use that before calling LoginNextChar() or ChangeChar().
You could also use the variable built into LoginNextChar:

Code: Select all

Quit_Game = "true"
LoginNextChar()
loadProfile()						
line 202 of LoginNextChar

Code: Select all

if nextAcc == nil then
		if (Quit_Game == "true") then
			-- we will quit game
			print("Last player finished. We will Quit game")
			RoMScript("QuitGame()")
		else			-- Last character
			print("Last player finished.")
			player:logout()
		end
	end

Re: rock5's "fastLogin Revisited"

Posted: Sat May 17, 2014 3:01 am
by rock5
Yeah, there's that too. Forgot all about that option.

Re: rock5's "fastLogin Revisited"

Posted: Sat May 17, 2014 10:22 pm
by rock5
Updated fastlogin (loginxml) to version 3.51. No big changes.
  • - Changes default for fastLoginRegSel to nil so default for channel is now random.
    - Moved getDefaultName() to accountlogin.lua.
    - Fixed pr function to handle tables with functions for keys. Thx dx876234.

Re: rock5's "fastLogin Revisited"

Posted: Sun May 18, 2014 10:13 pm
by rock5
Updated fastlogin to version 3.511 to fix a bug I introduced in 3.51 that caused ChangeChar to fail.

Re: rock5's "fastLogin Revisited"

Posted: Mon May 26, 2014 6:41 pm
by ZZZZZ
Just wondering, how does loginxml remove the 10 second delay with logging out? I want to look into making it also remove the delay for switching channels, or at least lowering it to 5 seconds or so. Just have no idea if its even possible.

Re: rock5's "fastLogin Revisited"

Posted: Mon May 26, 2014 8:28 pm
by rock5
When you log out the game executes Logout() which includes the timer. It was discovered that using DisconnectFromServer() was a faster way to log off so loginxml replaces the Logout function with it's own that uses DisconnectFromServer().

Code: Select all

function Logout()
	RealmServer = GetCurrentRealm()
	DisconnectFromServer()
end
I don't know if something similar can be done with changing channel. I can tell you the command it executes when you change channel is ChangeParallelID(num). I'm not aware of any other way to change channel.

Re: rock5's "fastLogin Revisited"

Posted: Sun Jun 01, 2014 2:35 pm
by leroy
Some NPC's are only available in 1 channel. Like the current badges/bags NPC is only in channel 1. SetChannelForLogin() works when relogging chars but not when restarting client with SetRestartClientSettings().
So I modified some files to click the desire channel when restarting client.
It works when used from a waypoint but also from batchfile.
In waypoint use: SetRestartClientSettings(frequency, "link2romclient", channel)
In batchfile use: micromacro.exe "login.lua" acc:## char:## client:link2romclient chan:channel
Where channel can be 1,2 or 3.

Re: rock5's "fastLogin Revisited"

Posted: Sun Jun 01, 2014 7:36 pm
by rock5
Good work. I still don't know if I'd implement it though. In a later version I posted later in the topic I have login accepting size info for the client and console

Code: Select all

login(character, account, client, clientx, clienty, clientw, clienth, consolex, consoley, consolew, consoleh)
So if I added the channel argument and a user didn't want to use it they would have to still add a nil value to bypass it, eg.

Code: Select all

login(character, account, client, nil, clientx, clienty, clientw, clienth, consolex, consoley, consolew, consoleh)
That's a bit annoying.

This is something that is needed but there are options, now. You can set the default starting channel in the accountlogin.lua file

Code: Select all

-- >>>>>>>> ENTER THE NUMBER OF THE CHANNEL YOU WANT TO BE AUTO SELECTED <<<<<<<<
fastLoginRegSel = 1
You can change channel after logging on, eg.

Code: Select all

if RoMScript("GetCurrentParallelID()") ~= 1 then
    SetChannelForLogin(1)
    ChangeChar("current")
end
Yeah, so I'm still undecided. I might do it but I'm not sure.

Re: rock5's "fastLogin Revisited"

Posted: Sun Jun 01, 2014 7:49 pm
by rock5
Might as well give you some feed back while I'm at it.

Function clickCharacter is missing a line

Code: Select all

	moveX,moveY = x+w+xPer*h/100, y+h/2+yPer*h/100
I think you accidentally moved it instead of copying it.

You probably do not want to make it mandatory to specify a channel.

Code: Select all

	if not channel then
		error("No channel specified.")
	end
You probably don't need to release then reserve the active window between these 2 steps.

Code: Select all

	-- Click channel
	reserveActiveWindow()
	print("Selecting channel "..channel.." ... ")
	clickChannel(channel) rest(500)
	releaseActiveWindow()

	-- Click character
	reserveActiveWindow()
	print("Selecting character "..character.." ... ")
	clickCharacter(character) rest(500)
	keyboardPress(key.VK_ENTER)
	releaseActiveWindow()
Ah..., that's it.