Addon To Display Current Index Of Gearswap Matrices In UI

Langues: JP EN DE FR
users online
Forum » Windower » General » Addon to Display Current Index of Gearswap Matrices in UI
Addon to Display Current Index of Gearswap Matrices in UI
 Phoenix.Urteil
Offline
Serveur: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-10-02 00:44:15
Link | Citer | R
 
For my DRK I use a physical accuracy array, magical accuracy array, nuke arrays, and drain/aspir potency array. I was wondering if anyone knew a way to display these in a text box within the UI? Perhaps using the text add-on or creating something that could point to the matrix values in my GS?
Code
--**** Arrays for various toggles *****--
--***** 3 Levels Of Accuracy Sets For TP/WS/Hybrid/Stun. *****--	
	AccIndex = 3
	AccArray = {"LowACC","MidACC","HighACC"} -- 
--***** 3 Levels of Magic Acc for Hard Monsters. *****--
	MaccIndex = 3
	MaccArray = {"LowMACC", "MidMACC", "HighMACC"}
--***** 3 Levels of Drain Acc<==>Potency *****--
	DrainIndex = 1
	DrainArray = {"DrainLowMACC", "DrainMidMACC", "DrainHighMACC"}
--***** Weapon Array *****--
	WeaponIndex = 1
	WeaponArray = {"Liberator", "Apocalypse", "Ragnarok"} 
--***** Idle Array *****--	
	IdleIndex = 3
	IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Refresh --
	
--***** Nuke Indexes for Nuke Toggles *****--
	T1NukeIndex = 5
	T1NukeArray ={"Stone", "Water", "Aero", "Fire" , "Blizzard", "Thunder"}
	T2NukeIndex = 5
	T2NukeArray ={"Stone II", "Water II", "Aero II", "Fire II" , "Blizzard II", "Thunder II"}
	T3NukeIndex = 5
	T3NukeArray ={"Stone III", "Water III", "Aero III", "Fire III" , "Blizzard III", "Thunder III"}
			
--****** Rune Indexes for Runes /RUN *****--
	RuneIndex = 8
	RuneArray = {"Tellus","Unda","Flabra","Ignis","Gelus","Sulpor","Lux","Tenebrae"}



The idea would be to be able to change the position of the box, customize the displayed toggles, and perhaps even change the color of the displayed options. This way it would be wasy to know which level of acc/macc/nuke/whatever you have a toggle for is currently on without having to cycle and have something added to chat.

I guess in my primitive understanding, I simply need an on screen text display of the current indexes in my GS. I am at a loss as to how to pass these values to an exiting add-on or the text add-on. (If that is even the most prudent course of action.)

However, if there is an easier/existing way to do this. . . I'd like to do that.
 Sylph.Subadai
Offline
Serveur: Sylph
Game: FFXI
user: Subadai
Posts: 184
By Sylph.Subadai 2015-10-02 11:59:49
Link | Citer | R
 
This can probably be done through lua but I don't know how; you'd probably get someone to answer over on BG. I do use the Text addon for static strings... if you can figure out how to get lua to return a string value you can just add it to the Text command. Here are the commands I know of (some from the readme, some I got from Text.lua):

text <name> create "Text 1 2 3 4"
text <name> pos 1500 100
text <name> size 20
text <name> color 255 255 0
text <name> bold true
text <name> append "Text 1 2 3 4"
text <name> appendline "Text 5 6 7 8"
text <name> text "Text 1 2 3 4"
text <name> hide
text <name> show
text <name> clear
text <name> delete

Where <name> is any name you make up. The trick here is to get lua to return your arrays in a form usable by Windower and replace "Text 1 2 3 4" with whatever that expression is. Alternatively, write a lua script and do it all from there with lua commands. You could even insert it into your DRK lua or call your script from there.
Administrator
Offline
Posts: 6495
By Rooks 2015-10-02 12:16:40
Link | Citer | R
 
It would be pretty specific to the lua file being used, since people can implement those in different ways.
 Lakshmi.Byrth
VIP
Offline
Serveur: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6137
By Lakshmi.Byrth 2015-10-02 16:08:58
Link | Citer | R
 
The texts library is exposed to user files, which is how you should do it. On my phone now, so not much I can do
 Cerberus.Conagh
Offline
Serveur: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2015-10-02 16:26:06
Link | Citer | R
 
Well I used this which utilized a HUD, it doesn't do what you're asking but it does put onscreen data, you would just need to change the way it checks the data:

Here's the example (It's a live Onscreen parse and pDIF calculator but meh)

It shows the code to create a HUD on your screen, although as said the referenced data is more based on lua catching your attacks and averaging them ~ to do this via onscreen displays for i.e What set am I in you would change the display to something like, the main file had this inside it ~

This was more set up to Auto Amend sets based on Accuracy / Attack etc and damage being dealt. It wasn't finished so I can't remember if it said if you were in USE pdt / DD stance or Autopilot on screen as I don't play anymore can't check, but feel free to try and use this (I'm sure someone could scrap one together from this)

Edit: For clarity the link for my Gearswaps and how they're laid out in case I missed something can be found here
[+]
 Phoenix.Urteil
Offline
Serveur: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-10-04 01:24:11
Link | Citer | R
 
I'm having trouble reverse engineering the above, is there actually a possibility of such an add-on being developed?
 Asura.Vafruvant
Offline
Serveur: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2015-10-04 01:34:34
Link | Citer | R
 
Phoenix.Urteil said: »
I'm having trouble reverse engineering the above, is there actually a possibility of such an add-on being developed?
I doubt it would be an and-on and rather a GS-specific script. I spent about an hour last night before bed trying to figure it out, but I was too tired to debug it fully. I have a day off Monday so I plan to attempt to fine-tune it then.
 Phoenix.Urteil
Offline
Serveur: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-10-04 02:09:57
Link | Citer | R
 
Sweet.
Offline
By Aeyela 2015-10-04 02:12:15
Link | Citer | R
 
After playing with Conagh's example, that's definitely what Urteil is looking for. Kudos.
[+]
 Phoenix.Urteil
Offline
Serveur: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-10-04 04:22:31
Link | Citer | R
 
I will get this to work.
 Asura.Vafruvant
Offline
Serveur: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2015-10-05 00:13:17
Link | Citer | R
 
Verda said: »
initialize(window, smn_info.box, 'window')
This line throws an error, btw. Probably missed a segment in the paste here.
 Phoenix.Urteil
Offline
Serveur: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-10-11 07:08:16
Link | Citer | R
 
I still can't get this working. Did anyone else?
 Shiva.Nitroustaru
Offline
Serveur: Shiva
Game: FFXI
Posts: 29
By Shiva.Nitroustaru 2015-10-21 00:58:55
Link | Citer | R
 
I just did something like this for my pld yesterday. It wasn't as in depth as you are asking for though. I can show you what i did i guess though. Put it in code tags below, took out basically everything except what's prudent to what you're asking. It basically just keeps track of what Armor set i have equipped (whether it be reraise, pdt, mdt, or dt-) my phalanx amount and which shield i have it equip. hope this helps somewhat
Code
include('organizer-lib')
text = require('texts')
remote = false
smdt = false
spdt = false
sshield = false
reraise = false
shybrid = false
shield = "Ochain"
armor = "Normal"
phalanx = 0
str =        'Shield: ${shield|Ochain}, Armor: ${armor|Normal}, Phalanx: ${phalanx|Off}'
display = text.new()
display:text(str)
display:font("Consolas")
display:size(10)
display:pos(400,880)
display:show()


function buff_change(status,gain)
    if gain and (status == "Sleep" or status == "Terror" or status == "Stun") then
        windower.send_command('@wait .1; gs c check')
    end
    if status == "Phalanx" then
        if gain then
            display.phalanx = 28 + math.floor((player.skills.enhancing_magic - 300.5)/28.5) + 4 + 3 + 4
            --Weard Mantle 4, Yorium Cuirass 3, Souveran Handschuhs 4
        else
            display.phalanx = "Off"
        end
    end
end


function self_command(command)
    ---removed a lot of unimportant stuff here
     if command == "shieldswap" then
        if shield == "Ochain" then
            equip({sub="Aegis"})
            shield = "Aegis"
            display.shield = "Aegis"
        else
            equip({sub="Ochain"})
            shield = "Ochain"
            display.shield = "Ochain"
        end
        add_to_chat(207,'Shield: '..shield)
    
    elseif T{'pdt','mdt','reraise','hybrid'}:contains(command) then
        if command == 'pdt' then
            if spdt == false then
                sets.aftercast_TP = sets.pdt
                sets.aftercast_Idle = sets.pdt
                spdt = true
                smdt = false
                sshield = false
                shybrid = false
                reraise = false
                add_to_chat(207, 'Armor: PDT')
                display.armor = "PDT"
            else
                sets.aftercast_TP = sets.TP_Normal
                sets.aftercast_Idle = sets.Idle
                spdt = false
                add_to_chat(207, 'Armor: Normal')
                display.armor = "Normal"
            end
        elseif command == 'mdt' then
            if smdt == false then
                sets.aftercast_TP = sets.mdt
                sets.aftercast_Idle = sets.mdt
                smdt = true
                spdt = false
                sshield = false
                shybrid = false
                reraise = false
                add_to_chat(207, 'Armor: MDT')
                display.armor = "MDT"
            else
                sets.aftercast_TP = sets.TP_Normal
                sets.aftercast_Idle = sets.Idle
                smdt = false
                add_to_chat(207, 'Armor: Normal')
                display.armor = "Normal"
            end
        elseif command == 'reraise' then
            if reraise == false then
                reraise = true
                smdt = false
                spdt = false
                sshield = false
                hybrid = false
                sets.aftercast_TP = set_combine(sets.hybrid,sets.Reraise)
                sets.aftercast_Idle = set_combine(sets.hybrid,sets.Reraise)
                add_to_chat(207,"Armor: Reraise")
                display.armor = "Reraise"
            else
                reraise = false
                sets.aftercast_TP = sets.TP_Normal
                sets.aftercast_Idle = sets.Idle
                add_to_chat(207,"Armor: Normal")
                display.armor = "Normal"
            end
        elseif command == 'hybrid' then
            if shybrid == false then
                sets.aftercast_TP = sets.hybrid
                sets.aftercast_Idle = sets.hybrid
                smdt = false
                spdt = false
                shybrid = true
                reraise = false
                add_to_chat(207, 'Armor: Hybrid')
                display.armor = "DT-"
            else
                sets.aftercast_TP = sets.TP_Normal
                sets.aftercast_Idle = sets.Idle
                shybrid = false
                add_to_chat(207, 'Armor: Normal')
                display.armor = "Normal"
            end
        end
        
        if player.status == "Engaged" then
            equip(sets.aftercast_TP)
        else
            equip(sets.aftercast_Idle,sets.Movement)
        end
    end
end



I do a lot of stuff here that isn't really needed. But feel free to ask me here if you need help trying to figure this out... it basically puts a text box above my chat log that says
Code
Shield: Ochain, Armor: Normal, Phalanx: Off


until i change something via my macros. i.e. call shieldswap command and it'll change it to Aegis, or equip my dt- set and it'll change armor to say "DT-"

I do that via the variables you see in this line:
Code
str =        'Shield: ${shield|Ochain}, Armor: ${armor|Normal}, Phalanx: ${phalanx|Off}'


As you can see ${shield|Ochain} written there makes a variable in the display text object called shield. Which i can change to what i want by changing the display.shield variable, but is defaulted to say "Ochain".
[+]
 Phoenix.Urteil
Offline
Serveur: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-10-24 04:30:38
Link | Citer | R
 
I got the onscreen display to work. How do I pass the indexes from the matrices into it?
 Shiva.Nitroustaru
Offline
Serveur: Shiva
Game: FFXI
Posts: 29
By Shiva.Nitroustaru 2015-10-24 18:31:41
Link | Citer | R
 
i would need to see your code to see how you did it to tell you that.

If you did it like mine then, from my example above

Index: $(variable|default)

You would do something like display.variable = index

Otherwise, to assist you further i will need to see how you set it up.

Also, i assume you use commands to change your variables. So you would need to just add, using your variable names from above:
Code
if command = "change acc index command" then
   if AccIndex = 3 then
      AccIndex = 1
   else
      AccIndex = AccIndex + 1
   end
   display.AccIndex = AccIndex
end
Log in to post.