AEcho Modifications

Langues: JP EN DE FR
users online
Forum » Windower » Support » AEcho modifications
AEcho modifications
 Phoenix.Keido
Offline
Serveur: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-03-10 19:00:17
Link | Citer | R
 
I have been trying to modify this with limited success. Although now nothing works and I cant quite understand why. Can anyone take a look?

First the aecho.lua
Code
--[[
Copyright (c) 2013, Ricky Gall
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
    * Neither the name of <addon name> nor the
    names of its contributors may be used to endorse or promote products
    derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <your name> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]


_addon.name = 'AEcho'
_addon.version = '2.02'
_addon.author = 'Nitrous (Shiva)'
_addon.command = 'aecho'

require('tables')
require('strings')
require('logger')
require('sets')
config = require('config')
chat = require('chat')
res = require('resources')

defaults = {}
defaults.buffs = S{	"parsimony","dark arts","rapture","perpetuance","petrified","paralyze","light arts","slow",
"accession","manifestation","addendum: white","addendum: black","celerity","ebullience","stun","sleep","alacrity",
"immanence","penury","poison","blind","silence","disease","doom","charm","amnesia","curse","bind","gravity","addle",
"kaustra","mute","plague","bane","burn","frost","rasp","shock","terror","drown","dia","bio","flash","str down",
"dex down","vit down","agi down","int down","mnd down","chr down","hp max down","mp max down","tp max down","helix",
"inhibit tp","accuracy down","attack down","evasion down","zombie","defense down","magic accuracy down","magic attack down",
"magic evasion down","magic defense down","weakness"
				}
defaults.alttrack = true
defaults.sitrack = true

settings = config.load(defaults)

autoecho = true

windower.register_event('gain buff', function(id)
    local name = res.buffs[id].english
    for key,val in pairs(settings.buffs) do
        if key:lower() == name:lower() then
            if name:lower() == 'silence' and autoecho then
                windower.send_command('input /item "Echo Drops" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'blind' and autoecho then
                windower.send_command('input /item "Eye Drops" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'paralyze' and autoecho then
                windower.send_command('input /item "Remedy" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'disease' and autoecho then
                windower.send_command('input /item "Remedy" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'poison' and autoecho then
                windower.send_command('input /item "Antidote" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'doom' and autoecho then
                windower.send_command('input /item "Hallowed Water" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'curse' and autoecho then
                windower.send_command('input /item "Holy Water" '..windower.ffxi.get_player()["name"])
			elseif name:lower() == 'bane' and autoecho then
                windower.send_command('input /item "Holy Water" '..windower.ffxi.get_player()["name"])
            elseif name:lower() == 'stun' and autoecho then
                windower.send_command('input /p I am stunned!!')
            elseif name:lower() == 'slow' and autoecho then
                windower.send_command('input /p I have been slowed!!')
            elseif name:lower() == 'sleep' and autoecho then
                windower.send_command('input /p Help I have been put to sleep!!')
            elseif name:lower() == 'petrified' and autoecho then
                windower.send_command('input /p Help I am petrified!!')
			elseif name:lower() == 'bind' and autoecho then
                windower.send_command('input /p Help I am bound!!')
			elseif name:lower() == 'charm' and autoecho then
                windower.send_command('input /p Help I am charmed!! Sleep me or run.')
            elseif name:lower() == 'amnesia' and autoecho then
                windower.send_command('input /p I have amnesia!!')
			elseif name:lower() == 'terror' and autoecho then
                windower.send_command('input /p I am terrorized!!')
			elseif name:lower() == 'flash' and autoecho then
                windower.send_command('input /p I have been afflicted with flash!!')
			elseif (name:lower() == 'burn' or name:lower() == 'bio' or name:lower() == 'frost' or name:lower() == 'dia' or name:lower() == 'shock' or name:lower() == 'rasp' or name:lower() == 'drown' or name:lower() == 'choke') and autoecho then
                windower.send_command('input /p I have been afflicted with a DoT!! Slowly losing HP.')
			elseif name:lower() == 'helix' and autoecho then
                windower.send_command('input /p I have been afflicted with a Helix!! Severe loss of HP.')
			elseif (name:lower() == 'str down' or name:lower() == 'agi down' or name:lower() == 'dex down' or name:lower() == 'mnd down' or name:lower() == 'int down' or name:lower() == 'vit down' or name:lower() == 'chr down') and autoecho then
                windower.send_command('input /p I have been afflicted one or more attributes being reduced!!')
			elseif name:lower() == 'plague' and autoecho then
                windower.send_command('input /p I have been afflicted with a plague!! Losing TP and MP.')
			elseif name:lower() == 'zombie' and autoecho then
                windower.send_command('input /p I have been afflicted with zombie!! Unable to be cured.')
			elseif name:lower() == 'weakness' and autoecho then
                windower.send_command('input /p I have been afflicted by weakness!! HP Halved.')
			elseif name:lower() == 'gravity' and autoecho then
                windower.send_command('input /p I have been afflicted by gravity!! Movement hindered.')
			elseif name:lower() == 'evasion down' and autoecho then
                windower.send_command('input /p My evasion has been reduced!!')
			elseif name:lower() == 'attack down' and autoecho then
                windower.send_command('input /p My attack has been reduced!!')
			elseif name:lower() == 'defense down' and autoecho then
                windower.send_command('input /p My defense has been reduced!!')
			elseif name:lower() == 'accuracy down' and autoecho then
                windower.send_command('input /p My accuracy has been reduced!!')
			elseif name:lower() == 'hp max down' and autoecho then
                windower.send_command('input /p My HP has been reduced!!')
			elseif name:lower() == 'mp max down' and autoecho then
                windower.send_command('input /p My MP has been reduced!!')
			elseif name:lower() == 'tp max down' and autoecho then
                windower.send_command('input /p My TP has been reduced!!')
			end
        end
    end
end)

windower.register_event('incoming text', function(old,new,color)
    if settings.sitrack then
        local sta,ea,txt = string.find(new,'The effect of ([%w]+) is about to wear off.')
        if sta ~= nil then 
            windower.send_command('@send @others atc '..windower.ffxi.get_player()['name']..' - '..txt..' wearing off.')
        end
    end
    return new,color
end)

windower.register_event('addon command', function(...)
    local args = {...}
    if args[1] ~= nil then
        local comm = args[1]:lower()
        if comm == 'help' then
            local helptext = [[AEcho - Command List:
 1. aecho watch <buffname> --adds buffname to the tracker
 2. aecho unwatch <buffname> --removes buffname from the tracker
 3. aecho trackalt --Toggles alt buff/debuff messages on main (this requires send addon)
 4. aecho sitrack --When sneak/invis begin wearing passes this message to your alts
 5. aecho list --lists buffs being tracked
 6. aecho toggle --Toggles off automatic echo drop usage (in case you need this off. does not remain off across loads.)]]
            for _, line in ipairs(helptext:split('\n')) do
                windower.add_to_chat(207, line..chat.controls.reset)
            end
        elseif S{'watch','trackalt','unwatch','sitrack'}:contains(comm) then
            local list = ''
            local spacer = ''
            if comm == 'watch' then
                for i = 2, #args do
                    if i > 2 then spacer = ' ' end
                    list = list..spacer..args[i]
                end
                if settings.buffs[list] == nil then
                    settings.buffs:add(list:lower())
                    notice(list..' added to buffs list.')
                end
            elseif comm == 'unwatch' then
                for i = 2, #args do
                    if i > 2 then spacer = ' ' end
                    list = list..spacer..args[i]
                end
                if settings.buffs[list] ~= nil then
                    settings.buffs:remove(list:lower())
                    notice(list..' removed from buffs list.')
                end
            elseif comm == 'trackalt' then
                settings.alttrack = not settings.alttrack
            elseif comm == 'sitrack' then
                settings.sitrack = not settings.sitrack
            end
            settings:save()
        elseif comm == 'list' then
            settings.buffs:print()
        elseif comm == 'toggle' then
            autoecho = not autoecho
        else
            return
        end
    end
end)



The settings.xml
Code
<?xml version="1.1" ?>
<settings>
    <global>
        <alttrack>false</alttrack>
        <buffs>parsimony,dark arts,rapture,perpetuance,petrified,paralyze,light arts,slow,accession,
		manifestation,addendum: white,addendum: black,celerity,ebullience,stun,sleep,alacrity,
		immanence,penury,poison,blind,silence,disease,doom,charm,amnesia,curse,bind,gravity,addle,
		kaustra,mute,plague,bane,burn,frost,rasp,shock,terror,drown,dia,bio,flash,str down,dex down,
		vit down,agi down,int down,mnd down,chr down,hp max down,mp max down,tp max down,helix,inhibit tp,
		accuracy down,attack down,evasion down,zombie,defense down,magic accuracy down,magic attack down,
		magic evasion down,magic defense down,weakness</buffs>
        <sitrack>true</sitrack>
    </global>
</settings>
 Phoenix.Keido
Offline
Serveur: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-03-11 08:00:40
Link | Citer | R
 
*bump*
 Bahamut.Scizor
Offline
Serveur: Bahamut
Game: FFXI
user: Scizor
Posts: 402
By Bahamut.Scizor 2016-03-11 09:32:11
Link | Citer | R
 
Have you tried the windower forum itself?
 Phoenix.Keido
Offline
Serveur: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-03-11 10:48:53
Link | Citer | R
 
Great idea I have posted it over there as well.
 Ragnarok.Flippant
Offline
Serveur: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-03-11 11:16:17
Link | Citer | R
 
"Nothing works" is a little vague, because I can add "enmity boost" to the list and it will find it when I cast Crusade. Can you be more specific as to what is not working as you expect it? For example, after loading, what are the steps you are taking to test this? What happens, and what is it that you want to happen?

Only logical error that stands out at first glance is that it seems strange to require the auto-echo flag to be set to true in order to notify party chat when you're debuffed.
 Phoenix.Keido
Offline
Serveur: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-03-11 11:25:49
Link | Citer | R
 
Ok, well nothing works. As in no auto potions are drank when silenced. No notification goes off when stunned or when any other de-buff is applied to the character.

I have tested against monsters that apply the following:
bio
dia
stun
terror
DEX down
silence
poison
blind
paralyze

Granted that isn't all of the affects but it appears to me that nothing is working as far as the action that should happen when a matching de-buff is applied such as silence.

I assume you mean the
Code
and autoecho then


That is an assumption on my part. I am not sure if its needed or not.
 Ragnarok.Flippant
Offline
Serveur: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-03-11 19:55:13
Link | Citer | R
 
Some won't work because they don't actually match the resource file (located at Windower4\res\buffs.lua). For example, it's "blindness" and "paralysis."

However, as to why the others aren't working, I'm not sure...

I'm not feeling well enough to actually go out and mess with debuffs right now, but I tried Light Arts, Dark Arts, strategems, Stoneskin, Blink, and Aquaveil and those work...kinda. Light Arts, Dark Arts, and strats are acting very strange and usually won't trigger the event until the next gained buff.

Try adding some print statements to see what is happening during the flow. For example, "print(name:lower())" after you define that variable to check that (1) the event is being triggered each time you gain a buff, and (2) the name it's printing is what you would expect it to say. Then you can move on to add print('whatever') after if-statements to make sure that they are hitting the right conditions.

The autoecho is a flag. If it's true, you'll automatically use echo drops (or other meds, as you've added). It shouldn't matter for the party notifications, since I assume you would always want that to be on. Even if you didn't, I believe the settings.alttrack is the flag that was supposed to be used for that.
[+]
 Phoenix.Keido
Offline
Serveur: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-03-11 20:39:25
Link | Citer | R
 
Thank you I will get to trying that stuff out!
 Phoenix.Keido
Offline
Serveur: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-03-13 13:11:25
Link | Citer | R
 
100% working correctly now. THank you for your help and suggestions!
[+]
Log in to post.