Issue with daily elv and character switch

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Issue with daily elv and character switch

#1 Post by power3322 » Mon Oct 25, 2021 5:54 am

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");
Attachments
userdefault.xml
(15.2 KiB) Downloaded 25 times
DailyElf.xml
(2.4 KiB) Downloaded 25 times

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#2 Post by Administrator » Mon Oct 25, 2021 6:43 am

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.

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#3 Post by power3322 » Mon Oct 25, 2021 6:48 am

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");

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#4 Post by Administrator » Tue Oct 26, 2021 12:27 pm

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");

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#5 Post by power3322 » Wed Oct 27, 2021 11:37 am

Yes, I missunderstood you there :D. I tried it like you said but still the same error with undefined. :evil: :evil:

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#6 Post by Administrator » Wed Oct 27, 2021 7:19 pm

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

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#7 Post by power3322 » Fri Oct 29, 2021 12:26 pm

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

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#8 Post by Administrator » Fri Oct 29, 2021 5:51 pm

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?

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#9 Post by power3322 » Sat Oct 30, 2021 1:52 am

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

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#10 Post by Administrator » Sat Oct 30, 2021 8:29 am

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.

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#11 Post by power3322 » Sat Oct 30, 2021 1:28 pm

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

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#12 Post by Administrator » Sun Oct 31, 2021 12:13 pm

Try putting the settings.load() above settings.loadSkillSet(). Might help.

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#13 Post by power3322 » Mon Nov 01, 2021 10:12 am

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

User avatar
Administrator
Site Admin
Posts: 5176
Joined: Sat Jan 05, 2008 4:21 pm

Re: Issue with daily elv and character switch

#14 Post by Administrator » Mon Nov 01, 2021 4:09 pm

Try this instead:

Code: Select all

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

power3322
Posts: 8
Joined: Mon Oct 25, 2021 3:47 am

Re: Issue with daily elv and character switch

#15 Post by power3322 » Wed Nov 03, 2021 2:39 pm

:o :o :o :o :o :o

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

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests