Page 1 of 1

Fast login

Posted: Wed Oct 23, 2013 1:05 am
by ZZZZZ
When using fast login i get this error:

Code: Select all

Moving to waypoint #13, (4778, -2014)
Changing to character 1 account 3.
Player address changed: 0x2CCF0F00
Maximum range of range attack skills is less than COMBAT_DISTANCE 70. Reducing C
OMBAT_DISTANCE setting to 50.
Maximum range of range attack skills is less than COMBAT_DISTANCE 70. Reducing C
OMBAT_DISTANCE setting to 50.
Maximum range of range attack skills is less than COMBAT_DISTANCE 70. Reducing C
OMBAT_DISTANCE setting to 50.
Maximum range of range attack skills is less than COMBAT_DISTANCE 70. Reducing C
OMBAT_DISTANCE setting to 50.
Loading profile userdefault.xml
Testing 'ingamefunctions' macro. If it gets stuck here, please update the 'ingam
efunctions' by copying the 'ingamefunctions' folder from 'rom/devtools' to the g
ames 'interface/addons' folder.
MACRO Test: ok
Ranged skill found: PRIEST_RISING_TIDE
The game client did not crash.
3:18pm - [string "              LoginNextChar()..."]:3: attempt to index global
'D' (a nil value)
Im lost as to what is causing it, i have the fastlogin userfunction and in onload i have

Code: Select all

<onLoad>
SetCharList({{
			{account=13, chars= {1}},
			{account=14, chars= {1}},
		},
		{
			{account=1, chars= {1,4,5}},
			{account=2, chars= {1,2,6}},
			{account=3, chars= {1,2,3}},
}})
</onLoad>

Code: Select all

	<!-- #  3 --><waypoint x="4805" z="-1988" y="115">		
	LoginNextChar()
		loadProfile()
   	  loadPaths(D.H-Survival)
	</waypoint>
Any info would be great, thanks.

Re: Fast login

Posted: Wed Oct 23, 2013 1:16 am
by Eggman1414
loadPaths(D.H-Survival)
That seems to be your error.

The reason
attempt to index global
'D'
Your path is reading as D.H-Survival, like cmd.exe H-Survival is .exe

I believe thats the reason. Im sure someone will correct me if it is wrong.

Re: Fast login

Posted: Wed Oct 23, 2013 2:15 am
by rock5
Actually I think it is seeing it as 2 variables, D.H and Survival, and it is seeing it as a mathematical calculation, D.H minus Survival. The error you get is because D doesn't exist as a table so it can't have a sub value of H. Try putting quotes around the name. If it still doesn't work it might be because it's not a valid file name, so try renaming it.

Re: Fast login

Posted: Wed Oct 23, 2013 4:12 am
by ZZZZZ
I never would have guessed that >.< Using "D.H-Survival" worked, thanks guys.

Re: Fast login

Posted: Wed Oct 23, 2013 4:50 am
by ZZZZZ
Also, rather than starting a new thread figured i would ask here, is it possible to check for a mount, and if you dont have one use mount rental tickets until you get a 7 day mount?

something like:

Code: Select all

If player has mount then
player:mount();
else
repeat
   inventory:update();
   if inventory:itemTotalCount("Horse Rental Ticket") > 0 then
     inventory:useItem("Horse Rental Ticket");
	end
   until inventory:itemTotalCount("Horse Rental Ticket") == 0 or inventory:itemTotalCount(202095,202455,202246) > 0  -- the three 7 day horses from rental tickets.
end

Re: Fast login

Posted: Wed Oct 23, 2013 5:54 am
by rock5
There is inventory:getMount() but that doesn't cover partner bags. So this should tell you if you have a mount

Code: Select all

	if RoMScript("PartnerFrame_GetPartnerCount(2)") > 0 or inventory:getMount() then
		player:mount()
The rest of it looks ok although you could simplify it. You don't need inventory:update() because both itemTotalCount and useItem update it. You don't even need to count the tickets. There is no harm in trying to use an item you don't have. So you could finish it like this

Code: Select all

else
	repeat
		inventory:useItem("Horse Rental Ticket");
	until inventory:itemTotalCount("Horse Rental Ticket") == 0 or inventory:itemTotalCount(202095,202455,202246) > 0  -- the three 7 day horses from rental tickets.
end
Or to avoid using a ticket when you don't have one, anyway, you could do,

Code: Select all

else
	while inventory:itemTotalCount("Horse Rental Ticket") >0 and inventory:itemTotalCount(202095,202455,202246) == 0  do -- the three 7 day horses from rental tickets.
		inventory:useItem("Horse Rental Ticket");
	end
end

Re: Fast login

Posted: Fri Oct 25, 2013 1:35 am
by ZZZZZ
Thanks again Rock, made it into a function, had some issues with finding the mount just after loading in a new character with fastlogin but added player:update() and inventory:update(). Wasn't sure which 1 updates partner bag so did both to be safe.

Code: Select all

function MOUNT()
	   player:update()
	   inventory:update();
	if RoMScript("PartnerFrame_GetPartnerCount(2)") > 0 or inventory:getMount() then
     		player:mount()
		yrest(500)
else
   repeat
      inventory:useItem("Horse Rental Ticket");
   until inventory:itemTotalCount("Horse Rental Ticket") == 0 or inventory:itemTotalCount(202095) > 0 or inventory:itemTotalCount(202455) > 0 or inventory:itemTotalCount(202246) > 0  -- the three 7 day horses from rental tickets.
	player:mount()
	yrest(500)
end
end
Tried the

Code: Select all

else
   while inventory:itemTotalCount("Horse Rental Ticket") >0 and inventory:itemTotalCount(202095,202455,202246) == 0  do -- the three 7 day horses from rental tickets.
      inventory:useItem("Horse Rental Ticket");
   end
end
version first but it errored out for some reason.

Re: Fast login

Posted: Fri Oct 25, 2013 2:16 am
by rock5
ZZZZZ wrote:had some issues with finding the mount just after loading in a new character
That may just be because you need to wait a bit before everything is ready. Some servers are like that. I always add a rest(3000) after any change characters or any waitForLoadingScreens().
ZZZZZ wrote:version first but it errored out for some reason.
I assumed you wrote it like that because it worked. I remember doing something like that so assumed it was this function. I didn't check. Looks like you can't. You have to do 1 at a time.