Is it possible to change (to add) parameter like <ondeath> or <onLeavecombat> in onload part of the WP?
Reason: I have a segment such as "changechannel" in onleavecombat in my profile using one WP, so I have allways to delete this part, using another WP (killing mobs), otherwise it would change the channel after every kill (bad thing especailly using malatina survival )
so back to the question: how can I add or change those parameters in WP onload part?
oldOnLeaveCombat = settings.profile.events.onLeaveCombat;
settings.profile.events.onLeaveCombat = function()
--add code here
--call profile on leave combat
if (oldOnLeaveCombat and (type(oldOnLeaveCombat)=='function')) then
oldOnLeaveCombat();
end;
end
if oldOnLeaveCombat = nil then oldOnLeaveCombat = settings.profile.events.onLeaveCombat; end
Of course nesting only happens if you reload the file, eg. when you change characters and reload the file to run another character through it. If the file is only run once, eg. a farming script that just loops until you stop it, then you don't need to do it this way. But it's probably good practice to always do it this way.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.