Jump to content


Photo

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


    8 replies to this topic

    #1 keiyo

    keiyo

      Member

    • Members
    • PipPip
    • 24 posts

      Posted 01 February 2015 - 03:22 PM

      I can't seem to get zone_ anything to work. Tried zone_Upper_Jeuno and zone_*. Both does not seem to work.



      #2 keiyo

      keiyo

        Member

      • Members
      • PipPip
      • 24 posts

        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 Kenshi

        Kenshi

          Advanced Member

        • Members
        • PipPipPip
        • 334 posts

          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 keiyo

          keiyo

            Member

          • Members
          • PipPip
          • 24 posts

            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 Arcon

            Arcon

              Advanced Member

            • Windower Staff
            • 1189 posts
            • LocationMunich, Germany

            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 sdahlka

            sdahlka

              Advanced Member

            • Members
            • PipPipPip
            • 324 posts

              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 Arcon

              Arcon

                Advanced Member

              • Windower Staff
              • 1189 posts
              • LocationMunich, Germany

              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 sdahlka

              sdahlka

                Advanced Member

              • Members
              • PipPipPip
              • 324 posts

                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 Arcon

                Arcon

                  Advanced Member

                • Windower Staff
                • 1189 posts
                • LocationMunich, Germany

                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