



Also, how do I get him to use the Ancient Spirit Water buff?



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>
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.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)
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
You can pass the profile as an argument. For example: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.
rom-bot/bot profile:myothercharacter
would load "profiles/myothercharacter.xml" as your profile.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>
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.
userfunctions
folder. Lets call it userfunction_partyheal_extension.lua
.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
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 0 guests