Issues I can't solve.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
devrimist
Posts: 25
Joined: Mon Nov 18, 2019 4:25 am

Issues I can't solve.

#1 Post by devrimist » Tue May 24, 2022 11:35 am

Hello everyone, I have a few questions I want to ask, ;)

:?: Is there a structure that can control food and potion buffs eg. Like <skillPriest> </skillPriest>. I couldn't achieve this with <onLeaveCombat> with <onLoad>, I make bots use food and drinks for once, but when the food and potion buffs expire, the bot doesn't regenerate the buffs. :?:

:?: I could not find an example of using the Groupheal skill when more than one person in the party is low on health. Is this possible?
Also, how do I get him to use the Ancient Spirit Water buff? :?:

:?: Another point is why we don't use a list like waypoint selection list for profile selection or is there such a possibility? :?:
Knowledge is power. Learning is empowerment.

User avatar
devrimist
Posts: 25
Joined: Mon Nov 18, 2019 4:25 am

Re: Issues I can't solve.

#2 Post by devrimist » Tue May 24, 2022 5:13 pm

and another error when i try to summoning light fairy
err.png
Knowledge is power. Learning is empowerment.

User avatar
devrimist
Posts: 25
Joined: Mon Nov 18, 2019 4:25 am

Re: Issues I can't solve.

#3 Post by devrimist » Wed May 25, 2022 8:48 am

Code: Select all

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

		PartyHeals()
	
	</onLoad>
	
	<waypoint>
	
		if (not player:hasBuff("506687") ) 		--Turn of Luck Powder Dust
			then inventory:useItem(207203)
			yrest(1000);
		end
			
		if (not player:hasBuff("506684") )		--Unbridled Enthusiasm
			then inventory:useItem(207200)
			yrest(1000);
		end
			
		if (not player:hasBuff("506686") )		--Clear Thought
			then inventory:useItem(207202)
			yrest(1000);
		end
			
		if (not player:hasBuff("507026") )		--Birthday Cake
			then inventory:useItem(207670)
			yrest(1000);
		end
			
		if (not player:hasBuff("501337") )		--Hero Potion
			then inventory:useItem(200277)
			yrest(1000);
		end
			
		if (not player:hasBuff("506690") )		--Scarlet Love
			then inventory:useItem(207206)
			yrest(1000);
		end		
		
	</waypoint>
	<waypoint>
		player:update();
	</waypoint>
</waypoints>

I'm trying to get the bot to use these items while following the party member I've specified and to renew it as the buffs end, but it doesn't work. I can't find where there is a mistake or I don't know if I'm missing something, maybe there is a start button combination, I couldn't find it.. eg. Like ctrl+f5.
Knowledge is power. Learning is empowerment.

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

Re: Issues I can't solve.

#4 Post by Administrator » Thu May 26, 2022 6:44 am

I believe
PartyHeals()
enters an infinite loop handles all logic itself, so it is never actually running the code in the waypoints you've added. I'll have to dig through the code to figure out how that works when time allows.

As for the issue with the light fairy, that is definitely something that needs to be fixed with the bot itself. I'll need to address that and I'll post back when I have a fix up.

User avatar
devrimist
Posts: 25
Joined: Mon Nov 18, 2019 4:25 am

Re: Issues I can't solve.

#5 Post by devrimist » Fri May 27, 2022 6:04 am

I'm looking forward to the fix, by the way, I'd like to make a suggestion...
I think the following function in the "bot.lua" file reads the waypoint files in the waypoint folder and prints them as a list on the console screen, and in this way we can select the waypoint file we want to use.

Code: Select all

-- list waypoint files and files in folders
	-- only files with filetype '.xml' are listed
	-- only folders without '.' are listed
	-- only 1 level of subfolders will be listed
	local current_folder = ""
	local show_subfiles = settings.profile.options.WPL_SHOW_SUBFOLDER_FILES
	if show_subfiles ~= true then show_subfiles = false end -- default true

	local function list_waypoint_files()

		local hf_counter = 0;
		local pathlist = { }

		local function read_subdirectory(_folder)
			local tmpfolder = _folder
			if current_folder ~= "" then
				tmpfolder = current_folder .. "/" .. _folder
			end
			local subdir = getDirectory(getExecutionPath() .. "/waypoints/" .. tmpfolder)

			if( not subdir) then return; end
			if show_subfiles then
				for i,v in pairs(subdir) do
					if( string.find (v,".xml",1,true) ) then
						hf_counter = hf_counter + 1;
						pathlist[hf_counter] = { };
						pathlist[hf_counter].folder = _folder;
						pathlist[hf_counter].filename = v;
					end
				end
			else
				hf_counter = hf_counter + 1
				pathlist[hf_counter] = { };
				pathlist[hf_counter].folder = _folder;
			end

		end		-- end of: local function read_subdirectory(_folder)
The code below in the "settings.lua" file processes the profile file with the same name as the character we entered in the game (it gives an error if there is no profile file with the same name as the character name we entered in the game).

Code: Select all

function settings.loadProfile(_name)
	cprintf(cli.yellow,language[186], _name)

	-- Delete old profile settings (if they even exist), restore defaults
	settings.profile = table.copy(settings_default.profile);

	local filename = getExecutionPath() .. "/profiles/" .. _name .. ".xml";
	local root = xml.open(filename);
	local elements = root:getElements();

	local loadOptions = function(node)
		local elements = node:getElements();

		for i,v in pairs(elements) do
			settings.profile.options[v:getAttribute("name")] = v:getAttribute("value");
		end
	end

	local loadHotkeys = function(node)
		local elements = node:getElements();

		for i,v in pairs(elements) do
			settings.profile.hotkeys[v:getAttribute("name")] = {};
			settings.profile.hotkeys[v:getAttribute("name")].name = v:getAttribute("name");
			settings.profile.hotkeys[v:getAttribute("name")].key = key[v:getAttribute("key")];
			settings.profile.hotkeys[v:getAttribute("name")].modifier = key[v:getAttribute("modifier")];

			if( key[v:getAttribute("key")] == nil ) then
				local err = sprintf(language[127], tostring(v:getAttribute("name")), _name );	-- Please set a valid key
				error(err, 0);
			end

			checkKeySettings(v:getAttribute("name"),
			  v:getAttribute("key"),
			  v:getAttribute("modifier") );

		end
	end
Similar to the waypoint function above, is it possible to define a function where we can read the profile files in the profiles folder and print them on the console screen as a list and select the profile we want?
Because when we want to play in different classes, we have to either rearrange the file that is the same as the character name in the profiles folder or replace it with another profile file that is ready, and this may cause some confusion or lose the profile file we have.
Knowledge is power. Learning is empowerment.

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

Re: Issues I can't solve.

#6 Post by Administrator » Sat May 28, 2022 3:09 pm

I've pushed up a fix for the fairy issue. You'll have to update your scripts but it should (hopefully) work. I wasn't able to test it thoroughly because I don't have a fairy, nor know where to get one, but I at least addressed the error that you were getting.


devrimist wrote: Fri May 27, 2022 6:04 am Similar to the waypoint function above, is it possible to define a function where we can read the profile files in the profiles folder and print them on the console screen as a list and select the profile we want?
Because when we want to play in different classes, we have to either rearrange the file that is the same as the character name in the profiles folder or replace it with another profile file that is ready, and this may cause some confusion or lose the profile file we have.
You can pass the profile as an argument. For example:
rom-bot/bot profile:myothercharacter
would load "profiles/myothercharacter.xml" as your profile.

Unless I'm misunderstanding something, you shouldn't need to mess with your profile too much when changing classes. Is it because of skill differences? You can just add whichever skills you want to the skills section for the main class and it should only use those which are available to you.
You should be able to try something like:

Code: Select all

	<skills_priest>
		<skill name="PRIEST_GRACE_OF_LIFE" 		hotkey="MACRO" priority="120" rebuffcut="10" inbattle="false" />
		<skill name="WARRIOR_SLASH"          	hotkey="MACRO" priority="90" />
		<skill name="SCOUT_COMBO_SHOT"        	hotkey="MACRO" priority="95" />
	</skills_priest>
Then, regardless of whether you are priest/warrior or priest/scout, it should only use the available skills.

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

Re: Issues I can't solve.

#7 Post by Administrator » Sat May 28, 2022 3:19 pm

devrimist wrote: Wed May 25, 2022 8:48 am I'm trying to get the bot to use these items while following the party member I've specified and to renew it as the buffs end, but it doesn't work. I can't find where there is a mistake or I don't know if I'm missing something, maybe there is a start button combination, I couldn't find it.. eg. Like ctrl+f5.

So... this is a bit of a hack, but it "might" work.
Create a new file inside of the
userfunctions
folder. Lets call it
userfunction_partyheal_extension.lua
.

Inside it, put this:

Code: Select all

local orig_partyCommands = partyCommands

function partyCommands()
	orig_partyCommands()

    --Turn of Luck Powder Dust
    if (not player:hasBuff("506687") )
    	then inventory:useItem(207203)
    	yrest(1000);
    end

    --Unbridled Enthusiasm
    if (not player:hasBuff("506684") )
    	then inventory:useItem(207200)
    	yrest(1000);
    end

    --Clear Thought
    if (not player:hasBuff("506686") )
    	then inventory:useItem(207202)
    	yrest(1000);
    end

    --Birthday Cake
    if (not player:hasBuff("507026") )
    	then inventory:useItem(207670)
    	yrest(1000);
    end

    --Hero Potion
    if (not player:hasBuff("501337") )
    	then inventory:useItem(200277)
    	yrest(1000);
    end

    --Scarlet Love
    if (not player:hasBuff("506690") )
    	then inventory:useItem(207206)
    	yrest(1000);
    end
end
Save the file and restart the bot.

User avatar
devrimist
Posts: 25
Joined: Mon Nov 18, 2019 4:25 am

Re: Issues I can't solve.

#8 Post by devrimist » Sat May 28, 2022 6:00 pm

Yessss.. :twisted: everything works perfectly as far as I can see. If I run into a problem, I'll post it here. "/bot profile:abc.lua" good to know. Thanks for your interest. :)
Knowledge is power. Learning is empowerment.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 22 guests