Gearswap Support Thread

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 119 120 121 ... 182 183 184
 Carbuncle.Doryll
Offline
Server: Carbuncle
Game: FFXI
user: Smacks
By Carbuncle.Doryll 2017-03-06 08:37:09
Link | Quote | Reply
 
Hello !

I want change my self_healing midcast set when i'm in a different casting mode. is it possible ? I'm using this rule working correctly :
Code
function job_post_midcast(spell, action, spellMap, eventArgs)

    if spellMap == 'Cure' and spell.target.type == 'SELF' and sets.self_healing then
        equip(sets.self_healing)
    end
    -- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
    if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
        equip(sets.buff['Divine Caress'])
    end
end


But when i change it for try to have a different self_healing set whit a different CastingMode, the rules break. I tried this, but i think i made typo errors :
Code
function job_post_midcast(spell, action, spellMap, eventArgs)

    if spellMap == 'Cure' and spell.target.type == 'SELF' and sets.self_healing and not CastingMode == 'HP' then
        equip(sets.self_healing)
    end
    -- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
    if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
        equip(sets.buff['Divine Caress'])
    end
end
 Sylph.Subadai
Offline
Server: Sylph
Game: FFXI
user: Subadai
Posts: 184
By Sylph.Subadai 2017-03-06 18:37:07
Link | Quote | Reply
 
Couple questions on send_command() vs. self_command(). I notice some luas use "send_command('gs c set treasuremode none')" and the like; is there any advantage to doing it this way, vs. "self_command('set treasuremode none")? Seems to me that self_command() is more efficient, or at least less typing.

Second, I could have sworn I saw somewhere that it was recommended to use the @ symbol at the beginning of commands, i.e. "send_command('@exec warp-ring.txt')" What's the reason to do it that way? I tried it with a couple of aliases I set up and it seems to work either with or without.
 Bismarck.Cloudstrafie
Offline
Server: Bismarck
Game: FFXI
user: cloud7886
Posts: 148
By Bismarck.Cloudstrafie 2017-03-23 23:14:04
Link | Quote | Reply
 
Hello,Im trying to figure out if its possible to use 2 items with the same name? Stikini Ring mache Earrings ect Currently its only pulling one of the items into the gear its trying use,any insight would be helpful thank you
 Odin.Lygre
Offline
Server: Odin
Game: FFXI
user: Dylaudid
Posts: 89
By Odin.Lygre 2017-03-24 01:10:06
Link | Quote | Reply
 
will it more harder
 Asura.Azagarth
Offline
Server: Asura
Game: FFXI
user: Azagarth
Posts: 1326
By Asura.Azagarth 2017-03-24 01:12:20
Link | Quote | Reply
 
how would you code for cor rolls? I am wanting to set up sets for xhits based upon 11s etc.
 Sylph.Subadai
Offline
Server: Sylph
Game: FFXI
user: Subadai
Posts: 184
By Sylph.Subadai 2017-03-24 01:44:33
Link | Quote | Reply
 
Bismarck.Cloudstrafie said: »
Hello,Im trying to figure out if its possible to use 2 items with the same name? Stikini Ring mache Earrings ect Currently its only pulling one of the items into the gear its trying use,any insight would be helpful thank you
One way to do it is put them in different bags and use something like the following:
Code
sets.midcast['Elemental Magic'] = {
     ring1={name="Shiva Ring", bag="wardrobe2"},
     ring2={name="Shiva Ring", bag="wardrobe3"} }
[+]
 Ragnarok.Fabiano
Offline
Server: Ragnarok
Game: FFXI
user: fabiano
Posts: 154
By Ragnarok.Fabiano 2017-03-25 17:47:02
Link | Quote | Reply
 
anyone knows why it changes to my standart precast/fastcast set in death mode / death idle . everytime i cast random self buffs my mp goes from 2050 to 1550 .
Offline
Posts: 5
By aesculapius 2017-04-01 00:26:58
Link | Quote | Reply
 
I have a question regarding delay. For whatever reason ring2 for every set I have only sometimes switches. Most of the time it does not and I don't get the effect of my second ring. Does anyone know what could be causing this and how I can fix it?
 Sylph.Subadai
Offline
Server: Sylph
Game: FFXI
user: Subadai
Posts: 184
By Sylph.Subadai 2017-04-05 14:26:27
Link | Quote | Reply
 
aesculapius said: »
I have a question regarding delay. For whatever reason ring2 for every set I have only sometimes switches. Most of the time it does not and I don't get the effect of my second ring. Does anyone know what could be causing this and how I can fix it?
Only thing I can think of, is maybe check to see if the rings in question are always swapped into the same slot; for ex don't put your Petrov Ring in ring1/left_ring in some places and ring2/right_ring in others. Not sure what would happen if a ring is already in ring1 when your script calls for it to swap into ring2. That's just a guess, though.
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2017-04-17 23:38:45
Link | Quote | Reply
 
I need some help. Was wondering if it's possible to have a bind where it switches to a specific casting mode. This is my current casting mode:
state.CastingMode:options('Normal','ConserveMP','MACC','MB','MB2')

I'd like a separate casting mode that only has MB and MB2, possibly more in the future for MACCMB.
Offline
By Aeyela 2017-04-18 05:17:49
Link | Quote | Reply
 
Asura.Azagarth said: »
how would you code for cor rolls? I am wanting to set up sets for xhits based upon 11s etc.

Well, buffactive[214] equals the tier of March, 1 or 2. It could be, though I'm just guessing, that buffactive[321] (Samurai Roll) may equal the number of the active roll. This works for most buffs so I see no reason why it shouldn't for rolls.

Shiva.Hiep said: »
I need some help. Was wondering if it's possible to have a bind where it switches to a specific casting mode. This is my current casting mode:
state.CastingMode:options('Normal','ConserveMP','MACC','MB','MB2')

I'd like a separate casting mode that only has MB and MB2, possibly more in the future for MACCMB.

The easiest way of controlling casting modes is using a toggle of some kind that will then be used to choose which set to use in midcast. You can make that commands into macros for easy switching. I can give you an example if it helps, but you'll find similar examples in a lot of GearSwaps (SMN, PLD, etc, for handling pet/damage modes.)
[+]
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2017-04-18 07:39:24
Link | Quote | Reply
 
Shiva.Hiep said: »
I need some help. Was wondering if it's possible to have a bind where it switches to a specific casting mode. This is my current casting mode:
state.CastingMode:options('Normal','ConserveMP','MACC','MB','MB2')

I'd like a separate casting mode that only has MB and MB2, possibly more in the future for MACCMB.

The easiest way of controlling casting modes is using a toggle of some kind that will then be used to choose which set to use in midcast. You can make that commands into macros for easy switching. I can give you an example if it helps, but you'll find similar examples in a lot of GearSwaps (SMN, PLD, etc, for handling pet/damage modes.)[/quote]

My current toggle is send_command('bind ^q gs c cycle CastingMode'). What I want if it's possible is to have separate casting mode toggles, one for Normal, ConserveMP, MACC, and a second casting mode toggle for MB, MB2, MACCMB. Thank you for your response!
 Shiva.Arislan
Offline
Server: Shiva
Game: FFXI
user: Arislan
Posts: 1052
By Shiva.Arislan 2017-04-18 08:06:44
Link | Quote | Reply
 
It's kind of messy to be integrating burst states with casting states, no?

Create a new state called BurstMode:
Code
function job_setup()
   state.BurstMode = M{['description']='Magic Burst Mode', 'MB1', 'MB2','MBMacc'}
end


Create some rules in post_midcast to detect for the current MB state, then equip corresponding MB set:
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Elemental Magic' and state.MagicBurst.value and state.BurstMode.value then
        if state.BurstMode.value == "MB2" then
            equip(sets.magic_burst.MB2)
        if state.BurstMode.value == "MBMacc" then
            equip(sets.magic_burst.MBMacc)
        else
            equip(sets.magic_burst.MB1)
        end
    end
end


You're probably going to build in some exceptions for certain spells like Impact.

Bind your new cycler:
Code
    send_command('bind ^q gs c cycle BurstMode')


Your casting modes remain independent of all this.


My preferred method is to have post_midcast read the current casting mode value to determine which MB set to equip::
Code
function user_setup()
	state.CastingMode:options('Normal', 'Seidr', 'Resistant')
end
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
	if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
		if state.CastingMode.value == "Resistant" then
			equip(sets.magic_burst.Resistant)
		else
			equip(sets.magic_burst)
		end
		if spell.english == "Impact" then
			equip(sets.midcast.Impact)
		end
	end
end


Think it's a bit more elegant w/o a separate toggle and another set of unnecessary states.
[+]
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2017-04-18 09:58:20
Link | Quote | Reply
 
Shiva.Arislan said: »
It's kind of messy to be integrating burst states with casting states, no?

Create a new state called BurstMode:
Code
function job_setup()
   state.BurstMode = M{['description']='Magic Burst Mode', 'MB1', 'MB2','MBMacc'}
end


Create some rules in post_midcast to detect for the current MB state, then equip corresponding MB set:
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Elemental Magic' and state.MagicBurst.value and state.BurstMode.value then
        if state.BurstMode.value == "MB2" then
            equip(sets.magic_burst.MB2)
        if state.BurstMode.value == "MBMacc" then
            equip(sets.magic_burst.MBMacc)
        else
            equip(sets.magic_burst.MB1)
        end
    end
end


You're probably going to build in some exceptions for certain spells like Impact.

Bind your new cycler:
Code
    send_command('bind ^q gs c cycle BurstMode')


Your casting modes remain independent of all this.


My preferred method is to have post_midcast read the current casting mode value to determine which MB set to equip::
Code
function user_setup()
	state.CastingMode:options('Normal', 'Seidr', 'Resistant')
end
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
	if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
		if state.CastingMode.value == "Resistant" then
			equip(sets.magic_burst.Resistant)
		else
			equip(sets.magic_burst)
		end
		if spell.english == "Impact" then
			equip(sets.midcast.Impact)
		end
	end
end


Think it's a bit more elegant w/o a separate toggle and another set of unnecessary states.

Just tested my GS using your preferred method and it works beautifully, thank you! Just one more question, but how would I include my MACC casting mode inside the function? I can't seem to figure it out. It's currently this:
Code
		if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
		if state.CastingMode.value == "ConserveMP" then
            equip(sets.magic_burst.ConserveMP)		
        else
            equip(sets.magic_burst)
        end


Would it be close to this?
Code
		if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
		if state.CastingMode.value == "ConserveMP" then
            equip(sets.magic_burst.ConserveMP)
		if state.CastingMode.value == "MACC" then
            equip(sets.magic_burst.MACC)		
        else
            equip(sets.magic_burst)
        end

Not sure what I had to use since or, and, elseif didn't work after equip(sets.magic_burst.ConserveMP).
 Shiva.Arislan
Offline
Server: Shiva
Game: FFXI
user: Arislan
Posts: 1052
By Shiva.Arislan 2017-04-18 16:26:37
Link | Quote | Reply
 
Just turn the if to elseif:
Code
if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
    if state.CastingMode.value == "ConserveMP" then
        equip(sets.magic_burst.ConserveMP)
    elseif state.CastingMode.value == "MACC" then
        equip(sets.magic_burst.MACC)        
    else
        equip(sets.magic_burst)
    end
end
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2017-04-18 23:21:28
Link | Quote | Reply
 
Works great as usual, thank you very much for your help, much appreciated Arislan.
 Fenrir.Dibble
Offline
Server: Fenrir
Game: FFXI
user: Dibble
Posts: 141
By Fenrir.Dibble 2017-04-19 09:49:32
Link | Quote | Reply
 
What's the T do here?
Code
T{'Idle','Resting'}:contains(new)

Versus or compared to the S here?
Code
S{'Warp','Warp II'}:contains(spell.english)

I'm assuming this was maybe covered in "Special tables" in the Lua section of the GearSwap tutorial?
 
Offline
Posts:
By 2017-04-24 13:18:29
 Undelete | Edit  | Link | Quote | Reply
 
Post deleted by User.
Offline
By Aeyela 2017-04-24 14:33:26
Link | Quote | Reply
 
Fenrir.Dibble said: »
What's the T do here?
Code
T{'Idle','Resting'}:contains(new)

Versus or compared to the S here?
Code
S{'Warp','Warp II'}:contains(spell.english)

I'm assuming this was maybe covered in "Special tables" in the Lua section of the GearSwap tutorial?

They're exactly the same thing, unless Windower is using some special implementation of Lua with functionality I'm unaware of.
 Fenrir.Caiir
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-04-24 16:34:24
Link | Quote | Reply
 
They are not exactly the same thing. However, they result in the same thing happening.

T and S are function calls that both initialize different tables (T will look something like {[1] = 'Idle', [2] = 'Resting'}, where S will look something like {['Warp'] = true, ['Warp II'] = true}) with member function contains that check if the value exists in a table in different ways.

The S{} approach should be faster technically, but in practice it probably won't matter too much.
[+]
Offline
By Aeyela 2017-04-24 16:45:22
Link | Quote | Reply
 
Interesting. When I dump S{'Warp','Warp II'} it displays the same output as using T{}: {'Warp','Warp II'}. Am I missing something there, or is Lua just compiling them to the same thing when dumping them to the log file?
 Leviathan.Vow
Offline
Server: Leviathan
Game: FFXI
user: woVow
Posts: 125
By Leviathan.Vow 2017-04-24 17:35:50
Link | Quote | Reply
 
If you're using the logger library, they have __tostring metamethods that create identical output.
[+]
Offline
By Aeyela 2017-04-25 15:18:21
Link | Quote | Reply
 
Thanks. I am using logger, and that's exactly what's going on.

I have a query of my own. Is there a way to register an event so long as the event has not already been registered? I'm using CTRL+T to equip Treasure Hunter gear and I want it to add an event that will check which TP set to equip once my TP changes. The problem is, every time I hit CTRL+T the event is registering again. After one Salvage I have 29 events registered and it's causing stuttering when my TP changes. If I mash my bind to add a lot more my FPS begins to deteriorate even when my TP is static.

Like Lua, functions in Javascript are first class objects which means we can use the reference to a function in evaluation. Is it possible to do that in GearSwap? I made a work around by having a variable somewhere that was false until the bind is first hit that sets this to true and only binds the event if it's false:

Code
	elseif command:lower() == 'th' then
		equip(sets.me.th)
		windower.add_to_chat(8,'TH Equipment ON')
		
		if not me.thRegistered then
			windower.register_event('tp change', function()
				doMeleeMode()
			end)
		end
	end


I'm not overly bothered by this (it works) but it's an anti-pattern in design and I'd like to know anyway if this is possible in Windower for future reference!
 Fenrir.Caiir
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-04-25 16:05:11
Link | Quote | Reply
 
windower.register_event() returns a number, so in line with your setup you could just do :
Code
elseif command:lower() == 'th' then
    equip(sets.me.th)
    windower.add_to_chat(8,'TH Equipment ON')
     
    if not me.thRegistered then
        me.thRegistered = windower.register_event('tp change', function()
            doMeleeMode()
        end)
    end
end


I'd probably suggest that instead, you just register the event outside of this function call and just set up a blocking variable in the event itself that you toggle with commands.
 Bismarck.Speedyjim
Offline
Server: Bismarck
Game: FFXI
user: speedyjim
Posts: 516
By Bismarck.Speedyjim 2017-04-25 18:29:31
Link | Quote | Reply
 

I can't seem to get my lua to equip my Enhancing Duration gear while Embolden is active. Code I tried is on line 442. Any help is appreciated.
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2017-04-27 18:00:57
Link | Quote | Reply
 
I need some help making some self-cure sets but not sure about the functions. Would anyone know how to make a function for self-cures and another one that works under light weather?
 Shiva.Arislan
Offline
Server: Shiva
Game: FFXI
user: Arislan
Posts: 1052
By Shiva.Arislan 2017-04-27 23:05:53
Link | Quote | Reply
 
Code
function init_gear_sets()

    sets.midcast.CureWeather = set_combine(sets.midcast.Cure, {
        main="Chatoyant Staff",
        waist="Hachirin-no-Obi",
        --etc
        })

    sets.midcast.CureSelf = set_combine(sets.midcast.Cure, 
        hands="Buremte Gloves", -- (13)
        neck="Phalaina Locket", -- 4(4)
        ring2="Asklepian Ring", -- (3)
        waist="Gishdubar Sash", -- (10)
        --etc
        })

end
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spellMap == 'Cure' and spell.target.type == 'SELF' then
        equip(sets.midcast.CureSelf)
    end
end

Code
function job_get_spell_map(spell, default_spell_map)
    if spell.action_type == 'Magic' then
        if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
            if (world.weather_element == 'Light' or world.day_element == 'Light') then
                return 'CureWeather'
            end
        end
    end
end
 Bismarck.Xurion
Offline
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 694
By Bismarck.Xurion 2017-04-28 03:32:17
Link | Quote | Reply
 
Is there a way to tell GS to unequip an item? Something like:
Code
    sets.no_gear = {
        head = "",
        neck = "",
        ear1 = "",
        ear2 = "",
        body = "",
        hands = "",
        ring1 = "",
        ring2 = "",
        back = "",
        waist = "",
        legs = "",
        feet = ""
    }


I tried the above but nope.
 Sylph.Subadai
Offline
Server: Sylph
Game: FFXI
user: Subadai
Posts: 184
By Sylph.Subadai 2017-04-28 04:43:59
Link | Quote | Reply
 
Bismarck.Xurion said: »
Is there a way to tell GS to unequip an item?

I think this might work (you can also use the command //gs equip naked but that will unequip everything including weapon):
Code
    sets.no_gear = {
        head = empty,
        neck = empty,
        ear1 = empty,
        ear2 = empty,
        body = empty,
        hands = empty,
        ring1 = empty,
        ring2 = empty,
        back = empty,
        waist = empty,
        legs = empty,
        feet = empty
    }
First Page 2 3 ... 119 120 121 ... 182 183 184
Log in to post.