In my gearswap lua I was trying to determine if I was running or following someone - to pause and re-cast. Then - keep running again.
I don't want to re-invent the wheel - so if this is already made let me know.. but the problem I'm having here is specifically in the windower.ffxi.get_player().follow_index.
If I have something on auto-follow - that is valid. If I don't have something on follow - it's 'nil'.
If I simply auto-run after a follow - then it has the index of the last person following (regardless if I'm following that index or not). Shouldn't it be nil upon follow cancel and stay that way until I start following something again?
Recreation steps:
Stopped:
print(windower.ffxi.get_player().follow_index) == nil
/follow (character)
print(windower.ffxi.get_player().follow_index) == 1502
stop following character
print(windower.ffxi.get_player().follow_index) == nil
autorun anywhere random
print(windower.ffxi.get_player().follow_index) == 1502
Doesn't even reset on zone.
Anyway otherwise this is what I'm starting up: (part of precast in Gearswap)
if type(windower.ffxi.get_player().autorun) == 'table' and spell.action_type == 'Magic' then windower.add_to_chat(3,'Currently auto-running - stopping to cast spell') windower.ffxi.run(false) autorun = 1 print(windower.ffxi.get_player().follow_index) if windower.ffxi.get_player().follow_index then print("Following - figuring this out") last_follow_target = windower.ffxi.get_player().follow_index windower.ffxi.follow() follow = 1 end cancel_spell() send_command('wait 1; input /ma '..spell.name) return end
then in after_cast
check_run_status() function check_run_status() if follow == 1 then windower.ffxi.follow(last_follow_target) follow = 0 return end if autorun == 1 then windower.ffxi.run() autorun = 0 end end