I can't seem to get zone_ anything to work. Tried zone_Upper_Jeuno and zone_*. Both does not seem to work.
Autoexec Zone event not working
Best Answer Kenshi , 02 February 2015 - 03:33 PM
you can use an alternative in a lua script with:
windower.register_event('zone change', function() whatever code here end)Go to the full post
#1
Posted 01 February 2015 - 03:22 PM
#2
Posted 02 February 2015 - 12:33 PM
Anyone else having issues with this? Or can suggest an alternative to automatic actions based on zoning itself? I can get gearswap to do different things based on the zone but only when I feed it some kind of action. I haven't seen any functions that'll handle just zoning. Any help appreciated.
#3
Posted 02 February 2015 - 03:33 PM Best Answer
you can use an alternative in a lua script with:
windower.register_event('zone change', function() whatever code here end)
#4
Posted 02 February 2015 - 03:44 PM
Awesome! Thanks for the suggestion. A little bit of googling lead me to this page: http://dev.windower....pi:events:start
Going to leave it here and bookmark it when I get home!
#5
Posted 02 February 2015 - 09:04 PM
While it's recommended to go the Lua way, AutoExec will still be fixed for now until a proper Lua replacement exists. I'll try to fix AE later today or tomorrow.
#6
Posted 03 February 2015 - 02:14 AM
you can use an alternative in a lua script with:
windower.register_event('zone change', function() whatever code here end)
--for normal lua addons
res = require('resources')
windower.register_event('zone change', function(new_id,old_id)
local new_zone = res.zones[new_id].en
local old_zone = res.zones[old_id].en
--code here
end)
or
res = require('resources')
function zone_change(new_id,old_id)
local new_zone = res.zones[new_id].en
local old_zone = res.zones[old_id].en
--code here
end
windower.register_event('zone change', zone_change)
--or for geaswap
windower.raw_register_event('zone change', function(new_id,old_id)
local new_zone = res.zones[new_id].en
local old_zone = res.zones[old_id].en
--code here
end)
or
function zone_change(new_id,old_id)
local new_zone = res.zones[new_id].en
local old_zone = res.zones[old_id].en
--code here
end
windower.raw_register_event('zone change', zone_change)
#7
Posted 03 February 2015 - 10:06 PM
Please don't use "en" to access the english value, use "english" instead or "name" to provide a cross-language template. You very rarely care about the old zone, so you can simplify it to this (the AutoExec plugin also did not provide the old zone info, so this would be an equivalent):
windower.register_event('zone change', function(id) local zone = res.zones[id].name if zone == 'Alzadaal Undersea Ruins' or zone == 'Bastok Markets' then windower.send_command:schedule(5, 'input /l zoned') end end)
#8
Posted 04 February 2015 - 01:04 AM
Please don't use "en" to access the english value, use "english" instead or "name" to provide a cross-language template. You very rarely care about the old zone, so you can simplify it to this (the AutoExec plugin also did not provide the old zone info, so this would be an equivalent):
yes i forgot forgive me but still the fact that someone might need old zone is not out of the realm of possibility
#9
Posted 15 February 2015 - 11:56 AM
I actually just tried with AE (was gonna fix it) and it seems to work fine for me. Can you confirm that it still doesn't work for you with AE? You can just load it and use this simple line, then zone and see if it prints "success" to the console:
ae register zone_* echo success
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users