~~ { ~~ FOR AUTO-COMPLETION ASSISTANCE: testvar getvar setvar touchvar clearallvars clearvar getcharintprop getchardoubleprop getcharquadprop getcharboolprop getcharstringprop getisspellknown getcancastspell_hunt getcancastspell_buff getcharvital_base getcharvital_current getcharvital_buffedmax getcharskill_traininglevel getcharskill_base getcharskill_buffed getplayerlandcell getplayercoordinates coordinategetns coordinategetwe coordinategetz coordinatetostring coordinateparse coordinatedistancewithz coordinatedistanceflat wobjectgetphysicscoordinates wobjectgetname wobjectgetobjectclass wobjectgettemplatetype wobjectgetisdooropen wobjectfindnearestmonster wobjectfindnearestdoor wobjectfindnearestbyobjectclass wobjectfindininventorybytemplatetype wobjectfindininventorybyname wobjectfindininventorybynamerx wobjectgetselection wobjectgetplayer wobjectfindnearestbynameandobjectclass actiontryselect actiontryuseitem actiontryapplyitem actiontrygiveitem actiontryequipanywand actiontrycastbyid actiontrycastbyidontarget chatbox chatboxpaste statushud statushudcolored uigetcontrol uisetlabel isfalse istrue iif randint cstr strlen getobjectinternaltype cstrf stopwatchcreate stopwatchstart stopwatchstop stopwatchelapsedseconds cnumber floor ceiling round abs getworldname getitemcountininventorybyname getheading getitemcountininventorybynamerx getheadingto actiontrygiveprofile vitae getfellowshipstatus getfellowshipname getfellowshipisopen getfellowshipisleader getfellowshipleaderid getfellowshipcanrecruit getfellowid getfellowshipcount getfellowshiplocked getfellowname getfellowshipisfull sin cos tan sqrt asin acos atan atan2 sinh cosh tanh vtsetmetastate getregexmatch echo chr ord wobjectgetid wobjectgethealth wobjectfindbyid wobjectgetintprop wobjectfindnearestbytemplatetype wobjectgetopencontainer testquestflag getquestktprogress isrefreshingquests getquestktrequired getqueststatus getisday getgamehour getgamehourname getisnight getgameday getgameticks getminutesuntilday getgamemonth getgamemonthname getminutesuntilnight getgameyear uisetvisible uiviewvisible uiviewexists getgvar touchgvar getpvar touchpvar setgvar cleargvar setpvar clearpvar testgvar clearallgvars testpvar clearallpvars dictgetitem dictcreate dicthaskey dictadditem dictkeys dictremovekey dictvalues dictclear dictsize dictcopy listgetitem listpop listcreate listcontains listremove listadd listindexof listremoveat listinsert listlastindexof listclear listcopy listcount listreverse ~~ ~~ File auto-generated by metaf, a program created by Eskarina of Morningthaw/Coldeve. ~~ Get metaf here: https://github.com/JJEII/metaf/ ~~ ~~ All recognized structural designators: ~~ STATE: DO: ~~ IF: NAV: ~~ ~~ All recognized CONDITION (IF:) operation keywords: ~~ Never NavEmpty MobsInDist_Priority Not ~~ Always Death NeedToBuff PSecsInStateGE ~~ All VendorOpen NoMobsInDist SecsOnSpellGE ~~ Any VendorClosed BlockE BuPercentGE ~~ ChatMatch ItemCountLE CellE DistToRteGE ~~ MainSlotsLE ItemCountGE IntoPortal Expr ~~ SecsInStateGE MobsInDist_Name ExitPortal ChatCapture ~~ ~~ All recognized ACTION (DO:) operation keywords: ~~ None EmbedNav ChatExpr SetOpt ~~ SetState CallState SetWatchdog CreateView ~~ Chat Return ClearWatchdog DestroyView ~~ DoAll DoExpr GetOpt DestroyAllViews ~~ ~~ All recognized NAV types: ~~ circular follow ~~ linear once ~~ ~~ All recognized NAV NODE types: ~~ flw vnd ~~ pnt ptl ~~ rcl tlk ~~ pau chk ~~ cht jmp ~~ prt (deprecated in VTank) ~~ } ~~ Follower Meta: Follows group leader, responds to chat commands, death recovery STATE: {Default} ~~ { IF: Always DO: DoAll Chat {/vt opt set enablecombat false} Chat {/vt opt set enablenav false} Chat {/vt opt set enablebuffing true} Chat {/vt opt set enablelooting false} DoExpr {setvar[leaderName,]} DoExpr {setvar[deathCount, 0]} SetState {idle} ~~ } STATE: {idle} ~~ { ~~ Wait for leader assignment via chat command IF: ChatMatch {.+tells you, "follow me"} DO: DoAll DoExpr {setvar[leaderName, getregexmatch[(.+) tells you, 1]]} ChatExpr {\/t +getvar[leaderName]+, Following you now\!} SetState {following} IF: ChatMatch {.+tells you, "follow (.+)"} DO: DoAll DoExpr {setvar[leaderName, getregexmatch[.+tells you, "follow (.+)", 1]]} ChatExpr {\/t +getvar[leaderName]+, Following you now\!} SetState {following} IF: Death DO: SetState {death_recovery} IF: NeedToBuff DO: SetState {buffing} IF: Always DO: Chat {/vt opt set enablecombat false} ~~ } STATE: {following} ~~ { ~~ Main follow state - follow the leader IF: Always DO: Chat {/vt opt set enablecombat false} IF: Always DO: Chat {/vt opt set enablenav false} IF: Always DO: ChatExpr {\/ub follow +getvar[leaderName]} ~~ Death handling IF: Death DO: DoAll DoExpr {setvar[deathCount, getvar[deathCount] + 1]} ChatExpr {\/t +getvar[leaderName]+, I died\! Death count: +cstr[getvar[deathCount]]+. Recovering...} SetState {death_recovery} ~~ Chat command: buff IF: ChatMatch {.+tells you, "buff"} DO: DoAll Chat {/vt opt set enablebuffing true} SetState {buffing} ~~ Chat command: recall IF: ChatMatch {.+tells you, "recall"} DO: DoAll ChatExpr {\/t +getvar[leaderName]+, Recalling now\!} SetState {recalling} ~~ Chat command: stop IF: ChatMatch {.+tells you, "stop"} DO: DoAll ChatExpr {\/t +getvar[leaderName]+, Stopping follow\.} DoExpr {setvar[leaderName,]} Chat {/ub follow off} SetState {idle} ~~ Chat command: combat on IF: ChatMatch {.+tells you, "combat on"} DO: DoAll Chat {/vt opt set enablecombat true} ChatExpr {\/t +getvar[leaderName]+, Combat enabled\!} ~~ Chat command: combat off IF: ChatMatch {.+tells you, "combat off"} DO: DoAll Chat {/vt opt set enablecombat false} ChatExpr {\/t +getvar[leaderName]+, Combat disabled\!} ~~ Need to rebuff IF: NeedToBuff DO: DoAll Chat {/ub follow off} SetState {buffing} ~~ Watchdog - if stuck for too long, try to recover IF: Always DO: SetWatchdog 3 300 {stuck_recovery} ~~ } STATE: {buffing} ~~ { ~~ Buff up then return to following IF: Always DO: DoAll Chat {/vt opt set enablebuffing true} Chat {/vt opt set enablecombat false} IF: Death DO: DoAll DoExpr {setvar[deathCount, getvar[deathCount] + 1]} SetState {death_recovery} IF: All Not NeedToBuff SecsInStateGE 5 DO: DoAll Chat {/vt opt set enablebuffing true} SetState {rejoin_leader} IF: SecsInStateGE 120 DO: DoAll Chat {/vt opt set enablebuffing true} SetState {rejoin_leader} ~~ } STATE: {death_recovery} ~~ { ~~ Wait at lifestone after death, then rebuff and rejoin IF: Always DO: DoAll Chat {/vt opt set enablecombat false} Chat {/vt opt set enablenav false} Chat {/vt opt set enablebuffing false} ~~ Wait a few seconds at lifestone before doing anything IF: SecsInStateGE 10 DO: DoAll Chat {/vt opt set enablebuffing true} SetState {death_rebuff} ~~ } STATE: {death_rebuff} ~~ { ~~ Rebuff after death before rejoining IF: Always DO: Chat {/vt opt set enablebuffing true} IF: Death DO: DoAll DoExpr {setvar[deathCount, getvar[deathCount] + 1]} SetState {death_recovery} IF: All Not NeedToBuff SecsInStateGE 10 DO: SetState {rejoin_leader} IF: SecsInStateGE 180 DO: SetState {rejoin_leader} ~~ } STATE: {rejoin_leader} ~~ { ~~ Rejoin the leader after buffing or death recovery IF: Expr {getvar[leaderName] == 0} DO: SetState {idle} IF: Expr {cstr[getvar[leaderName]] == cstr[]} DO: SetState {idle} IF: Always DO: DoAll ChatExpr {\/t +getvar[leaderName]+, Rejoining you now\!} ChatExpr {\/ub follow +getvar[leaderName]} SetState {following} ~~ } STATE: {recalling} ~~ { ~~ Recall to lifestone IF: Always DO: DoAll Chat {/ub follow off} Chat {/vt opt set enablecombat false} Chat {/vt opt set enablenav false} IF: SecsInStateGE 2 DO: Chat {/lifestone} IF: Death DO: DoAll DoExpr {setvar[deathCount, getvar[deathCount] + 1]} SetState {death_recovery} IF: SecsInStateGE 15 DO: DoAll ChatExpr {\/t +getvar[leaderName]+, Recalled to lifestone\. Tell me to follow you when ready\.} SetState {idle} ~~ } STATE: {stuck_recovery} ~~ { ~~ Try to recover from being stuck IF: Always DO: DoAll Chat {/ub follow off} Chat {/vt opt set enablecombat false} ChatExpr {\/t +getvar[leaderName]+, I appear to be stuck\. Trying to recover\.} IF: SecsInStateGE 3 DO: Chat {/lifestone} IF: Death DO: DoAll DoExpr {setvar[deathCount, getvar[deathCount] + 1]} SetState {death_recovery} IF: SecsInStateGE 15 DO: DoAll Chat {/vt opt set enablebuffing true} SetState {death_rebuff} ~~ }