Page 1 of 1

Issue with daily elv and character switch

Posted: Mon Oct 25, 2021 5:54 am
by power3322
Hello everyone,

I`m using a elv daily quest script from Lisa with some optimations by me so I can switch characters
without opening a new cmd RoM Bot windows. At the moment I have the problem that I can`t load the
profile of the characters after a logout and login of a new character.

Does someone have a hint for this problem? What am I missing?

The error after changing is the following:

undefined player.Class1 in settings.lua

the second error is:

Code: Select all

Lade Profil userdefault.xml
The macro hotkey is F9.
The 'Attack' hotkey is set to 'macro'.
Testing 'ingamefunctions' macro. If it gets stuck here, please update the 'ingamefunctions' by copying the 'ingamefunctions' folder from 'rom/devtools' to the game's 'interface/addons' folder.
MACRO Test: ok
[!] d303Fix is not installed; some waypoints might not work correctly.
You can fix this by copying the '#d303fix' folder from 'rom/devtools' to the game's 'interface/addons' folder.Wegpunktpfad DailyElf.xml geladen.
Es wurde keine Rckkehrpfaddatei mit dem Defaultnamen DailyElf_return.xml gefunden.
Wir benutzen nun die normale Wegepunktdatei DailyElf.xml.
Wegepunkt #18 ist nher als #1. Wir starten daher mit Wegepunkt #18.
The game client did not crash.
Character: 
2021-10-25 13:20:09 - ...Games/RunesOfMagic/micromacro/scripts/rombo/settings.lua:1341: bad argument #1 to 'pairs' (table expected, got nil)
the main part is about this:

Code: Select all

if dqCount == 10 then
           	sendMacro("}LoginNextToon=true;a={")
            	sendMacro("Logout();"); 
				waitForLoadingScreen();
				player:update();
				settings.loadSkillSet(player.Class1);
				player = CPlayer.new();
				settings.load();
				settings.loadProfile("userdefault.xml"); -- Profile name
				loadPaths("DailyElf");

Re: Issue with daily elv and character switch

Posted: Mon Oct 25, 2021 6:43 am
by Administrator
I think you'd need to move this line:

Code: Select all

player = CPlayer.new();
to right under waitForLoadingScreen().

During the loading screen, there's no valid player, and therefore the code there is going to fail since values cannot be read. By moving that up, it might work.


However... I'm pretty sure that all of the auto-login stuff has been removed from the game, so it is likely to still fail to function correctly after making this change. Report back with your findings; could be helpful to others.

Re: Issue with daily elv and character switch

Posted: Mon Oct 25, 2021 6:48 am
by power3322
Hi,

thanks for the reply. I removed it and tested it but sadly same result. Could a sleep or waiting help?
or a second waitingLoginscreen because the one before is for the LogOut()?

When using the startbot.bat it is working fine only when I use it by this way. Can I somehow say
startbot.bat and load the path with Number 8 ? Is it possible?

Is there a function which does the same what the startbot.bat does at the begining?

Code: Select all

 if dqCount == 10 then
           	sendMacro("}LoginNextToon=true;a={")
            	sendMacro("Logout();"); 
				waitForLoadingScreen();
				settings.load();
				player:update();
				settings.loadSkillSet(player.Class1);
				settings.loadProfile("userdefault"); -- Profile name
				loadPaths("DailyElf");

Re: Issue with daily elv and character switch

Posted: Tue Oct 26, 2021 12:27 pm
by Administrator
I think you misunderstood; you need to move the call, not remove it. It should look like this:

Code: Select all

if dqCount == 10 then
           	sendMacro("}LoginNextToon=true;a={")
            	sendMacro("Logout();"); 
				waitForLoadingScreen();
				player = CPlayer.new();
				player:update();
				settings.loadSkillSet(player.Class1);
				settings.load();
				settings.loadProfile("userdefault.xml"); -- Profile name
				loadPaths("DailyElf");

Re: Issue with daily elv and character switch

Posted: Wed Oct 27, 2021 11:37 am
by power3322
Yes, I missunderstood you there :D. I tried it like you said but still the same error with undefined. :evil: :evil:

Re: Issue with daily elv and character switch

Posted: Wed Oct 27, 2021 7:19 pm
by Administrator
I think I figured out what the problem was. It's a bit of a pain in the butt, and I'll skip out on explaining the issue, but I've just pushed up a patch.

If you update your scripts, it should now be working for you. Please let me know what happens.

The commit to fix this can be reviewed here: https://github.com/SolarStrike-Software ... 7acd7121da

Re: Issue with daily elv and character switch

Posted: Fri Oct 29, 2021 12:26 pm
by power3322
Hmm what did i try:

Didnt close RoM Client after SVN Update RomBot Folder
Tried the 2 last codes we tried once with moved and once without moving the player statement
In both cases didnt change the problem it is the same.

Rom Bot Version was/is 4.10
and Game Version 7.4.0.2953

Re: Issue with daily elv and character switch

Posted: Fri Oct 29, 2021 5:51 pm
by Administrator
Open up functions.lua. Around line 1556, there should be this code:

Code: Select all

	-- Check if fully in game by checking if RoMScript works
	if not 1234 == RoMScript("1234")then
		print("RoMScript isn't working. Lets wait until it works.")
		repeat
			rest(500)
		until 1234 == RoMScript("1234")
	end

	MemDatabase:flush();
	yrest(500);
	local success = false;
	local errmsg = '';
	repeat
		success, errmsg = pcall(function ()
			local gameroot = getBaseAddress(addresses.game_root.base);
			player.Address = memoryReadRepeat("uintptr", getProc(), gameroot, addresses.game_root.player.base);
			player:update();
			settings.loadSkillSet(player.Class1);
			return true;
		end)

		if( not success ) then
			print('[WARN] ' .. errmsg);
		end
	until (success ~= false)
	return true;
end
Does yours look like that?

Re: Issue with daily elv and character switch

Posted: Sat Oct 30, 2021 1:52 am
by power3322
yes

But I remember that I had once that case, that after logging in as Mage first and second again Mage I had the case he was running without
a problem sadly it was more an roulett effect then a rule. But that was before your changes but I didnt mentioned it because it was too random

Re: Issue with daily elv and character switch

Posted: Sat Oct 30, 2021 8:29 am
by Administrator
I'm not able to reproduce the issue after the updates I had made to functions.lua.

You might have some luck removing these lines from that waypoint though:

Code: Select all

				player = CPlayer.new();
				player:update();
				
Since the call to waitForLoadingScreen() should take care of that for you now, everything should still work without those lines in the waypoint.

Re: Issue with daily elv and character switch

Posted: Sat Oct 30, 2021 1:28 pm
by power3322
Ok by removing these two line "player:update();player = CPlayer.new();"
I get a new error so atleast something new :D

...RunesOfMagic/micromacro/scripts/rombo/classes/player.lua:1263: bad argument #1 to 'pairs' (table expected, got nil)

Can you say if its a code error or from rombot something?

Code: Select all

if dqCount == 10 then
           	sendMacro("}LoginNextToon=true;a={")
            	sendMacro("Logout();"); 
				waitForLoadingScreen();
				settings.loadSkillSet(player.Class1);
				settings.load();
				settings.loadProfile("userdefault"); -- Profile name
				loadPaths("DailyElf");
Kind regards

Re: Issue with daily elv and character switch

Posted: Sun Oct 31, 2021 12:13 pm
by Administrator
Try putting the settings.load() above settings.loadSkillSet(). Might help.

Re: Issue with daily elv and character switch

Posted: Mon Nov 01, 2021 10:12 am
by power3322

Code: Select all

if dqCount == 10 then
           	sendMacro("}LoginNextToon=true;a={")
            	sendMacro("Logout();"); 
				waitForLoadingScreen();
				settings.load();
				settings.loadSkillSet(player.Class1);
				settings.loadProfile("userdefault"); -- Profile name
				loadPaths("DailyElf");
same error

Re: Issue with daily elv and character switch

Posted: Mon Nov 01, 2021 4:09 pm
by Administrator
Try this instead:

Code: Select all

	sendMacro("}LoginNextToon=true;a={")
		sendMacro("Logout();");
		waitForLoadingScreen();
		settings.load();
		settings.loadProfile("userdefault"); -- Profile name
		settings.loadSkillSet(player.Class1);

Re: Issue with daily elv and character switch

Posted: Wed Nov 03, 2021 2:39 pm
by power3322
:o :o :o :o :o :o

Works, big thanks!! Didnt think that the day would ever come true :D