Code: Select all
<onDeath><![CDATA[
-- Additional Lua code to execute on death
if RoMScript("GetZoneID()") == 11 then
loadPaths("Dragonfang/CyclopsShop");
end
]]></onDeath>Botje
Code: Select all
<onDeath><![CDATA[
-- Additional Lua code to execute on death
if RoMScript("GetZoneID()") == 11 then
loadPaths("Dragonfang/CyclopsShop");
end
]]></onDeath>Code: Select all
<onLoad><![CDATA[
-- Additional Lua code to execute after loading the profile
-- and before the bot starts. e.g. You could overwrite profile settings here
-- like: changeProfileOption("HP_REST", 60);
if player.Class1 == CLASS_KNIGHT then
settings.profile.options.EGGPET_ASSIST_SLOT = 4
else
settings.profile.options.EGGPET_ASSIST_SLOT = 1
end
startGMDetect()
]]></onLoad>Code: Select all
<onLoad>
function Return()
printf("Bag spaces free: "..inventory:itemTotalCount(0).."\n");
printf("Weapon Durbility: "..inventory:getMainHandDurability().."\n");
if 5 > inventory:itemTotalCount(0) or 50 > inventory:getMainHandDurability() then
printf("Going to shop, loading new waypoint...\n");
sendMacro("LeaveParty();");
waitForLoadingScreen(15);
loadPaths("Dragonfang/CyclopsShop");
end
end
settings.profile.options.WAYPOINT_DEVIATION = 0
settings.profile.options.MAX_TARGET_DIST = 95
</onLoad>Code: Select all
<onLoad>
function Return()
print("This function executed successfully")
end
</onLoad>
<!-- # 1 --><waypoint x="6791" z="6332" y="89"> Return()</waypoint>Code: Select all
Moving to waypoint #1, (6791, 6332)
This function executed successfullyI think so, except you wouldn't have changed zone yet if that's what the zone check if for.botje wrote:and to get back to the original problem, even if it fires before resurrection, it should still load waypoint right?
Code: Select all
<onDeath><![CDATA[
RoMScript("BrithRevive();");
waitForLoadingScreen()
yrest(settings.profile.options.WAIT_TIME_AFTER_RES);
player:update();
if RoMScript("GetZoneID()") == 11 then
loadPaths("Dragonfang/CyclopsShop");
end
]]></onDeath>
I have something similar to Lisa's code example within a WP file.lisa wrote:what you want to do is something like this
The BrithRevive is not a typo, that is the actual function name in game.Code: Select all
<onDeath><![CDATA[ RoMScript("BrithRevive();"); waitForLoadingScreen() yrest(settings.profile.options.WAIT_TIME_AFTER_RES); player:update(); if RoMScript("GetZoneID()") == 11 then loadPaths("Dragonfang/CyclopsShop"); end ]]></onDeath>
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onDeath><![CDATA[
print("Inside onDeath within WP file")
RoMScript("BrithRevive();");
waitForLoadingScreen()
yrest(settings.profile.options.WAIT_TIME_AFTER_RES);
player:update();
loadPaths("WPFILENAME");
]]></onDeath>
<!-- # 1 --> ... etc.Code: Select all
<option name="RES_AUTOMATIC_AFTER_DEATH" value="true" />Code: Select all
Use MACRO: Looting target in distance 64.
Clearing target.
Saved a screenshot to: D:/micromacro/scripts/rom/profiles/CHARNAME.bmp
You have died... Sorry.
Script paused until you revive yourself. Press Delete when you're ready to conti
nue.Code: Select all
<onDeath><![CDATA[
yrest(2000)
RoMScript("BrithRevive();");
waitForLoadingScreen()
flyoff()
local filename = getExecutionPath() .. "/logs/shells.log";
local file, err = io.open(filename, "a+");
if file then
file:write(" Character name: " ..player.Name.. " \tDate: " .. os.date() .. " \tShells gained: "..currentshells - numshells..
"\tTotal shells: "..currentshells.. "\n")
file:close();
end
yrest(2000)
sendMacro("}LoginNextToon=true;a={")
sendMacro("Logout();");
waitForLoadingScreen();
loadPaths("cot_tele");
]]></onDeath>