is there any way i can get this to process with no action taking place by me??
Code:if player.target.name == 'Beach Bunny' then if player.target.hpp <= 20 then equip(main="Teiwaz",sub="empty") end end
is there any way i can get this to process with no action taking place by me??
Code:if player.target.name == 'Beach Bunny' then if player.target.hpp <= 20 then equip(main="Teiwaz",sub="empty") end end
I thought you could probably use windower.register_event('hp change'), but I think that might only trigger when your HP changes, not necessarily your target's. I looked through the other events and didn't see one for other people's HP.
I'm using Motenten's BRD.lua. So I'm using that, Mote-Include, Mote-Globals, Mote-Mappings, Mote-SelfCommands, and Mote-Utility. The toggles and commands from Mote-SelfCommands work except for Casting Mode: Dire. But the ones from BRD.lua don't.
Lurking in some simpler GS files, I still need to understand what is the index function and how does it work.
For instance take this
When the action you perform is Resolution, he equips sets.Resolution.index.Code:if spell.english == 'Resolution' then equip(sets.Resolution[sets.Resolution.index[Resolution_ind]]) end
At the beginning of the file there are 2 defined Resolution sets: sets.Resolution.attack and sets.Resolution.accuracy.
Also Resolution_ind is set to the value of 1.
What does this mean? How does it swap between the two available sub-sets?
Reading the lua further it seems there is a toggle function. When you activate it it "cycles" to the next sub-set in the list.
What if I don't want to do that but I want direct access commands for each set?
Instead of a toggle/cycle thing, I'd love to have a command to bind to my hotkeys and then press it to activate the related set.
Like G1 key activates the default one, G2 activates accuracy, G3 activates PDT and stuff like that.
Then another question
Of course I simplified the structure to keep it quicker to read.Code:function midcast(spell,act) if spell.english == 1 if spell.english == 2 end
What if I want to add an "else"?
Like, predefining a set number of IFs, and then defining a last one which will handle all other situations which do not fall into the previous IFs.
Ah, very simple. Awesome!![]()
also if you got this some how from my weapon skill include (http://pastebin.com/mVyt5YeN)
Code:if spell.english == 'Resolution' then equip(sets.Resolution[sets.Resolution.index[Resolution_ind]]) end
i.e.
in the equip line [weaponskill.type[spell.name] this checks the weaponskill.type table against the spell name which turns sets.weaponskill.type[weaponskill.type[spell.name]] into sets.weaponskill.type.Handtohand for ComboCode:if spell.type == "WeaponSkill"then equip(sets.weaponskill.type[weaponskill.type[spell.name]]) equip(sets.weaponskill.element[spell.wsA]) end
if you want it to have a command that you can turn on and off look at my staff include (http://pastebin.com/QM1PXc1T)
these are the tables and variables
shere is the equip codeCode:pells.cure = S{'Cura','Cura II','Cura III','Curaga','Curaga II','Curaga III','Curaga IV','Curaga V','Cure','Cure II','Cure III','Cure IV','Cure V','Cure VI'} Changestaff = true --Togle with //gs c tchangestaff (true for change staves, false for do not change staves) Usestaff = 'Atk' --Togle with //gs c tstaveuse (Atk for Attack Staves, Acc for Accuracy Staves)
and here is the controle codeCode:if Changestaff then if spell.action_type == 'Magic' then if spells.cure[spell.english] then equip(sets.precast.Cur) else equip(sets.precast[Usestaff][spell.element]) end end end
it works with //gs c 'thecorrectcommand' to eather stop, start or select the type of staves you want to equip
Code:if command == 'tstavetouse' then if Usestaff == 'Atk' then Usestaff = 'Acc' send_command('@input /echo ----- STAVES SET TO ACC -----') elseif Usestaff == 'Acc' then Usestaff = 'Atk' send_command('@input /echo ----- STAVES SET TO ATK -----') end elseif command == 'tchangemagestaff' then Changestaff = not Changestaff send_command('@input /echo ----- STAVES WILL ' .. (Changestaff and '' or 'NOT ') .. 'CHANGE -----') end
Index isn't a function, it's a table. He defines it above:
In the table, there are two values: Attack and Accuracy, and two keys (not shown), 1 and 2. What sets.Resolution.index really looks like isCode:sets.Resolution.index = {'Attack','Accuracy'} Resolution_ind = 1When you use resolution, you don't equip sets.Resolution.index, you equip either sets.Resolution.Attack or sets.Resolution.Accuracy. Which you use depends on the value of Resolution_ind.Code:sets.Resolution.index={[1]="Attack",[2]="Accuracy"}
Suppose, for example, that Resolution_ind is 1. Then this linesimplifies to equip(sets.Resolution[sets.Resolution.index[1]]). Now sets.Resolution.index[1] is a value corresponding to the key 1 in the table sets.Resolution.index. The line simplifies toCode:equip(sets.Resolution[sets.Resolution.index[Resolution_ind]])and you equip your attack based resolution set. The benefit is that by changing the value of Resolution_ind you can change the set that equips by default when you use Resolution. If you were to do that manually you would need two macros: one to equip the attack set when using resolution, and one to equip the accuracy set when using resolution. With this, your macro can simply be /ws Resolution.Code:equip(sets.Resolution["Attack"])
@Byrth It is possible to add in your Custom Time code for brd songs, to track targets? not really interested in what song I did cast on my target... but the time remaining of the last song I did cast on it.
Ex.
I cast 1 song to my target, It creates a Custom timer with Target Name w/ the duration of the song I casted.
If I cast a second one, just delete old one and add the new one timer.
?
Tried to do something.. but.. couldn't make it to create a custom timer with the target player name.. -_-
If you don't have your Daurdabla in inventory, cycle will do nothing, and because it doesn't return the table definition, it will generate the Dummy error you noticed when trying to select a specific value. I'll adjust it so that it generates a more specific error message if the Daurdabla isn't found.
The issue is that you can't get the names of everyone hit by the song, I'm sure. I'll see what I can do.
Oh:
should be:Code:send_command('timers create "'..spell.name..'" '..dur..' down')
Code:send_command('timers create "'..spell.target.name..'" '..dur..' down')
Followup: I've updated to make it trivial to change to using the Terpander (just change info.DaurdablaInstrument and info.DaurdablaSongs in the user_setup() function). However it's only on the dev branch right now because there's still some significant differences between dev and live GearSwap.
do something like this
Code:Resolution Resolution.index={[1]="Attack",[2]="Accuracy"} Resolution_ind = 1 equip(sets.Resolution[Resolution.index[Resolution_ind]]) if command == 'Resolutionind' then if Resolution_ind == 1 then Resolution_ind = 2 elseif Resolution_ind == 2 then Resolution_ind = 1 end end
I tried changing it to
But that didn't work so I tried changing it toCode:function job_get_mode_list(field) if field == 'Daurdabla' and (player.inventory.daurdabla or player.inventory.terpander) then return options.DaurdablaModes, state.DaurdablaMode end end
and I still got the same error as before about not recognizing dummy as an option.Code:function job_get_mode_list(field) return options.DaurdablaModes, state.DaurdablaMode end