Jump to content


Photo

Gearswap and Findall


    19 replies to this topic

    #1 krilton

    krilton

      Advanced Member

    • Members
    • PipPipPip
    • 71 posts

      Posted 30 January 2015 - 03:43 AM

      First off, is there something that could be done to 'findall' that would add a feature that show's various items (ninja tools) in your inventory, to help keep track of # remaining instead of running the command everytime? Secondly, is it possible to run a batch file from a job.lua file, copying various macro dat files from job to job, and how would that look in the 'lua' script?



      #2 Arcon

      Arcon

        Advanced Member

      • Windower Staff
      • 1189 posts
      • LocationMunich, Germany

      Posted 30 January 2015 - 06:54 AM

      First off, is there something that could be done to 'findall' that would add a feature that show's various items (ninja tools) in your inventory, to help keep track of # remaining instead of running the command everytime?

       

      Yes. Go to Windower/addons/findAll/data/settings.xml and activate the tracker. The tracking text should look something like this:

       

             <Track>Shihei: ${inventory:Shihei} (${all:Shihei})</Track

       

      This will display your current shihei count in your main inventory, followed by all your shihei in parentheses. You can adjust this as you want.

       

      Secondly, is it possible to run a batch file from a job.lua file, copying various macro dat files from job to job, and how would that look in the 'lua' script?

       

      You can try either Lua's own os.execute or our windower.execute function to run local scripts. I don't remember the difference.



      #3 krilton

      krilton

        Advanced Member

      • Members
      • PipPipPip
      • 71 posts

        Posted 30 January 2015 - 11:14 PM

        nice ty for the findall though is there something that can be done so it will put as follow:

         

        "item"

        "item"

         

        instead of "item""item"?



        #4 Arcon

        Arcon

          Advanced Member

        • Windower Staff
        • 1189 posts
        • LocationMunich, Germany

        Posted 31 January 2015 - 07:14 AM

        Looks a bit ugly, blame XML for it:

               <Track><![CDATA[Item 1 stuff here
        Item 2 stuff here
        Item 3 stuff here]]></Track>

         

        The CDATA stuff is needed to make it not lose formatting. Everything between CDATA tags is preserved exactly as you enter it. Otherwise it will collapse all white spaces (spaces, tabs, new lines, etc.) into one regular space.



        #5 krilton

        krilton

          Advanced Member

        • Members
        • PipPipPip
        • 71 posts

          Posted 01 March 2015 - 02:28 AM

          tried to find from a premade job.lua script that might have something in it that would execute batch files from within. Also spent a couple of days staring at my scripts and how it could be setup to do it but not knowing much about the language, i'm at a loss. 

           

          Anyone that knows lua that could assist on getting it working? 



          #6 Arcon

          Arcon

            Advanced Member

          • Windower Staff
          • 1189 posts
          • LocationMunich, Germany

          Posted 01 March 2015 - 10:51 AM

          What exactly is it that you need? Didn't the above work for you?



          #7 krilton

          krilton

            Advanced Member

          • Members
          • PipPipPip
          • 71 posts

            Posted 01 March 2015 - 07:25 PM

            You can try either Lua's own os.execute or our windower.execute function to run local scripts. I don't remember the difference.

             

            Not being familiar with lua, i wouldn't know how exactly to do it. If i had something to work from then i would be ok.

             

            What i'm wanting to run a batch file within the lua script instead of doing it from a macro. I think i mentioned that in this post but just in case i didn't. Example of a batch file would be unloading findall, copying the settings file for findall that would show # of tools and bags then reload findall.



            #8 sdahlka

            sdahlka

              Advanced Member

            • Members
            • PipPipPip
            • 324 posts

              Posted 02 March 2015 - 03:23 AM

              my include checks for weather you have any of the required Toolbag's in you inventory when you out of the required tool and if you do it will automatically open them this includes the multi tools



              #9 Arcon

              Arcon

                Advanced Member

              • Windower Staff
              • 1189 posts
              • LocationMunich, Germany

              Posted 02 March 2015 - 06:48 AM

              I'm pretty sure this should work:

              os.execute(windower.windower_path .. 'file.bat')

              Or, if it's in the addon folder:

              os.execute(windower.addon_path .. 'file.bat')


              #10 krilton

              krilton

                Advanced Member

              • Members
              • PipPipPip
              • 71 posts

                Posted 02 March 2015 - 05:39 PM

                The ".." part has me thrown or would it be this for the path of: "windower4\batchfiles\file.bat"

                 

                so if what you listed and what i think it should be and would look something like this then:

                 

                function

                   os.execute(windower.addon_path: 'windower4\batchfiles\file.bat')

                end

                 

                I'm still thinking something is missing, i want to say a colon after path though i'm not sure.

                 

                I am very grateful for everything too



                #11 Iryoku

                Iryoku

                  Advanced Member

                • Windower Staff
                • 488 posts

                  Posted 02 March 2015 - 10:17 PM

                  .. is the Lua string concatenation operator, it takes two string values and returns a new string value with them concatenated, or "stuck together" (e.g. 'foo' .. 'bar' creates the string 'foobar'). windower.addon_path is a variable provided by Windower which holds a string containing the path to an addon's base directory; windower.windower_path is the path to Windower's install directory.



                  #12 krilton

                  krilton

                    Advanced Member

                  • Members
                  • PipPipPip
                  • 71 posts

                    Posted 03 March 2015 - 01:55 AM

                    I was able to get it to work, somewhat. I see the command prompt box for a brief moment but everything that was suppose to happen from the batch file didn't.

                     

                    os.execute(windower.windower_path .. 'GearSwaps\Whm.bat')

                     

                    That is or would be correct if i understand everything and there is nothing before and after that?

                     

                    By the way, is there a specific location that the "os.execute" has to be at?

                     

                    I'm also not sure if this matters but i have windower installed on my E drive within the playonline folder.  

                     

                    "E:\program files (x86)\playonline\windower4"

                     

                    I have a couple of dats that i swap for common gear pieces, the pieces don't change and i can't tell if there is anything being done from that very brief moment of seeing the prompt box.



                    #13 Iryoku

                    Iryoku

                      Advanced Member

                    • Windower Staff
                    • 488 posts

                      Posted 03 March 2015 - 07:50 PM

                      Chances are you've just got the path wrong. Try print(windower.windower_path .. 'GearSwaps\Whm.bat') to see what the full path you're using looks like.



                      #14 Arcon

                      Arcon

                        Advanced Member

                      • Windower Staff
                      • 1189 posts
                      • LocationMunich, Germany

                      Posted 03 March 2015 - 08:31 PM

                      Backslashes are stupid and you should never use one in your life :( The above won't work for that reason alone (although possibly not just that). Change it to a forward slash and see if that helps.



                      #15 krilton

                      krilton

                        Advanced Member

                      • Members
                      • PipPipPip
                      • 71 posts

                        Posted 04 March 2015 - 12:56 AM

                        tried both with no luck, i even tried putting the batch file in the root of the windower folder thinking maybe..... yet  nothing happened.

                         

                        Could it be the position with the string by chance?



                        #16 Iryoku

                        Iryoku

                          Advanced Member

                        • Windower Staff
                        • 488 posts

                          Posted 04 March 2015 - 04:49 AM

                          Like I said, try printing the string and seeing what it says. The path it's using is likely not the path you think it is.



                          #17 krilton

                          krilton

                            Advanced Member

                          • Members
                          • PipPipPip
                          • 71 posts

                            Posted 04 March 2015 - 09:23 PM

                            Like I said, try printing the string and seeing what it says. The path it's using is likely not the path you think it is.

                             

                            Only thing is..... how do i go about doing that?



                            #18 Arcon

                            Arcon

                              Advanced Member

                            • Windower Staff
                            • 1189 posts
                            • LocationMunich, Germany

                            Posted 05 March 2015 - 09:11 PM

                            Change the "os.execute" to "print" and it will print the string to the console.



                            #19 brudindy

                            brudindy

                              Member

                            • Members
                            • PipPip
                            • 10 posts

                              Posted 17 May 2015 - 09:20 PM

                              would you make gearswap, find, and organizer to work with mogsafe2? or how should I change the settings to make it work with mogsafe2? 



                              #20 Arcon

                              Arcon

                                Advanced Member

                              • Windower Staff
                              • 1189 posts
                              • LocationMunich, Germany

                              Posted 18 May 2015 - 06:15 AM

                              GS and Organizer already do, I'm working on FindAll and it should be ready tonight.






                              1 user(s) are reading this topic

                              0 members, 1 guests, 0 anonymous users