Jump to content


Photo

pretarget or prerender?


    9 replies to this topic

    #1 zaxtiss

    zaxtiss

      Advanced Member

    • Members
    • PipPipPip
    • 49 posts

      Posted 10 July 2015 - 12:42 PM

      hey im not sure what i would use pretarget or prerender to my function tocheck if is a valid target an is monster and check my invo to see if the to be used it in the bag or not .

       

       

       heres what i have so far

       

      windower.register_event('chat message','prerender', windower.send_command(str))
         local Target = windower.ffxi.get_mob_by_index(windower.ffxi.get_player().target_index)
         local player = windower.ffxi.get_mob_by_index(windower.ffxi.get_player().index)
      local TargetID = Target
       local player.target.name = Target
      if target_name == "Sturdy Pyxis" than
      windower.send_command(input /item "forbidden Key" <'t'>)
      end


      #2 Arcon

      Arcon

        Advanced Member

      • Windower Staff
      • 1189 posts
      • LocationMunich, Germany

      Posted 25 July 2015 - 08:38 AM

      Sorry for the late reply, I was on vacation. This should do:

       

      windower.register_event('target change', function(target_index)
          local target = windower.ffxi.get_mob_by_nidex(target_index)
          if not target or target.name ~= "Sturdy Pyxis" then
              return
          end
       
          windower.chat.input("/item \"Forbidden Key\" <t>")
      end)


      #3 sdahlka

      sdahlka

        Advanced Member

      • Members
      • PipPipPip
      • 324 posts

        Posted 25 July 2015 - 05:12 PM

        i wonder if there is a way to tell if the box is open or not??



        #4 zaxtiss

        zaxtiss

          Advanced Member

        • Members
        • PipPipPip
        • 49 posts

          Posted 28 July 2015 - 05:36 PM

          i wonder if there is a way to tell if the box is open or not??

            i havent had access for it since im on new char no days  i think to 'check'  to see if its open or not it would be someting like this

           

           

           

          windower.register_event('target change', target_change)
           
          windower.register_event('incoming text', function(old,new,color,newcolor)   
              if proc ~= 0 then
                  local play = windower.ffxi.get_player()
                  if play and string.find(old,(play.name).. '\'sopens the chest%p') then  -- idk the real text that owuld pop after opening the chest
                      local targ = windower.ffxi.get_mob_by_target('t')
                      local ltarg = windower.ffxi.get_mob_by_target('lastst')
                      if targ then
                          for k, v in ipairs(openned) do
                              if v == targ.id and ltarg then
                                  targ = ltarg
                              end
                          end
                      elseif ltarg then
                          targ = ltarg
                      end
                      table.insert(openned, targ.id)
                      target_change()
                      windower.send_ipc_message('add'..targ.id)
                  end
           
           
           
          welcome back acron hope you had fun on your vacation :)


          #5 sdahlka

          sdahlka

            Advanced Member

          • Members
          • PipPipPip
          • 324 posts

            Posted 29 July 2015 - 01:03 AM

              i havent had access for it since im on new char no days  i think to 'check'  to see if its open or not it would be someting like this

             

             

             

            windower.register_event('target change', target_change)
             
            windower.register_event('incoming text', function(old,new,color,newcolor)   
                if proc ~= 0 then
                    local play = windower.ffxi.get_player()
                    if play and string.find(old,(play.name).. '\'sopens the chest%p') then  -- idk the real text that owuld pop after opening the chest
                        local targ = windower.ffxi.get_mob_by_target('t')
                        local ltarg = windower.ffxi.get_mob_by_target('lastst')
                        if targ then
                            for k, v in ipairs(openned) do
                                if v == targ.id and ltarg then
                                    targ = ltarg
                                end
                            end
                        elseif ltarg then
                            targ = ltarg
                        end
                        table.insert(openned, targ.id)
                        target_change()
                        windower.send_ipc_message('add'..targ.id)
                    end
             
             
             
            welcome back acron hope you had fun on your vacation :)

            i was thinking about there being something in windower.ffxi.get_mob_by_index(target_index) that might have the whether its locked or unlocked

             

            im not saying it cant be done watching incoming chat but then you you would have to remove things from a table as the chests disappears

             

            mind you i have not looked at windower.ffxi.get_mob_by_index(target_index) when opening boxes in aby



            #6 zaxtiss

            zaxtiss

              Advanced Member

            • Members
            • PipPipPip
            • 49 posts

              Posted 03 August 2015 - 05:44 PM

              Sorry for the late reply, I was on vacation. This should do:

               

               

              windower.register_event('target change', function(target_index)
                  local target = windower.ffxi.get_mob_by_nidex(target_index)
                  if not target or target.name ~= "Sturdy Pyxis" then
                      return
                  end
               
                  windower.chat.input("/item \"Forbidden Key\" <t>")
              end)

              ahhh yes lol i finally got to test this out acron it works like a charm!!! 



              #7 Arcon

              Arcon

                Advanced Member

              • Windower Staff
              • 1189 posts
              • LocationMunich, Germany

              Posted 23 August 2015 - 06:13 AM

              There isn't. You also can't just watch the chatlog, since you won't know which chest the message belongs to. You'll have to look for packets and watch the animation change.



              #8 zaxtiss

              zaxtiss

                Advanced Member

              • Members
              • PipPipPip
              • 49 posts

                Posted 27 August 2015 - 04:37 AM

                any suggestions on some developer tools for doing that i've some programming injava and C/C++ but dealing with packets is stillpretty new



                #9 Iryoku

                Iryoku

                  Advanced Member

                • Windower Staff
                • 488 posts

                  Posted 28 August 2015 - 05:02 AM

                  Arcon has a PacketViewer addon for this kind of thing. It has quite a few features; logging to file, scanning for known values, nice color-coded on-screen hex dump for known packet types, etc. If you need help using it you'll probably be best served by asking Arcon directly on IRC, but if you'd like to try and figure it out yourself, the command handler starts on line 603.



                  #10 Arcon

                  Arcon

                    Advanced Member

                  • Windower Staff
                  • 1189 posts
                  • LocationMunich, Germany

                  Posted 30 August 2015 - 02:08 PM

                  Ftr, the most updated version along with a description of how it works can be found here.






                  1 user(s) are reading this topic

                  0 members, 1 guests, 0 anonymous users