Item Search
     
BG-Wiki Search
Page 136 of 302 FirstFirst ... 86 126 134 135 136 137 138 146 186 ... LastLast
Results 2701 to 2720 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #2701
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Hmmm I know there is a way that it you have for ex. 2 march it will return a 2,
    So for active runes I could do a check for every rune and in the end, total runes will be the sum of that value.

    Could use the variable and might be easier, but I have another idea in mind so need to check few pages back to find that code.

  2. #2702
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Sechs View Post
    @dlsmd
    Yes still looking for that, thanks for sharing, gonna test it asap
    With that variable "casting" displayed for a while I'm gonna get an idea of how many packets I lose on average.
    if you need help getting it to show correctly let me know and i should be able to help you

  3. #2703
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    @JSH
    Well if there is a function/way to specifically check how many of buff "X" is up that would be better but probably the March one uses wildcards, like "xxx March". Runes all have 8 different names, nothing in common.

  4. #2704
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    The buff for march just says "March" unless it has been changed.

    Could probably do a buffactive['March'].count() to get the number of march buffs.

    As for runes, you could do your own function to get a count.

    Code:
    function count_runes()
    
      runes = { 'list', 'of', 'runes' }
      rune_count = 0
      for _, rune in ipairs(runes) do
        if buffactive[rune]
          rune_count = rune_count + 1
        end
      end
    
      return rune_count
    end

  5. #2705
    RIDE ARMOR
    Join Date
    May 2012
    Posts
    20
    BG Level
    1

    nvm

  6. #2706
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Sechs View Post
    @JSH
    Well if there is a function/way to specifically check how many of buff "X" is up that would be better but probably the March one uses wildcards, like "xxx March". Runes all have 8 different names, nothing in common.
    Yea I know, In mind I have, is to check how many of Each I have, and the sum of all of those cant be more than 3

  7. #2707
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Shadowmeld View Post
    The buff for march just says "March" unless it has been changed.

    Could probably do a buffactive['March'].count() to get the number of march buffs.

    As for runes, you could do your own function to get a count.

    Code:
    function count_runes()
    
      runes = { 'list', 'of', 'runes' }
      rune_count = 0
      for _, rune in ipairs(runes) do
        if buffactive[rune]
          rune_count = rune_count + 1
        end
      end
    
      return rune_count
    end
    this would only work If I have 3 different runes, if the 3 are the same, the rune count will be 1.

  8. #2708
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    sorry, you are correct, but easily rectified

    Code:
    function count_runes()
    
      runes = { 'list', 'of', 'runes' }
      rune_count = 0
      for _, rune in ipairs(runes) do
        if buffactive[rune]
          rune_count = rune_count + buffactive[rune].count
        end
      end
    
      return rune_count
    end

  9. #2709
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    There's no 'count' field. buffactive['March'] will return either nil (no Marches), 1 or 2. Same for any other buff.

    The above function only needs a few minor tweaks:
    Code:
    function count_runes()
      local runes = { 'list', 'of', 'runes' }
      local rune_count = 0
      for _, rune in pairs(runes) do
        if buffactive[rune] then
          rune_count = rune_count + buffactive[rune]
        end
      end
    
      return rune_count
    end
    Also, if you're using my library files, Mote-Mappings has a list of runes in the 'runes' table.

  10. #2710
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    well... only have 1 issue... and is the same as always with buffactive['....'], If I use ignis, in aftercast it will return nil, on second ignis, will return 1... and so on coz It cant be updated fast enough ~.~

  11. #2711
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Sechs View Post
    @JSH
    Well if there is a function/way to specifically check how many of buff "X" is up that would be better but probably the March one uses wildcards, like "xxx March". Runes all have 8 different names, nothing in common.
    there is
    buffactive['<buff>'] == 3 would be 3 of the <buff>

    Quote Originally Posted by JSHidaka View Post
    well... only have 1 issue... and is the same as always with buffactive['....'], If I use ignis, in aftercast it will return nil, on second ignis, will return 1... and so on coz It cant be updated fast enough ~.~
    dont use aftercast use buff_change(name,gain)

    buff_change(name,gain) is only triggered when a buff is gained or lost

  12. #2712
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    well found a wall that I cant pass >.>
    I was able to make this
    http://i93.photobucket.com/albums/l5...3C204501DD.jpg
    http://i93.photobucket.com/albums/l5...5737854E75.jpg

    the problem is... for example If I have 3 ignis already... how can I reset the counter back to 1... in the link bellow is the file (mix of lots of things lol) that have the code.. I was trying If I have already 3 up... to change the counter to 1... but well no idea how to start it after is set to 1.

    http://pastebin.com/qhzSr3WP

  13. #2713
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by JSHidaka View Post
    well found a wall that I cant pass >.>
    I was able to make this
    http://i93.photobucket.com/albums/l5...3C204501DD.jpg
    http://i93.photobucket.com/albums/l5...5737854E75.jpg

    the problem is... for example If I have 3 ignis already... how can I reset the counter back to 1... in the link bellow is the file (mix of lots of things lol) that have the code.. I was trying If I have already 3 up... to change the counter to 1... but well no idea how to start it after is set to 1.

    http://pastebin.com/qhzSr3WP
    ok now this im not sure of

  14. #2714
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by JSHidaka View Post
    well... only have 1 issue... and is the same as always with buffactive['....'], If I use ignis, in aftercast it will return nil, on second ignis, will return 1... and so on coz It cant be updated fast enough ~.~
    Yep, which is exactely why I was suggesting using a custom variable to track runes instead of buffactive or other means
    Anyway, I have a plethora of questions for you about some commands/syntaxes I did not understand but I guess I'll ask in PM if you don't mind, don't wanna bore people even more D:

    Getting back in topic, I think I've found a solution but I need another key component and I don't know how create it

    1. Rune_Timers_Creator
      Assigns initial duration values to the variables and increments the rune counter. I was thinking to call this in the midcast with a "If spell.type == 'Rune'", which is an already existing category that includes all 8 runes.
      Spoiler: show
      Code:
      function rune_timers_creator()
      	If RuneN == 0 then
      		Rune1 = 300
      	elseif RuneN == 1 then
      		Rune2 = 300
      	elseif RuneN == 2 then
      		Rune3 = 300
      	elseif RuneN == 3 then
      		Rune1 = Rune2
      		Rune2 = Rune3
      		Rune3 = 300
      	end
      	if RuneN < 4 then
      		RuneN = RuneN +1
      	end
      end
    2. Rune_Timers_Displayer
      Called in the aftercast with the same condition, spell.type == 'Rune'. Initially it deletes all possible 3 existing rune timers. Then it proceeds to create new ones (from 1 to 3) according to the RuneN variable (incremented at the end of the previous function, max value of 3). The way I coded it, this function could also be used as a "screen cleaner" to clean the 3 existing timers after a Lunge, a Rayke or a Gambit (JAs that consume all the existing runes). Swipe would need a custom function/lines, can be done in the Aftermath "if spell.name == 'Swipe'" I guess.
      Spoiler: show
      Code:
      function rune_timers_displayer()
      	send_command('timers d "Rune 1"')
      	send_command('timers d "Rune 2"')
      	send_command('timers d "Rune 3"')
      	if RuneN == 1 then
      		send_command('timers c "Rune 1: "'..tostring(rune1)..')
      	elseif RuneN == 2 then
      		send_command('timers c "Rune 1: "'..tostring(rune1)..')
      		send_command('timers c "Rune 2: "'..tostring(rune2)..')
      	elseif RuneN == 3 then
      		send_command('timers c "Rune 1: "'..tostring(rune1)..')
      		send_command('timers c "Rune 2: "'..tostring(rune2)..')
      		send_command('timers c "Rune 3: "'..tostring(rune3)..')
      	end
      end
    3. Rune_Timers_Expirer
      The role of this function should be to clear and adjust variables when a rune expires. When Rune1 expires, this function needs to swap the information data for runes, according to the number, and then it will call the Displayer function again.
      Spoiler: show
      Code:
      function rune_timers_expirer()
      	if RuneN == 3 then
      		Rune1 = Rune2
      		Rune2 = Rune3
      	elseif RuneN == 2 then
      		Rune1 = Rune2
      	end
      	RuneN = RuneN-1
      	rune_timers_displayer()
      end
    4. Additional stuff - Without specific functions, we need to set specific lines in aftercast. If spell.name == Lunge, Rayke or Gambit then RuneN = 0 and we launch the displayer function (which will just clean the screen). For Swipe you would do something different.
      Spoiler: show
      Code:
      if spell.name == 'Gambit' or spell.name == 'Lunge' or spell.name == 'Rayke' then
      	RuneN = 0
      	rune_timers_displayer()
      end
      
      ...
      
      if spell.name == Swipe then
      	RuneN = RuneN-1
      	rune_timers_displayer()
      end




    Function 3 is my main concern.
    Atm it's meant to be used inside a Function Buff_Change, but wouldn't we incur in the same issue we talked about earlier concerning buffactive if used that?
    So maybe we should take a less orthodox approach and handle the whole thing completely offline.
    Runes are pretty special compared to many other buffs.
    • Their duration is fixed (300 seconds)
    • They cannot be cancelled or dispelled
    • They only expire if you consume them with specific JAs, die or zone
    Considering these aspects, couldn't we just avoid using stuff like buff_change and buffactive and simply use duration as our key factor? Like schedule a call to an "expirer function" for that specific rune the moment you use the run.
    Like you're using Rune1? Then follow that with a "Schedule Expirer(Rune1) 300 seconds" and that rune will be cancelled in 300 seconds.
    Of course you would have to cancel the scheduling if you use one of the previously mentioned JAs, and this kinda makes it complicated...
    Thoughts?

  15. #2715
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    the only "problem" or "complications" I see using that way is... what about if you have a mix of runes? with the modifications to Byrth's code, if its for tracking different runes, it works flawless(lol), the problem is... if its just 1 rune.


    actually... the problem for me atm is.. that timers don't let me create 2 custom timers with the same name..

  16. #2716
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    You should never, ever, ever modify the runecount variable that you have set up outside of the method you have specifically designed for counting the runes that you have active. You should set up something similar to what sechs described for handling runes and their timers.

    I have never really worked with timers in lua, going to see if I can figure it out and get back to you.

  17. #2717
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by JSHidaka View Post
    what about if you have a mix of runes?
    Pardon my naivity, but why should it matter?
    It would matter only if you wanted to display the rune name as well but, aside from personal preference, that's not really a relevant information to my point of view.
    I already have that information on screen in the form of the icons/symbols in my buff zone.
    The time-left information instead is something that doesn't exist on screen, and the reason why I started desiring to track it somehow.

    Going back to my simple lines of codes (which I didn't even test yet... sorry lol) I'm still unsure what to do with function 3).
    Will buff_change make us incur into the same sort of issue we have with buffactive?
    Because if that's the case we need something else.
    The scheduled thing was an I idea I threw there but honestly it seems a bit too complicated.


    @Shadow
    Were you talking to me or to JSH? D:
    If you were talking to me please explain further. I'm a bit dumb with these things but I love to learn more :D
    The situations where the Rune counter needs to be modified are just the following:
    1) A Rune is used
    2) A Rune is consumed
    3) A Rune expires
    4) You die
    5) You zone
    There is no other situation that I can think of. Currently I didn't implement anything for 4) or 5) but they would be very simple to do.
    My main concern atm is how to handle 3) atm =/

  18. #2718
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    hmm true that might be irrelevant info... I might have another idea in my head lol and that one need a way to manage the names ...

    but taking the part that you only need 3 names, Rune 1, Rune 2, Rune 3, then might be just easier to do using part of the code I've modify,
    kind of need a counter to increase by one each time I use a rune, no matter what rune I use, if its the first time It will be named "Rune 1", second one will be "Rune 2, third one "Rune 3"... then reset the cycle, and 4th rune will be Rune 1...

    If I can make this.. then your #3 wont be an issue coz this handle it

    EDIT:
    Well.. "GOT IT", will complete and clear the code... fun that just knowing that the name doesn't matter.. did make this easier... well kind of easier it makes the basic things, but need to work in others conditions

  19. #2719
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Cool, can't wait to read your solution!
    Altough I probably won't understand anything...
    In the previous page I could grasp like, what, 1 lines on 4 that you used? xD

  20. #2720
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    http://pastebin.com/53Kajm1G

    "Known issues"

    *Was testing the reset on JA's, for Swipe works good, but in the same testing, after Lunge I used another rune, so had 3 up, but when I used Lunge only 2 runes were consumed instead the 3 I had up... since I dont really play RUN, no idea if this is normal or not..
    *Was trying to make in buff_change, if you lose a rune, to decrease the counter by 1... but.. well.. if that matters.. "that part need some work"

Page 136 of 302 FirstFirst ... 86 126 134 135 136 137 138 146 186 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45