I tried to chain the andor training range script to my other minigames WP. I'm not very good with onload WP yet, so I don't get the bot to load the next WP. I added a whenfinished option...but i dont know how to trigger it. Would the bot trigger the whenfinished automatically when the minigame is done? I can't test it today...(1minigame/day...)
Here is what I wrote:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onLoad>
-- V 3.2
<![CDATA[
--=== user options ===--
-- it will stop once this score is reached, bonuses will be added afterwards though
-- so 4700 will probably be total score of 3100
local requiredscore = 4700
-- alter to your local language, caps sensative, in english is "Go!!!", so "Go" is enough
local goMessage = "Go"
When_Finished = "5andor_at"
-- "end" to end script, "relog" to log next character, "charlist" to log next in 'charlist' and "waypointfilename" to load that waypointfile.
CharList = {
}
-- Character list to use when using the "charlist" option above. Requires my "userfunction_LoginNextChar" userfunction.
-- Find it here. http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350
-- eg.
-- CharList = {
-- {account=4,chars={}},
-- {account=8,chars={1}},
-- {account=7,chars={1,2,5}},
-- }
id_kate = 121035
id_magelly = 120687
function checkRelog()
flyoff()
unregisterTimer("rezcheck")
-- Log result
local magel = GetIdName(120687) -- Magelly
local filename = getExecutionPath() .. "/logs/at.log";
local file, err = io.open(filename, "a+");
if file then
file:write("Acc: "..RoMScript("GetAccountName()").."\tName: " ..string.format("%-10s",player.Name ).." \tDate: " .. os.date() ..
"\tCoins:"..inventory:itemTotalCount(203038).." \tShells gained/total: "..getCurrency("shell") - numshells.."/".. getCurrency("shell") .. "\t" ..logentry .. "\n")
file:close();
end
if When_Finished == "relog" then
ChangeChar()
waitForLoadingScreen();
yrest(3000)
loadProfile()
loadPaths(__WPL.FileName);
elseif When_Finished == "charlist" then
SetCharList(CharList)
LoginNextChar()
loadProfile()
loadPaths(__WPL.FileName);
elseif When_Finished == "end" then
error("Ending script",2)
else
player:update()
-- Leave before loading next waypoint file.
if ExitBeforeNextFile == true then
if player:target_NPC(magel) then
sendMacro("ChoiceOption(1);");
yrest(100);
RoMScript("StaticPopup_OnClick(StaticPopup1, 1);")
waitForLoadingScreen();
yrest(3000)
end
end
loadProfile() -- Because we messed with the skills
loadPaths(When_Finished)
end
end
function rezCheck()
player:update()
if isInGame() and (1 > player.HP or not player.Alive) then
-- Make sure they aren't still trying to run off
keyboardRelease(settings.hotkeys.MOVE_FORWARD.key);
keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key);
keyboardRelease(settings.hotkeys.ROTATE_LEFT.key);
keyboardRelease(settings.hotkeys.ROTATE_RIGHT.key);
keyboardRelease(settings.hotkeys.STRAFF_LEFT.key);
keyboardRelease(settings.hotkeys.STRAFF_RIGHT.key);
cprintf(cli.green, language[104]); -- try to resurrect in 5 seconds
rest(5000);
cprintf(cli.green, language[107]); -- use the ingame resurrect macro
RoMScript("UseSelfRevive();"); -- first try self revive
rest(500);
RoMScript("BrithRevive();");
waitForLoadingScreen(30)
rest(settings.profile.options.WAIT_TIME_AFTER_RES);
player:update();
logentry = "Player died."
checkRelog()
end
end
-- Move to Kate Wesker and enter
if getZoneId() == 2 then
player:target_NPC(id_kate)
--ChoiceOptionByName("Transport to Andor Training Range");
--yrest(1000)
ChoiceOptionByName(getTEXT("SKWERL_MOBIUS_24"))
yrest(1000)
waitForLoadingScreen()
end
-- Move to Magelly Basac
player:target_NPC(id_magelly)
-- Check if we already completed
--ChoiceOptionByName("Register for timed training"); yrest(1000)
ChoiceOptionByName(getTEXT("SKWERL_MOBIUS_14")) yrest(1000)
--ChoiceOptionByName("Participate in training"); yrest(1000)
ChoiceOptionByName(getTEXT("SKWERL_MOBIUS_25")) yrest(1000)
--ChoiceOptionByName("Confirm"); yrest(1000)
ChoiceOptionByName(getTEXT("SYS_OKAY")) yrest(1000) --(might be wrong)
local round = 0
local score = 0
function tort()
local proc = getProc()
local function checkclicked(address)
local tmp = memoryReadRepeat("int", proc, address + addresses.pawnAttackable_offset) or 0;
if bitAnd(tmp,0x8) then
return true
else
return false
end
end
local function one(ID)
--print("targeting: "..ID)
local objectList = CObjectList();
objectList:update();
local objSize = objectList:size()
for i = 0,objSize do
obj = objectList:getObject(i)
obj:update()
if (obj.Id == ID or ID == 106885) and checkclicked(obj.Address) then
player:target(obj)
RoMScript("UseExtraAction(1)")
yrest(10)
player:target(obj)
RoMScript("UseExtraAction(1)")
if ID == 106883 then
yrest(10)
player:target(obj)
RoMScript("UseExtraAction(1)")
end
yrest(100)
end
end
end
if player:findNearestNameOrId(106881,106882,106883,106884) then
--== monitor chat
EventMonitorStart("Tortevent", "SYSTEM_MESSAGE");
local time, moreToCome, name, msg, _go
repeat
time, moreToCome, name, msg = EventMonitorCheck("Tortevent",1)
yrest(10)
if name and string.find(name,goMessage) then
_go = true
end
until _go == true
EventMonitorStop("Tortevent")
round = round + 1
print("Wave: "..round..", Score: "..score)
repeat
one(106882)
one(106882)
one(106881)
one(106883)
one(106884)
until not player:findNearestNameOrId(106881,106882,106883,106884)
end
end
repeat
yrest(100)
until player:findNearestNameOrId(106881)
print("OK event has started")
repeat
tort()
player:update()
yrest(100)
buffed = player:getBuff(622402)
if buffed then score = buffed.Level end
until not player:hasBuff(622402) or ( buffed and buffed.Level > requiredscore )
error("Event finished, end score was "..score)
]]>
</onLoad>
</waypoints>