RUN Lua

Eorzea Time
 
 
 
Langues: JP EN FR DE
users online
Forum » FFXI » Jobs » Rune Fencer » RUN lua
RUN lua
First Page 2
 Quetzalcoatl.Guthrie
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Lebeau
Posts: 80
By Quetzalcoatl.Guthrie 2014-09-06 01:11:26
Link | Citer | R
 
does anyone have a working Rune Fencer .lua that works off of Mote's includes etc.?

Thanks in advance!
 Asura.Vafruvant
Offline
Serveur: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2014-09-06 01:30:08
Link | Citer | R
 
I just started formulating an interesting tidbit of code you might be interested in. I'm consulting the community on fine-tuning it in the Gearswap Support Thread, so keep an eye out there for it. It automatically re-equips runes after expending them. :)
 Quetzalcoatl.Guthrie
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Lebeau
Posts: 80
By Quetzalcoatl.Guthrie 2014-09-06 01:36:03
Link | Citer | R
 
I will! I had one that looked promising and it just keeps coming up with errors. Every time I fix one three more pop-up :(.

I appreciate the info!
 Odin.Quixacotl
Offline
Serveur: Odin
Game: FFXI
user: Quixacotl
Posts: 170
By Odin.Quixacotl 2014-09-10 09:22:25
Link | Citer | R
 
Obviously this lua isn't based on Motes but hey it works... and for me it does everything I can ask for. I'm sure you can find something here that you can incorporate into his templates and anyone is welcome to edit however way that suits them.

Nothing at all against Motes I think he's a fricken genius. I'm just a firm believer in keeping things simple and I abhor keybinds and wince at sidecars. But that's me.

http://pastebin.com/vNpX7Wus
 Asura.Vafruvant
Offline
Serveur: Asura
Game: FFXI
user: Vafruvant
Posts: 363
By Asura.Vafruvant 2014-09-17 05:10:25
Link | Citer | R
 
If you opt to use a Mote lua for RUN, I have a couple pieces of code that you might find useful. I imagine it should work with a user-created one as well, but I cannot say for sure since I use a modified Mote file. Also, on the subject of keybinds and sidecars, two things. A: keybinds can be cured by simply making a macro commanding GS to set your mode (e.g. Changing your Offense Mode to Acc: /console gs c set OffenseMode Acc) B: sidecars are merely an optional thing to help make updates easier. I never use sidecars and merely tweak the provided .luas to my own wants/needs. I add some functions, remove others. The idea of a sidecar is just using his file exactly as-is and having a separate file to instruct what gear to use.

On topic, however, some useful functions:

Automated rune replacement (duration, Lunge/Swipe, etc) while outside of a city:
Code
function job_buff_change(buff, gain)
	info.max_runes = {['PLD']=2}

    if runes:contains(buff) then
		if not areas.Cities:contains(world.area) then
			if not buffactive[buff] or buffactive[buff] < info.max_runes[player.main_job] then
				local delay = gain and 5.1 or 1.1
				send_command('wait ' .. tostring(delay) .. ';input /ja "' .. buff .. '" <me>')
			end
		end
    end
end
The thing you have to be wary with here is that once you start it, it will not stop until you zone into a city. Even knowing this, however, it is a nice tool to use when you are constantly losing runes and need to replace them right away. Big thanks to Mote on this one.

Next up is an automatic downgrade from Lunge -> Swipe when your Lunge is on cooldown.
Code
function job_precast(spell, action, spellMap, eventArgs)
	if spell.english == 'Lunge' then
		local abil_recasts = windower.ffxi.get_ability_recasts()
		if abil_recasts[spell.recast_id] > 0 then
			send_command('input /jobability "Swipe" <t>')
			add_to_chat(122, '***Lunge Aborted: Timer on Cooldown -- Downgrading to Swipe.***')
			eventArgs.cancel = true
			return
		end
	end
end

This last one is something I just modified today, and while it appears fully functional, I haven't totally tested it yet to be sure. It's a multi-part function (based off Mote's COR rolls function) that displays rune info in your personal chat log (damage type, resistance). First part:
Code
function job_setup()
	define_rune_info()
end
This references this part:
Code
function define_rune_info()
	rune_info = {
		["Ignis"]	= {damage="Fire", resistance="Ice"},
		["Gelus"]	= {damage="Ice", resistance="Wind"},
		["Flabra"]	= {damage="Wind", resistance="Earth"},
		["Tellus"]	= {damage="Earth", resistance="Lightning"},
		["Sulpor"]	= {damage="Lightning", resistance="Water"},
		["Unda"]	= {damage="Water", resistance="Fire"},
		["Lux"]		= {damage="Light", resistance="Darkness"},
		["Tenebrae"]= {damage="Darkness", resistance="Light"},
	}
end
which leads into:
Code
function display_rune_info(spell)
	runeinfo = rune_info[spell.english]
	if runeinfo then
		add_to_chat(122, '***'..spell.english..' provides '..runeinfo.damage..'-based damage while offering '..runeinfo.resistance..' resistance.***')
	end
end
which is ultimately displayed with:
Code
function job_aftercast(spell, action, spellMap, eventArgs)
	if spell.type == 'Rune' and not spell.interrupted then
		display_rune_info(spell)
	end
end
I almost exclusively use RUN as a sub on PLD (thus why my info.max_runes only has PLD listed), but I love making the most of it when I can. I hope these help either one or both of you, if you have wanted something like this!
 Lakshmi.Saevel
Offline
Serveur: Lakshmi
Game: FFXI
Posts: 2228
By Lakshmi.Saevel 2014-09-17 05:57:49
Link | Citer | R
 
Here is a fairly straight forward GS that will do pretty much everything you need it to do.

It's self contained, easy to edit, has feedback to let you know it's working and is straight forward. I made it from Bryth's BLU gearswap after heavy editing and simplification. Anyone should be able to figure out it's logic without needing a class in coding.
 Sylph.Jeanpaul
MSPaint Champion
Offline
Serveur: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-09-17 17:24:34
Link | Citer | R
 
Mine looks just like Saevel's, I too used Bryth's BLU lua as a template. I prefer the self-contained stuff too. I did add extra parts for if I get petrified/terror'd/stunned then it automatically puts on my PDT gear, and another part for putting on a Frenzy Sallet if I'm slept.

I also added a set for Lockstyle, and I can just press Alt+Z to equip and lockstyle that set.
 Quetzalcoatl.Guthrie
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Lebeau
Posts: 80
By Quetzalcoatl.Guthrie 2014-09-27 20:21:36
Link | Citer | R
 
Thanks for all the inputs! I think I made a rather decent one that does all I really need it to do outside of what Jeanpaul just mentioned he did.

What would be the coding to make it equip sets depending on a debuff you have on you?

As always, thanks in advance!
 Sylph.Jeanpaul
MSPaint Champion
Offline
Serveur: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-09-28 00:01:02
Link | Citer | R
 
This is part of what I have:
Code
function buff_change(buff,gain)
        if (buff == "sleep" and gain) and player.hp > 100 and player.status == "Engaged" then 
                equip({head="Frenzy Sallet"})
				if buffactive.stoneskin then
					send_command('cancel Stoneskin') 
				end
        end
		if (buff == "terror" or buff == "petrification" or buff == "stun") and gain then
			equip(sets.TP.DT)
		end
end

The first part tells it to equip the Frenzy Sallet if I'm slept, engaged, and above 100 HP (so it doesn't kill me), as well as cancelling Stoneskin in case I have it on. The second part makes it so I'll automatically equip my PDT gear if I'm hit with Stun/Terror/Petrify.

You can also add this to the end of your precast set:
Code
		if buffactive.terror or buffactive.petrification or buffactive.stun then
			equip(sets.TP.DT)
		end

This makes it so if you're hit with any of those same statuses, it will know to equip the PDT gear instead of say, your precast gear cuz you're spamming Utsusemi or something while waiting for Stun to wear off. When the Stun wears off, it'd go back to using your precast gear since you can actually cast Utsusemi now.

I did add other little things in there too though, but they tend to reference my sets so I didn't include them.
 Bismarck.Inference
Offline
Serveur: Bismarck
Game: FFXI
user: Inference
Posts: 417
By Bismarck.Inference 2014-09-28 00:12:54
Link | Citer | R
 
To explain a bit in detail-

function buff_change(buff,gain) is triggered everytime your buff bar changes, buff represents the name of the buff and gain is a boolean(true or false) which returns true if the buff was gained or false if the buff/debuff was lost/removed. With this in mind you could add something like this to Jeanpaul's code:
Code
if buff=="Sleep" and not gain then
   status_change(player.status)
end

which paired with his Frenzy Sallet rule, should return him to his proper TP set automatically after the first tick wakes him up(assuming relevant TP information is handled by status_change which it almost always is).
[+]
 Sylph.Jeanpaul
MSPaint Champion
Offline
Serveur: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-09-28 00:23:03
Link | Citer | R
 
Bismarck.Inference said: »
To explain a bit in detail-

function buff_change(buff,gain) is triggered everytime your buff bar changes, buff represents the name of the buff and gain is a boolean(true or false) which returns true if the buff was gained or false if the buff/debuff was lost/removed. With this in mind you could add something like this to Jeanpaul's code:
Code
if buff="Sleep" and not gain then
   status_change(player.status)
end

which paired with his Frenzy Sallet rule, should return him to his proper TP set automatically after the first tick wakes him up(assuming relevant TP information is handled by status_change which it almost always is).
Been meaning to figure that aspect of it out for a while now, thanks for giving me the proper code!
Offline
Posts: 34
By Raesvelg 2014-10-04 15:06:15
Link | Citer | R
 
Oddly enough Mote now has a working RUN lua that works off of his includes.
 Phoenix.Skyfire
Offline
Serveur: Phoenix
Game: FFXI
user: nightkidz
Posts: 116
By Phoenix.Skyfire 2014-10-24 10:39:44
Link | Citer | R
 
While this has probably been asked before, I was wondering if anyone has Rune toggle for GS. I have been using a spellcast to toggle runes previously while using GS for my gear, but last night the spellcast kept failing. So I was hoping someone had a working GS option.

This is the spellcast:
 Sylph.Jeanpaul
MSPaint Champion
Offline
Serveur: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-10-24 14:25:39
Link | Citer | R
 
I guess it depends how you want to change between runes. You could cycle through them with a toggle button, but I personally like binding aliases for each rune that set them to the same macro. If you put the following in your init.txt file (found in Windower/scripts):

alias ignis bind !9 input /ja "Ignis" <me>
alias unda bind !9 input /ja "Unda" <me>
alias sulpor bind !9 input /ja "Sulpor" <me>
alias tellus bind !9 input /ja "Tellus" <me>
alias flabra bind !9 input /ja "Flabra" <me>
alias gelus bind !9 input /ja "Gelus" <me>
alias lux bind !9 input /ja "Lux" <me>
alias tene bind !9 input /ja "Tenebrae" <me>

...you can just type //lux, for example, and it will bind Lux to the macro (I use Alt9). Know that ! implies Alt and ^ implies Ctrl. Hope this makes sense. I don't have time right now to whip up a Gearswap method but if that's what you prefer, a few things can be made:

1) A toggling system, where you cycle through them.
2) A "remembers your last rune" system, where if you manually use a rune, it'll save it to the macro each time.
3) Uh... something else? Well, I'm outta ideas.
 Bahamut.Alexcennah
Offline
Serveur: Bahamut
Game: FFXI
user: digoserra
Posts: 269
By Bahamut.Alexcennah 2014-10-24 14:59:22
Link | Citer | R
 
I use this "remember your last rune" method:
Code
--Copy-paste this piece of code to your get_sets function
	rune = "Lux" --This is the "default" value

--Copy-paste this piece of code to your aftercast function
	if spell.type == "Rune" then
		rune = spell.english
	end

--Copy-paste this piece of code to your self_command function
	if command == 'lrune' then
		send_command('@input /ja '..rune..' <me>')
	end

Now make a macro /console gs c lrune to use it.
 Phoenix.Skyfire
Offline
Serveur: Phoenix
Game: FFXI
user: nightkidz
Posts: 116
By Phoenix.Skyfire 2014-10-24 15:16:54
Link | Citer | R
 
Thanks for that, and yea looking for a toggling cycle where it will display which rune you are now set to.
 Bahamut.Alexcennah
Offline
Serveur: Bahamut
Game: FFXI
user: digoserra
Posts: 269
By Bahamut.Alexcennah 2014-10-24 15:31:26
Link | Citer | R
 
I did a little clean-up on my code above.

What you want is easy to do:
Code
--Copy-paste this piece of code to your get_sets function
Runes = {"Tellus","Unda","Flabra","Ignis","Gelus","Sulpor","Lux","Tenebrae"}
rune_ind = 1

--Copy-paste this piece of code to your self_command function
	if command == 'toggle' then
		rune_ind = rune_ind +1
		if rune_ind > #Runes then
			rune_ind = 1
		end
		send_command('@input /echo === Rune set to: '..Runes[rune_ind])
	elseif command == 'rune' then
		send_command('@input /ja '..Runes[rune_ind]..' <me>')
	end

Create a /console gs c toggle macro to toggle between runes and /console gs c rune to use it.
Offline
Posts: 34
By Raesvelg 2014-10-26 14:10:07
Link | Citer | R
 
For some reason I can't seem to get that to work... D:
 Quetzalcoatl.Orestes
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2014-10-26 15:55:41
Link | Citer | R
 
Raesvelg said: »
For some reason I can't seem to get that to work... D:

For anyone using Mote's includes, this is how you would set it up.

add this to user_setup()
Code
    state.Runes = M{['description']='Runes', "Tellus","Unda","Flabra","Ignis","Gelus","Sulpor","Lux","Tenebrae"}


and this near the bottom of your lua, or integrate it into your job_self_command() function, IF you already have one. (be sure to check)
Code
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1]:lower() == 'rune' then
        send_command('@input /ja '..state.Runes.value..' <me>')
    end
end


To cycle them
//gs c cycle Runes

To use them
//gs c rune
 Phoenix.Skyfire
Offline
Serveur: Phoenix
Game: FFXI
user: nightkidz
Posts: 116
By Phoenix.Skyfire 2014-10-26 16:01:56
Link | Citer | R
 
Thanks Alexcennah, works like a charm. Appreciate it!
Offline
Posts: 720
By Nazrious 2014-11-23 23:02:25
Link | Citer | R
 
Any one have any simplified Lua that will handle

1) cycling between sets with one Keybind like F9
2) does not have too many auto functions like reapplying runes etc after lunge / swipe.

3) would also be nice if it had the Frenzy sallet function described by Jeanpaul.


Thanks in advance.
Code
 function get_sets()
 
        send_command('bind f9 gs c toggle TP set')
        send_command('bind f10 gs c toggle Idle set')
        send_command('bind f11 gs c toggle CDC set')
        send_command('bind f12 gs c toggle Req set')
        send_command('bind !f12 gs c toggle Rea set')
       
        function file_unload()
     
 
        send_command('unbind ^f9')
        send_command('unbind ^f10')
                send_command('unbind ^f11')
                send_command('unbind ^f12')
       
        send_command('unbind !f9')
        send_command('unbind !f10')
                send_command('unbind !f11')
        send_command('unbind !f12')
 
        send_command('unbind f9')
        send_command('unbind f10')
        send_command('unbind f11')
        send_command('unbind f12')
 
       
 
        end     


This is from Prothescar's blu lua. I belive this handles the keybind F9 cycle but am not sure, and would not know how to go about modifying this and placing it into a Run Lua.
Offline
Posts: 720
By Nazrious 2014-11-24 02:04:54
Link | Citer | R
 
This is What I managed to come up with so far, get an error on line 6 problem with end...



Edited: function get_sets()

Removed the second one which was causing the error so now it loads will test to see how it performs.

Edit: does not seem to have Dimidation in there how would I go about adding, just copy paste Resolution's code and enter in Dimidation where ever it says resolution?
necroskull Necro Bump Detected! [32 days between previous and next post]
 Asura.Bangerang
Offline
Serveur: Asura
Game: FFXI
user: Eela
By Asura.Bangerang 2014-12-25 17:29:38
Link | Citer | R
 
Here is some code for Mote luas that maximizes the effect of Vivacious Pulse no matter which rune you are currently using. Just tweak the gear sets to match the gear you have available.


Code
function job_precast(spell, action, spellMap, eventArgs)
    if spell.english == 'Vivacious Pulse' then
        -- There's got to be a less verbose way of doing this
        if buffactive['Ignis'] then
            equip(sets.pulse.Ignis)
        elseif buffactive['Gelus'] then
            equip(sets.pulse.Gelus)
        elseif buffactive['Flabra'] then
            equip(sets.pulse.Flabra)
        elseif buffactive['Tellus'] then
            equip(sets.pulse.Tellus)
        elseif buffactive['Sulpor'] then
            equip(sets.pulse.Sulpor)
        elseif buffactive['Unda'] then
            equip(sets.pulse.Unda)
        elseif buffactive['Lux'] then
            equip(sets.pulse.Lux)
        elseif buffactive['Tenebrae'] then
            equip(sets.pulse.Tenebrae)
        end
    end
end


function init_gear_sets()
    --------------------------------------
    -- Vivacious Pulse sets
    --------------------------------------

    -- Maximize the stat listed for each set.
    sets.pulse = {}
    -- STR
    sets.pulse.Ignis = {ammo="Aqreqaq Bomblet",
        head="Highwing Helm",
        body="Mekosu. Harness",hands="Iuitl Wristbands +1",ring1="Rajas Ring",ring2="Dark Ring",
        back="Buquwik Cape",legs="Iuitl Tights +1",feet="Qaaxo Leggings"}
    -- DEX
    sets.pulse.Gelus = {
        head="Felistris Mask",ear1="Dawn Earring",
        body="Mekosu. Harness",hands="Iuitl Wristbands +1",ring1="Rajas Ring",ring2="Dark Ring",
        legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
    -- VIT
    sets.pulse.Flabra = {
        head="Lithelimb Cap",ear1="Dawn Earring",
        body="Mekosu. Harness",hands="Iuitl Wristbands +1",ring1="Dark Ring",ring2="Dark Ring",
        waist="Flume Belt +1",legs="Orvail Pants +1",feet="Iuitl Gaiters +1"}
    -- AGI
    sets.pulse.Tellus = {
        head="Lithelimb Cap",neck="Magoraga Beads",ear1="Dawn Earring",ear2="Supanomimi",
        body="Mekosu. Harness",hands="Iuitl Wristbands +1",ring1="Dark Ring",ring2="Arvina Ringlet +1",
        legs="Thurandaut Tights +1",feet="Iuitl Gaiters +1"}
    -- MND
    sets.pulse.Unda = {
        head="",ear1="Lifestorm Earring",
        body="Respite Cloak",hands="Iuitl Wristbands +1",ring1="Dark Ring",ring2="Dark Ring",
        legs="Shneddick Tights +1",feet="Manabyss Pigaches"}
    -- INT
    sets.pulse.Sulpor = {
        head="",neck="Jeweled Collar",ear1="Psystorm Earring",
        body="Respite Cloak",hands="Buremte Gloves",ring1="Acumen Ring",ring2="Dark Ring",
        legs="Iuitl Tights +1",feet="Manabyss Pigaches"}
    -- CHR
    sets.pulse.Lux = {
        head="",neck="Jeweled Collar",
        body="Respite Cloak",hands="Iuitl Wristbands +1",ring1="Rajas Ring",ring2="Dark Ring",
        legs="Orvail Pants +1",feet="Manabyss Pigaches"}
    -- Divine Magic skill and possibly all stats?
    sets.pulse.Tenebrae = {
        neck="Nesanica Torque",ear1="Beatific Earring",ear2="Divine Earring",
        back="Altruistic Cape",waist="Bishop's Sash",legs="Runeist Trousers"}
end
 Ragnarok.Martel
Offline
Serveur: Ragnarok
Game: FFXI
Posts: 2899
By Ragnarok.Martel 2014-12-25 18:05:28
Link | Citer | R
 
Divine skill isn't just for Tenebrae and mp. It's a modifier for the hp recovered using any rune.
necroskull Necro Bump Detected! [68 days between previous and next post]
 Odin.Quixacotl
Offline
Serveur: Odin
Game: FFXI
user: Quixacotl
Posts: 170
By Odin.Quixacotl 2015-03-04 04:34:48
Link | Citer | R
 
Mote wrote a nice code for customized Runes Timers. The only problem was, he left out the icons.

I was fixing a friend's RUN.lua based on Mote's Libs and figured a way to add icons to the timers. It's not really a big deal I just got tired of looking at all the question marks and the result looks way better. Btw @Ihm it might not be a bad idea to have an icons on/off switch in settings.
Code
-- Setup vars that are user-independent.
function job_setup()
    -- Icons for custom timers for Runes.
    runes.icons = {
        ['Ignis'] = 'spells/00288.png',
        ['Gelus'] = 'spells/00289.png',
        ['Flabra'] = 'spells/00290.png',
        ['Tellus'] = 'spells/00291.png',
        ['Sulpor'] = 'spells/00292.png',
        ['Unda'] = 'spells/00293.png',
        ['Lux'] = 'spells/00294.png',
        ['Tenebrae'] = 'spells/00295.png'
    }

    -- Table of entries
    rune_timers = T{}
    -- entry = rune, index, expires
    
    if player.main_job_level >= 65 then
        max_runes = 3
    elseif player.main_job_level >= 35 then
        max_runes = 2
    elseif player.main_job_level >= 5 then
        max_runes = 1
    else
        max_runes = 0
    end
end

-- Get the command string to create a custom timer for the provided entry.
function create_timer(entry)
    local timer_name = '"Rune: ' .. entry.rune .. '-' .. tostring(entry.index) ..'"'
    local duration = entry.expires - os.time()
    return 'timers c ' .. timer_name .. ' ' .. tostring(duration) .. ' down ' .. runes.icons[entry.rune]
end

In the above example, the icons are loaded from Windower4\plugins\icons folder. But if you're handy with Altana Viewer and Photoshop or Gimp then you can use the dat images. Or make your own icons. The only requirement is that icons should be no larger than 32px32p and in .png or .bmp format or it'll look ghetto.

If you have custom icons then make a new folder: Windower4\plugins\icons\mycons and store in there. Then use;
Code
['Ignis'] = 'mycons/Ignis.png',
necroskull Necro Bump Detected! [380 days between previous and next post]
 Asura.Blittzjr
Offline
Serveur: Asura
Game: FFXI
user: tripletee
Posts: 114
By Asura.Blittzjr 2016-03-17 20:41:26
Link | Citer | R
 
Lakshmi.Saevel said: »
Here is a fairly straight forward GS that will do pretty much everything you need it to do.

It's self contained, easy to edit, has feedback to let you know it's working and is straight forward. I made it from Bryth's BLU gearswap after heavy editing and simplification. Anyone should be able to figure out it's logic without needing a class in coding.


So I got everything updated and working on this except for //gs c toggle TP set

Any ideas why?
 Asura.Blittzjr
Offline
Serveur: Asura
Game: FFXI
user: tripletee
Posts: 114
By Asura.Blittzjr 2016-03-17 21:04:34
Link | Citer | R
 
nvm figured it out
 Shiva.Alistrianna
Offline
Serveur: Shiva
Game: FFXI
Posts: 694
By Shiva.Alistrianna 2016-03-19 00:06:48
Link | Citer | R
 
Odin.Quixacotl said: »
Mote wrote a nice code for customized Runes Timers. The only problem was, he left out the icons.

I was fixing a friend's RUN.lua based on Mote's Libs and figured a way to add icons to the timers. It's not really a big deal I just got tired of looking at all the question marks and the result looks way better. Btw @Ihm it might not be a bad idea to have an icons on/off switch in settings.

Ever since SE added their owns timers I disabled the RUN custom timers in the Mote.lua. The in game timers work just fine and accomplish the same thing.
First Page 2