Gearswap Support Thread

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 96 97 98 ... 181 182 183
Offline
Posts: 5188
By Faelar 2016-04-14 11:51:23
Link | Quote | Reply
 
Ragnarok.Flippant said: »
spell.prefix will return the full prefix to the action, like 'magic' instead of 'ma'.

It will also never be 'Cur' or 'Cure' because those are in the name of the spell, not the prefix (the prefix for these is still 'magic'). Instead, you want to know if the name of the spell contains those letters. One option is to use the find method.
Code
function midcast(spell)
    if string.find(spell.english,"Cur") and spell.english ~= "Cursna" then
        -- Magic Usage
        equip(sets.Cure)
    end
end

Note that you don't also have to look for "Cure" because "Cur" is a part of "Cure" already. The second part, "spell.english ~= "Cursna"" means if the name of the spell is NOT Cursna, since you don't want to equip your cure sets for that. Alternatively, you can search for "Cure" or "Cura", which would include cures, curas, and curagas, and exclude Cursna.

Also, you have no closing brace for your sets.Idle set.

I'm completely new to this xD
I thought it would cover any spell with Cur in it, such as Cure, Cura, and Curaga. I didn't think of Cursna. I could just do Cure and Curaga and it'll cover all of those, right?

Something like this:
Code
function midcast(spell)
    if string.find(spell.english,"Cure" or "Curaga" or "Cura") then
        -- Magic Usage
        equip(sets.Cure)
    end
end
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-14 12:09:56
Link | Quote | Reply
 
You can, but the syntax isn't correct. Unfortunately, you'd have to write it out:
Code
if string.find(spell.english,"Cure") or string.find(spell.english,"Cura") then

Again, you don't need to look for "Curaga" because "Cura" is already in there.
[+]
Offline
Posts: 5188
By Faelar 2016-04-14 12:12:32
Link | Quote | Reply
 
Ragnarok.Flippant said: »
You can, but the syntax isn't correct. Unfortunately, you'd have to write it out:
Code
if string.find(spell.english,"Cure") or string.find(spell.english,"Cura") then

Again, you don't need to look for "Curaga" because "Cura" is already in there.

Ah, right. Again, didn't think of that.

So for a VERY basic file, this is what I have (with yours and Bryth's help):

Look good? Will it work?
 Asura.Calatilla
Offline
Server: Asura
Game: FFXI
user: Calatilla
Posts: 2507
By Asura.Calatilla 2016-04-14 12:38:37
Link | Quote | Reply
 
Wow, you got a wally turban in fastcast, brings back memories lol
Offline
Posts: 5188
By Faelar 2016-04-14 12:39:58
Link | Quote | Reply
 
Asura.Calatilla said: »
Wow, you got a wally turban in fastcast, brings back memories lol

I mentioned it was very old gear, just returned to the game after 5 years.

Where do I place the lua file for it to be recognized in-game?
 Asura.Calatilla
Offline
Server: Asura
Game: FFXI
user: Calatilla
Posts: 2507
By Asura.Calatilla 2016-04-14 12:43:53
Link | Quote | Reply
 
I wasn't picking on you lol, just haven't seem one of those in awhile. Also I have no idea, I'm as lost as you where gearswap is concerned.
[+]
Offline
Posts: 5188
By Faelar 2016-04-14 12:58:48
Link | Quote | Reply
 
I got it working! Idle works, and Cure works (can't tell if the pre-cast set goes on them or not), and Pre-cast doesnt work on all my other spells. Seems to be my only problem here.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-14 13:34:03
Link | Quote | Reply
 
The precast line needs to be
Quote:
if spell.prefix == '/magic' then

Also, to check gear, you can type "//gs showswaps" in game and it will tell you what is swapping out.
[+]
Offline
Posts: 5188
By Faelar 2016-04-14 13:37:48
Link | Quote | Reply
 
Ragnarok.Flippant said: »
The precast line needs to be
Quote:
if spell.prefix == '/magic' then

Also, to check gear, you can type "//gs showswaps" in game and it will tell you what is swapping out.

Thanks!
Is there a way to force update the lua while in-game?

And it's not doing the pre-cast set for Cures. :/
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-14 16:36:53
Link | Quote | Reply
 
"//gs r" will reload your job lua file.

If it's using the precast for any other spell, it should be using them for cures too (assuming you haven't added more rules). Are you using //gs showswaps to see if you are equipping your precast gear? Because, unlike Spellcast, you really won't get the chance to see it visually from the equipment menu.
[+]
Offline
Posts: 5188
By Faelar 2016-04-14 18:28:50
Link | Quote | Reply
 
Ragnarok.Flippant said: »
"//gs r" will reload your job lua file.

If it's using the precast for any other spell, it should be using them for cures too (assuming you haven't added more rules). Are you using //gs showswaps to see if you are equipping your precast gear? Because, unlike Spellcast, you really won't get the chance to see it visually from the equipment menu.

Yeah, thats how I noticed it didnt put precast on during cures.

It isnt putting precast on for anything else either. Its just putting on curr set and switching to idle after.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-14 20:15:37
Link | Quote | Reply
 
Did you change the '/ma' to '/magic'? Also, if you're ever having a problem with a variable, or testing your statements, you can use the add_to_chat function to find out what's happening. For example,
Code
function precast(spell)
	add_to_chat(140,spell.prefix)
    if spell.prefix == '/magic' then		
        -- Magic precast
		add_to_chat(140,'equipping magic precast')
        equip(sets.FastCast)
    end
end


The first one will print the prefix to your chat screen at the beginning of every action you take. The second one will only print if you have met the condition.
[+]
Offline
Posts: 5188
By Faelar 2016-04-14 23:16:18
Link | Quote | Reply
 
Ragnarok.Flippant said: »
Did you change the '/ma' to '/magic'? Also, if you're ever having a problem with a variable, or testing your statements, you can use the add_to_chat function to find out what's happening. For example,
Code
function precast(spell)
	add_to_chat(140,spell.prefix)
    if spell.prefix == '/magic' then		
        -- Magic precast
		add_to_chat(140,'equipping magic precast')
        equip(sets.FastCast)
    end
end


The first one will print the prefix to your chat screen at the beginning of every action you take. The second one will only print if you have met the condition.

Works perfectly now, thank you!

Now to adapt this to DD jobs, to equip a TP set when engaged, WS set, and an Idle set when disengaged....
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2016-04-15 08:42:18
Link | Quote | Reply
 
Has anyone had this problem lately? Since the update, I've been having issues using items like remedy when I use a keybind for it. It usually works the first time I use the bind, but then doesn't work for 1-2 minutes.
 Lakshmi.Byrth
VIP
Offline
Server: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6137
By Lakshmi.Byrth 2016-04-15 08:48:41
Link | Quote | Reply
 
This is caused by a problem in hook. There's a fixed version of hook on -dev, but we're testing it to make sure nothing else broke.
[+]
 Cerberus.Shadowmeld
Offline
Server: Cerberus
Game: FFXI
Posts: 1673
By Cerberus.Shadowmeld 2016-04-15 09:53:08
Link | Quote | Reply
 
Faelar said: »
Ragnarok.Flippant said: »
Did you change the '/ma' to '/magic'? Also, if you're ever having a problem with a variable, or testing your statements, you can use the add_to_chat function to find out what's happening. For example,
Code
function precast(spell)
	add_to_chat(140,spell.prefix)
    if spell.prefix == '/magic' then		
        -- Magic precast
		add_to_chat(140,'equipping magic precast')
        equip(sets.FastCast)
    end
end


The first one will print the prefix to your chat screen at the beginning of every action you take. The second one will only print if you have met the condition.

Works perfectly now, thank you!

Now to adapt this to DD jobs, to equip a TP set when engaged, WS set, and an Idle set when disengaged....

I do this myself by instead of naming my engaged sets TP, naming them Engaged.

minimalist example is in aftercast I just have it do this:
Code
-- In get sets
sets.Engaged = {"gear"}
sets.Idle = {"gear"}
sets.Resting = {"gear"}

function aftercast(spell)
  equip(sets[player.status])
end

function change_status(new, old)
  equip(sets[new])
end
 Carbuncle.Daddykal
Offline
Server: Carbuncle
Game: FFXI
Posts: 2
By Carbuncle.Daddykal 2016-04-15 16:51:27
Link | Quote | Reply
 
Ok, i'm attempting to add to the mote lua file for sch. I have tried many different things, and i'm afraid i have some left over unusable code still in place. It will not crash the script but is not being used currently. I'll add the script below, but first this is my goal. I want to eventually make a popup similar to the one that shows recast of all abilities. However, i only want it to show my Strategem count in a box. I will settle for a macro that shows it in my chat log atm though lol. Essentially, i would like something like this.
Code
Send_command('bind ^s **activate Post_Strats_to_Chat()')

Where the function is something like this.
Code
local strat = true
function Post_Strats_to_Chat()
if strat == true then 
add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
strat = false
end
end


I can use /recast Rapture or something to accomplish the same thing really. However, my purpose in the long run, is to understand how to BIND a self command or function. And Eventually create a script or addon that allows me to have a draggable box showing little information that i would like to reference quickly. (Acc, Macc, DPS, Strategem count, Enemies killed or something like that) But i would like to be able to toggle the function on and off with a keybind so starting simple. Figuring out how to use keybinds properly.

So, Here is an excerpt of some of the code i'm using.
Code
-- General handling of strategems in an Arts-agnostic way.
-- Format: gs c scholar <strategem>

function handle_strategems(cmdParams)
    if not cmdParams[2] then
        add_to_chat(123,'Error: No strategem command given.')
        return
    end
 
    local currentStrats = get_current_strategem_count()
    local newStratCount = currentStrats - 1
    if currentStrats > 0 then
        add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
    else
        add_to_chat(122, '***Out of strategems! Canceling...***')
        return
    end
 
    local strategem = cmdParams[2]:lower()
 
    if strategem == 'light' then
        if buffactive['light arts'] then
            send_command('input /ja "Addendum: White" <me>')
        elseif buffactive['addendum: white'] then
            add_to_chat(122,'Error: Addendum: White is already active.')
        else
            send_command('input /ja "Light Arts" <me>')
        end
    elseif strategem == 'dark' then
        if buffactive['dark arts'] then
            send_command('input /ja "Addendum: Black" <me>')
        elseif buffactive['addendum: black'] then
            add_to_chat(122,'Error: Addendum: Black is already active.')
        else
            send_command('input /ja "Dark Arts" <me>')
        end
    elseif buffactive['light arts'] or buffactive['addendum: white'] then
        if strategem == 'cost' then
            send_command('@input /ja Penury <me>')
        elseif strategem == 'speed' then
            send_command('@input /ja Celerity <me>')
        elseif strategem == 'aoe' then
            send_command('@input /ja Accession <me>')
        elseif strategem == 'power' then
            send_command('@input /ja Rapture <me>')
        elseif strategem == 'duration' then
            send_command('@input /ja Perpetuance <me>')
        elseif strategem == 'accuracy' then
            send_command('@input /ja Altruism <me>')
        elseif strategem == 'enmity' then
            send_command('@input /ja Tranquility <me>')
        elseif strategem == 'skillchain' then
            add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
        elseif strategem == 'addendum' then
            send_command('@input /ja "Addendum: White" <me>')
        else
            add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
        end
    elseif buffactive['dark arts']  or buffactive['addendum: black'] then
        if strategem == 'cost' then
            send_command('@input /ja Parsimony <me>')
        elseif strategem == 'speed' then
            send_command('@input /ja Alacrity <me>')
        elseif strategem == 'aoe' then
            send_command('@input /ja Manifestation <me>')
        elseif strategem == 'power' then
            send_command('@input /ja Ebullience <me>')
        elseif strategem == 'duration' then
            add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
        elseif strategem == 'accuracy' then
            send_command('@input /ja Focalization <me>')
        elseif strategem == 'enmity' then
            send_command('@input /ja Equanimity <me>')
        elseif strategem == 'skillchain' then
            send_command('@input /ja Immanence <me>')
        elseif strategem == 'addendum' then
            send_command('@input /ja "Addendum: Black" <me>')
        else
            add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
        end
    else
        add_to_chat(123,'No arts has been activated yet.')
    end
end
-- Gets the current number of available strategems based on the recast remaining
-- and the level of the sch.
function get_current_strategem_count()
    -- returns recast in seconds.
    local allRecasts = windower.ffxi.get_ability_recasts()
    local stratsRecast = allRecasts[231]

    local maxStrategems = (player.main_job_level + 10) / 20

    local fullRechargeTime = 4*60

    local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)

    return currentCharges
end 


And the full code.
Lastly... since i started tinkering... i can no longer load my default macro book.... I didn't change it until i had the problem... now i've tinkered a bit, but put it back as i remember it and still not loading, but no errors.

EDIT: I did not create this code, i have copy / pasted and added new from many different sources, primarily mote's.
Offline
Posts: 5188
By Faelar 2016-04-15 21:18:49
Link | Quote | Reply
 
So would it be like:
Code
function change_status
if player.status=='Engaged' then
       equip(sets.TP)
end


function change_status
if player.status=='Disengaged then
       equip(sets.Idle)
end



Not sure how to setup the most basic Engage/WS/Disengage lua for a DD. I get the syntaxs for spells and sets now, but statuses and weapons skills/job abilities I haven't figured out yet.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-15 21:55:56
Link | Quote | Reply
 
You can only have one function of the same name. If you were to list both, the last in the list would overwrite the previous.

Further, a function must always have parentheses after the name, even if you don't want or expect any arguments (the variables that are sent to a function).

Also, you need to make sure to end all of your strings (anything that goes inside single or double quotes). You also need an "end" to finish each and every function and if statement.

Lastly, for GS event functions, you must use precisely the name of the function that Gearswap has mapped to game events. In this case, the name of the function should be status_change, which is sent two arguments: new (the current status) and old (the previous status). You don't have to use these if you don't want to.
Code
function status_change(new,old)
	if player.status=='Engaged' then
		   equip(sets.TP)
	elseif player.status=='Idle' then
		   equip(sets.Idle)
	end
end

"Disengaged" is not a possible status; you're looking for "Idle". As far as I know, there's not any complete documentation of the possible values for GS variables, but remember that you can always use add_to_chat to test a variable.

If you are determined to write your own file from scratch, it may be better for you to study basic programming and Lua first. The one Byrth posted is just about as bare as a person should have if they care about efficiency, so I'd recommend that you learn enough to be able to read and understand it.
[+]
Offline
Posts: 5188
By Faelar 2016-04-15 22:09:26
Link | Quote | Reply
 
Thank you SO much for your help!
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-15 22:22:55
Link | Quote | Reply
 
Carbuncle.Daddykal said: »
Ok, i'm attempting to add to the mote lua file for sch. I have tried many different things, and i'm afraid i have some left over unusable code still in place. It will not crash the script but is not being used currently. I'll add the script below, but first this is my goal. I want to eventually make a popup similar to the one that shows recast of all abilities. However, i only want it to show my Strategem count in a box. I will settle for a macro that shows it in my chat log atm though lol. Essentially, i would like something like this.
Code
Send_command('bind ^s **activate Post_Strats_to_Chat()')

Where the function is something like this.
Code
local strat = true
function Post_Strats_to_Chat()
if strat == true then 
add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
strat = false
end
end


I can use /recast Rapture or something to accomplish the same thing really. However, my purpose in the long run, is to understand how to BIND a self command or function. And Eventually create a script or addon that allows me to have a draggable box showing little information that i would like to reference quickly. (Acc, Macc, DPS, Strategem count, Enemies killed or something like that) But i would like to be able to toggle the function on and off with a keybind so starting simple. Figuring out how to use keybinds properly.

So, Here is an excerpt of some of the code i'm using.
Code
-- General handling of strategems in an Arts-agnostic way.
-- Format: gs c scholar <strategem>

function handle_strategems(cmdParams)
    if not cmdParams[2] then
        add_to_chat(123,'Error: No strategem command given.')
        return
    end
 
    local currentStrats = get_current_strategem_count()
    local newStratCount = currentStrats - 1
    if currentStrats > 0 then
        add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
    else
        add_to_chat(122, '***Out of strategems! Canceling...***')
        return
    end
 
    local strategem = cmdParams[2]:lower()
 
    if strategem == 'light' then
        if buffactive['light arts'] then
            send_command('input /ja "Addendum: White" <me>')
        elseif buffactive['addendum: white'] then
            add_to_chat(122,'Error: Addendum: White is already active.')
        else
            send_command('input /ja "Light Arts" <me>')
        end
    elseif strategem == 'dark' then
        if buffactive['dark arts'] then
            send_command('input /ja "Addendum: Black" <me>')
        elseif buffactive['addendum: black'] then
            add_to_chat(122,'Error: Addendum: Black is already active.')
        else
            send_command('input /ja "Dark Arts" <me>')
        end
    elseif buffactive['light arts'] or buffactive['addendum: white'] then
        if strategem == 'cost' then
            send_command('@input /ja Penury <me>')
        elseif strategem == 'speed' then
            send_command('@input /ja Celerity <me>')
        elseif strategem == 'aoe' then
            send_command('@input /ja Accession <me>')
        elseif strategem == 'power' then
            send_command('@input /ja Rapture <me>')
        elseif strategem == 'duration' then
            send_command('@input /ja Perpetuance <me>')
        elseif strategem == 'accuracy' then
            send_command('@input /ja Altruism <me>')
        elseif strategem == 'enmity' then
            send_command('@input /ja Tranquility <me>')
        elseif strategem == 'skillchain' then
            add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
        elseif strategem == 'addendum' then
            send_command('@input /ja "Addendum: White" <me>')
        else
            add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
        end
    elseif buffactive['dark arts']  or buffactive['addendum: black'] then
        if strategem == 'cost' then
            send_command('@input /ja Parsimony <me>')
        elseif strategem == 'speed' then
            send_command('@input /ja Alacrity <me>')
        elseif strategem == 'aoe' then
            send_command('@input /ja Manifestation <me>')
        elseif strategem == 'power' then
            send_command('@input /ja Ebullience <me>')
        elseif strategem == 'duration' then
            add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
        elseif strategem == 'accuracy' then
            send_command('@input /ja Focalization <me>')
        elseif strategem == 'enmity' then
            send_command('@input /ja Equanimity <me>')
        elseif strategem == 'skillchain' then
            send_command('@input /ja Immanence <me>')
        elseif strategem == 'addendum' then
            send_command('@input /ja "Addendum: Black" <me>')
        else
            add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
        end
    else
        add_to_chat(123,'No arts has been activated yet.')
    end
end
-- Gets the current number of available strategems based on the recast remaining
-- and the level of the sch.
function get_current_strategem_count()
    -- returns recast in seconds.
    local allRecasts = windower.ffxi.get_ability_recasts()
    local stratsRecast = allRecasts[231]

    local maxStrategems = (player.main_job_level + 10) / 20

    local fullRechargeTime = 4*60

    local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)

    return currentCharges
end 


Lastly... since i started tinkering... i can no longer load my default macro book.... I didn't change it until i had the problem... now i've tinkered a bit, but put it back as i remember it and still not loading, but no errors.

EDIT: I did not create this code, i have copy / pasted and added new from many different sources, primarily mote's.

Not sure if I understood 100%, but let's start with the bind and chat command:

You can't bind a function. The bind will be sent to the Windower console, so you want to write some sort of console command. To give you an idea, whenever you type '//' in the chat, that's actually sending the rest of the string to the console. So what you want to bind is 'gs c someCommandName' and then pick up that command inside of the self_command() function (in the case of Mote's files, job_self_command()).

Also, your function won't work. The variable "newStratCount" is a local variable inside of the handle_strategems() function. This means that it only exists within that function.

But, the get_current_strategem_count() function returns exactly what you're looking for. So, to print your current count to chat, it should be something like this:
Code
function job_self_command(commandArgs, eventArgs)
	if commandArgs[1]=='someCommandName' then
		add_to_chat(122, '***Current Charges Available: ['..get_current_strategem_count()..']***')
	end
end


Edit: I forgot to ask, but I'm not sure what the "strat" variable you put there is for. As it is, it just makes it so that you can only use that function once per load.
Offline
Posts: 11
By floydtrey1 2016-04-17 00:48:08
Link | Quote | Reply
 
Got it working!! Thank you so much :) I understand a bit more about how to start working on my own now instead of mooching off others haha!
So i added this code in the job_self_command portion.
Code
function job_self_command(cmdParams, commandArgs, eventArgs)
    if cmdParams[1]:lower() == 'scholar' then
        handle_strategems(cmdParams)
        eventArgs.handled = true
    end
	 if cmdParams[1]=='stratcount' then
		local stratty = get_current_strategem_count()
        add_to_chat(122, 'There are currently -- ['..stratty..']  -- Strategems available!')
		end
end

I had to change commandArgs to cmdParams but that was really the only variation from what you said.

I used the same format u mention above to create the bind:
Code
send_command('bind ^q gs c stratcount')
Placed in user_setup, and placed
Code
send_command('bind ^s gs c stratcount')
in Job setup to determine which it needed to be in. At first it didn't want to work... i tweaked it like 5 different ways and finally ended up with a working portion. not sure where the error was as i changed quite a bit before testing again.
HOWEVER now i seem to have made another error lol. I figured it out and fixed it already. Not sure how, but i copy'd
Code
select_default_macro_book()
and had it in my SCH_gear.lua file. Thus creating an error saying it was nil. once i deleted it. it removed the error. Now i just have to figure out how to make it load the proper book.
Full SCH.lua below.
Will add the Gear file in 2nd post... reached limit with this one ... I talk a lot?
Offline
Posts: 11
By floydtrey1 2016-04-17 00:53:31
Link | Quote | Reply
 
SCH_gear.lua file below.
I dont do much weapon swapping due to loss of TP for Mykr.
Also I left a bunch of gear that i dont have in place. If i have no gear to replace it with. it will do nothing if the gear being called isn't found :).

With this setup I can MB darkness on apex crabs for an average of 35-40k. Blizzard5. Earthsday.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-04-17 00:58:22
Link | Quote | Reply
 
Sounds like you were trying to call the function before it existed, which is a common mistake when you're working with include files.

Do you mean to say book 1 set 10 is not the correct macro set you want to load?

Edit: Nevermind, I see that you're overwriting the function that is calling it.

Try copying the macro function into your gear file.
Offline
Posts: 15
By mrpresident 2016-04-22 13:57:39
Link | Quote | Reply
 
Hey guys, looking for help with some targeting issues I'm having with some key binds. Martel has been my go-to for help on everything gear swap related, but I'm worried I might be exhausting him with all my questions lately so I thought I would give him a break and post this one here haha.

Basically, I'm using the "Send" add-on in some key binds to control my dual box from my main. I can get everything to work with <stnpc> & <stpc> but would really like to use <stpt> and <stal> for my cure and buff macros. I'm currently using some self-commands to do this, here is basically what I am using now that does work:
Code
send_command('bind F1 gs c DBcast1')
DBspell_1 = "Cure IV"
dualBox = "" --My dual-box char. name here

function DB_command(command)
	if command == 'DBcast_clear' then
		enter_remapped = False
		send_command('unbind enter')
		send_command('unbind escape')
		add_to_chat(123,'Canceled Dual-Box command')
	elseif command == 'DBcast1' then
		send_command('input /ta <stpc>')
		current_spell = DBspell_1
		enter_remapped = True
		send_command('bind enter gs c DBcast_ex')
		send_command('bind escape gs c DBcast_clear')
	elseif command == 'DBcast_ex' then
		send_command('send '..dualBox..' '..current_spell..' '..player.subtarget.id)
		enter_remapped = False
		send_command('unbind enter')
		send_command('unbind escape')
	end


Ok so, this works in 2 parts; First I initiate the target selection, set the spell I want to cast, set one key bind on "enter" to execute the command, and one to "escape" back out or cancel. When I use the execute key bind, it sends the command to my dual-box and then clears the temporary key binds.

When I try to use this with <stpt> I have to change the target in the send_command to "player.last_subtarget.id" because of the way the sub-target gets registered. But the problem is, with <stpt> the sub-target doesn't get registered until you hit "enter" or select the name from the party list. Since I am binding "enter" to execute the command, the sub target never gets registered and the spell is cast on the wrong person. So I need a way to register the sub-target in-between these two steps, if I could have "enter" function normally, but then also send the command to my dual-box after it would work, but I'm not sure how to do it. I've done some other testing, but in a nut shell, this is where I am at.

If there is an entirely new approach that works, I am completely open to that. Any and all help is welcome and appreciated. Thanks guys
Offline
Posts: 18
By Trashboat 2016-04-23 09:12:46
Link | Quote | Reply
 
Code
windower.register_event('incoming text',function(original)
	if string.find(original,'Trashboat defeats Orthrus Seether') then
		send_command('input /p boop')
	end
end)


Anyway I can get something like this to work with battlemod? Works fine without but for some reason it doesn't read battlemods filters correctly.
 Asura.Ramsy
Offline
Server: Asura
Game: FFXI
user: Ramsy
Posts: 281
By Asura.Ramsy 2016-04-25 00:21:40
Link | Quote | Reply
 
Wondering if anyone could give me a step by step guide to setting up gear swap? I've spent the last 2 hours trying to set it up and all that shows when I try to load it is file name can't be found. Pretty sure I must be missing/doing something wrong :(
Offline
Posts: 5
By lurchingbushpig 2016-04-25 08:50:26
Link | Quote | Reply
 
Asura.Ramsy said: »
Wondering if anyone could give me a step by step guide to setting up gear swap? I've spent the last 2 hours trying to set it up and all that shows when I try to load it is file name can't be found. Pretty sure I must be missing/doing something wrong :(

Ramsy, I'm pretty sure you just have to change the file type. "Save as" .txt file. I had that same issue and it took me HOURS to figure that notepad++ was just saving the file as a default file type that Gearswap doesn't like.
 Lakshmi.Byrth
VIP
Offline
Server: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6137
By Lakshmi.Byrth 2016-04-25 12:11:32
Link | Quote | Reply
 
You want to "Save as..." Lua.
First Page 2 3 ... 96 97 98 ... 181 182 183
Log in to post.