Item Search
     
BG-Wiki Search
Closed Thread
Page 11 of 307 FirstFirst ... 9 10 11 12 13 21 61 ... LastLast
Results 201 to 220 of 6124
  1. #201
    CoP Dynamis
    Join Date
    Nov 2009
    Posts
    265
    BG Level
    4
    FFXI Server
    Ragnarok

    Nitrous24 (not sure if you're the Ricky Gall, script author), regarding bTimers (maybe it's been asked already), when it tracks player buffs, currently if the buff gets dispelled/manually cancelled by the player, it doesn't get deleted from bTimers list and it appears as the buff is still active until it's time is up. Were you considering adding a chatlog parse that deletes a buff timer off the list if player loses the effect prematurely? Just a minor feedback, thanks for improving it thus far.

  2. #202
    Cerberus
    Join Date
    Jun 2007
    Posts
    411
    BG Level
    4
    FFXIV Character
    Ninita Nita
    FFXIV Server
    Excalibur
    FFXI Server
    Shiva
    WoW Realm
    Gnomeregan

    edit: had nothing to do with aoebgone.. something fishy was going on. btimers was working fine a few days ago and i haven't changed anything. however, i did manage to fix w/e issue was going on.. Here's the new btimers.lua

    Code:
    --[[
    bTimers v1.07
    Copyright (c) 2012, 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 the organization 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 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.
    
    ]]
    require 'tablehelper'  -- Required for various table related features. Made by Arcon
    require 'logger'       -- Made by arcon. Here for debugging purposes
    function event_load()
    	player = get_player()  -- Get the player array (Used strictly for comparing name of buffed against character name for (Self)
    	buffs = T(get_player()['buffs']) -- Need the current buff array for perpetuance/composure Tracking
    	watchbuffs = {	
    					Haste=180,
    					Refresh=150,
    					Protect=1800,
    					Shell=1800,
    					Regen=60,
    					Phalanx=180,
    					Last_Resort=180,
    					Arcane_Circle=240,
    					Berserk=180,
    					Aggressor=180
    				} 
    	-- watchbuffs table can be modified be sure to follow the syntax
    	-- however, because this addon looks for specific things.
    	createdTimers = T{}  -- Used as a timer tracker for deletion of timers
    	buffExtension = T{ 
    					Perpetuance=2.5,
    					LightArts=1.8,
    					Rasa=2.28,
    					Composure=3
    				}
    	--Feel free to update this buffExtension variable in case you have better composure
    	--or don't have perpetuance gloves. The Light Arts and Rasa sections are only used for regen
    	extendables = T { 'Regen','Refresh','Blink','Stoneskin','Aquaveil','Haste','Temper','Phalanx' }
    	--This table is used to check if a buff is able to be
    	--extended via perpetuance or composure. If i missed one
    	--feel free to add it. Keep in mind however i only look for
    	--the First name of a buff, no spaces, and this does not have
    	--gain, barspell, or boost-buffs. I apologize for this.
    	extend = T{}
    	first = 0
    	t = 0
    	altbuffs = false
    	send_command('alias btimers lua c btimers')
    end
    
    function event_login()
    	player = get_player()  
    end
    
    function event_unload()
    	--The following deletes all timers created before unloading
    	--Mostly used for when i was continuously reloading it.
    	--but i left it in in case someone wants to unload for something
    	for u = 1, #createdTimers do
    		send_command('timers d "'..createdTimers[u]..'"')
    	end
    	send_command('unalias btimers')
    end
    
    function event_addon_command(...)
        local term = table.concat({...}, ' ')
    	broken = split(term, ' ')
    	--This is a very important fix added
    	--because if you already had a buff and recast it
    	--it would just delete and create so fast
    	--that sometimes it didn't show back up
    	if broken ~= nil then
    		if broken[1]:lower() == 'newtimer' then
    			createTimer(broken[2],broken[3])
    		end
    		
    		if broken[1]:lower() == 'showalt' then
    			altbuffs = not altbuffs
    		end
    	end
    end
    
    function event_gain_status(id,name)
    	if id == 469 then
    		--Check to gain perpetuance and add a timer
    		extend['Perpetuance'] = os.clock()
    	end
    	first = 1
    	l = split(name,' ')
    	if l[2] ~= nil then 
    		createTimer(l[1]..'_'..l[2])
    	else 
    		createTimer(name)
    	end
    end
    
    function event_lose_status(id,name)
    	if watchbuffs['name'] ~= nil then
    		deleteTimer(1,name)
    		send_ipc_message(name..' '..player['name']..' delete')
    	end
    end
    
    function event_ipc_message(msg)
    	if altbuffs then
    		broken2 = split(msg, ' ')
    		if broken2 ~= nil then
    			if broken2[3] == nil then
    				if broken2[2] ~= player['name'] then
    					createTimer(broken2[1],broken2[2])
    				end
    			else
    				deleteTimer(2,broken2[1],broken2[2])
    			end
    		end
    	end
    end
    
    function createTimer(name,target)
    	if watchbuffs[name] ~= nil then
    		--Check current target and if it either doesn't exist,
    		--or is your current character's name, change it to self
    		--otherwise keep it what it is.
    		if target == nil then
    			target = 'Self'
    		elseif target:lower() == player['name']:lower() then
    			target = 'Self'
    		else
    			target = target
    		end
    		for u = 1, #createdTimers do
    			if createdTimers[u] == name..' ('..target..')' then
    				--This loops through the created timers table to see if 
    				--the one currently being created exists. It then proceeds
    				--to delete that timer and table entry and run a createtimer
    				--again. This is what causes the blinking timer you see sometimes
    				--when you recast a buff. No way around it.
    				send_command('timers d "'..name..' ('..target..')"')
    				createdTimers:remove(u)
    				send_command('wait .1;lua c bTimers newtimer '..name..' '..target)
    				return
    			end
    		end
    		
    		--The following section is used for extensions of buff timers
    		--Perpetuance, Light Arts, Tabula Rasa, and Composure are all 
    		--Checked here to figure out the time the timer should be set to.
    		--If all checks fail, the timer is set to base time at the beginning
    		--and 5 seconds is subtracted due to lag of the chat log.
    		if extendables:contains(name) then
    			buffs = T(get_player()['buffs'])
    			timer = tonumber(watchbuffs[name]) - 5
    			if extend ~= nil then
    				e = os.clock()-60
    				if extend['Perpetuance'] ~= nil then
    					if e < extend['Perpetuance'] then
    						if target == 'Self' then
    							
    							if first == 1 then t = 1 else
    							t = t + 1 end
    							if math.even(t) then
    								extend['Perpetuance'] = nil
    								first = 0
    								t = 0
    							end
    						else
    							extend['Perpetuance'] = nil
    						end
    							
    						if name == 'Regen' then
    							timer = tonumber(watchbuffs[name]) * buffExtension['LightArts'] * buffExtension['Perpetuance'] - 5
    						else
    							timer = tonumber(watchbuffs[name]) * buffExtension['Perpetuance'] - 5
    						end
    					end
    				end
    			elseif buffs:contains(377) then
    				if name == 'Regen' then
    					if player['main_job_id'] == 20 then
    						timer = tonumber(watchbuffs[name]) * buffExtension['Rasa'] - 5
    					end
    				end
    			elseif buffs:contains(358) then
    				if name == 'Regen' then
    					if player['main_job_id'] == 20 then
    						timer = tonumber(watchbuffs[name]) * buffExtension['LightArts'] - 5
    					end
    				end
    			elseif buffs:contains(419) then
    				timer = tonumber(watchbuffs[name]) * buffExtension['Composure'] - 5
    			end
    		else
    			timer = tonumber(watchbuffs[name]) - 5
    		end
    		
    		--This is where the timer is actually created
    		--Calls ihm's custom timer create command
    		--e.g. timers c "Protect (Self)" 1800 down Protect <- last protect 
    		--is what helps the timer distinguish what icon to use.
    		if target == 'Self' then
    			send_ipc_message(name..' '..player['name'])
    		else
    			send_ipc_message(name..' '..target)
    		end
    		send_command('timers c "'..name..' ('..target..')" '..timer..' down '..name)
    		createdTimers[#createdTimers+1] = name..' ('..target..')'
    	end
    end
    
    function deleteTimer(mode,effect,target)
    	if mode == 1 then 
    		-- This mode is for when a buff drops off you 
    		--(the lose buff triggers faster then the chat message)
    		for u = 1, #createdTimers do
    			if createdTimers[u] == effect..' (Self)' then
    				send_command('timers d "'..effect..' (Self)"')
    				createdTimers:remove(u)
    			end
    		end
    	elseif mode == 2 then
    		--This mode triggers when a buff drops off others.
    		--It cycles through the created timers table and
    		--if it finds the name of the dropped buff deletes
    		--the table entry as well as removing the timer.
    		if target == nil then
    			target = 'Self'
    		elseif target:lower() == player['name']:lower() then
    			target = 'Self'
    		else
    			target = target
    		end
    		for u = 1, #createdTimers do
    			if createdTimers[u] == effect..' ('..target..')' then
    				send_command('timers d "'..effect..' ('..target..')"')
    				createdTimers:remove(u)
    			end
    		end
    	else
    		return
    	end
    		
    end
    
    function event_incoming_text(old,new,color)
    	--Colors 56 and 64 are for gained buffs
    	--Color 191 for lost buffs. Check against
    	--These colors if it doesn't match just output
    	--the normal message
    	if T{64,56,191,101}:contains(color) then
    		--This check is to catch casted spells
    		--Stores name of caster, spell cast,
    		--target of the effect and the effect itself
    		a,b,caster,caster_spell,target,target_effect = string.find(old,'(%w+) casts ([%w%s]+)..(%w+) gains the effect of (%w+).')
    		
    		--Check fo buffs wearing off and store name and buff in variables
    		c,d,tWear,eWear = string.find(old,'(%w+)\'s ([%w%s]+) effect wears off.')
    		--Check for gain buffs only (i.e. you have filters on) and store name/buff
    		e,f,tar2,eff2 = string.find(old,'(%w+) gains the effect of (%w+).')
    		if a ~= nil then
    			--If a isn't blank it found the message.
    			--The following checks are so that you don't
    			--catch buffs cast by others on others.
    			--Will catch buffs cast by you or on you.
    			if caster:lower() == player['name']:lower() then
    				createTimer(target_effect,target)
    			elseif target:lower() == player['name']:lower() then
    				createTimer(target_effect,target)
    			end
    		elseif c ~= nil then
    			--if c isn't blank it found the wear off message
    			--so delete the timer
    				l = split(eWear,' ')
    				if l[2] ~= nil then 
    					deleteTimer(1,l[1]..'_'..l[2],tWear)
    				else
    					deleteTimer(2,eWear,tWear)
    				end
    		elseif e ~= nil then
    			--If e isn't nil you have filters off and 
    			--received a buff cast by another person
    			--This is just so that if you already
    			--had the buff your timer will refresh.
    			if tar2:lower() == player['name']:lower() then
    				createTimer(eff2,tar2)
    			end
    		end
    	end
    	return new, color  -- must be here or errors will be thrown
    end
    
    -- Function made by byrth
    function split(msg, match)
    	local length = msg:len()
    	local splitarr = {}
    	local u = 1
    	while u < length do
    		local nextanch = msg:find(match,u)
    		if nextanch ~= nil then
    			splitarr[#splitarr+1] = msg:sub(u,nextanch-match:len())
    			if nextanch~=length then
    				u = nextanch+match:len()
    			else
    				u = length
    			end
    		else
    			splitarr[#splitarr+1] = msg:sub(u,length)
    			u = length
    		end
    	end
    	return splitarr
    end

  3. #203
    Cerberus
    Join Date
    Jun 2007
    Posts
    411
    BG Level
    4
    FFXIV Character
    Ninita Nita
    FFXIV Server
    Excalibur
    FFXI Server
    Shiva
    WoW Realm
    Gnomeregan

    It found out the other day that //wtbox reset reloaded the settings. Now, I didn't think of that when i was messing with it while debugging because i left it in the same place. However, if you changed the settings this would cause all your settings to revert. The following update fixes that, as well as adds tracking for /fume changing the aura and Atma wearing off, which kinda defeats the purpose of //wtbox reset (unless you warp with atma still up since it never passes the message. I did leave //wtbox reset in though. I did do some quick testing, do however post if you notice anything that's off. Oh, on a side note, i did think about making it so it wouldn't add multiples of the same line to the box, but, there are times were multiples of the same thing can be procs, so i decided against this for now. You will need to create a wtbox/data folder now btw, settings are stored there from now on. This is due to the incoming addition of addon updates viat he windower launcher. Anything inside the data directory will not be overwritten when you update, so it makes more sense to store settings there so they won't get reset everytime you update. So just create wtbox/data and put your settings file in there.

    tl;dr: Aura change tracking, Atma wearing tracking, create wtbox/data, reset changed so your settings aren't reverted.

    wtbox.lua v1.09
    Code:
    --[[
    wtbox v1.09
    Copyright (c) 2012, 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 the organization 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 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.
    
    ]]
    function event_load()
    	scrolled = 0
    	currline = 0
    	wtchats = {'WTBox'}
    	settings = {}
    	player = get_player()
    	settingsPath = lua_base_path..'data/'
    	settingsFile = settingsPath..'settings.xml'
    	if not file_exists(settingsFile) then
    		local f = io.open(settingsFile,"w")
    		f:write("<?xml version=\"1.0\"?>\n")
    		f:write("<!--File Created by wtbox.lua-->\n\n")
    		f:write("\t<settings>\n")
    		f:write("\t\t<posx>300</posx>\n")
    		f:write("\t\t<posy>300</posy>\n")
    		f:write("\t\t<bgalpha>200</bgalpha>\n")
    		f:write("\t\t<bgred>0</bgred>\n")
    		f:write("\t\t<bggreen>0</bggreen>\n")
    		f:write("\t\t<bgblue>0</bgblue>\n")
    		f:write("\t\t<textsize>12</textsize>\n")
    		f:write('\t\t<textred>255</textred>\n')
    		f:write('\t\t<textgreen>255</textgreen>\n')
    		f:write('\t\t<textblue>255</textblue>\n')
    		f:write("\t\t<chatlines>5</chatlines>\n")
    		f:write("\t</settings>")
    		io.close(f)
    	end
    	send_command('alias wtbox lua c wtbox')
    	send_command('wtbox help')
    	send_command('wait 3;wtbox create')
    end
    
    function event_login()
    	player = get_player()
    end
    
    function event_unload()
    	wtbox_delete()
    end 
    
    function event_addon_command(...)
        local args = {...}
    	if args[1] ~= nil then
    		comm = args[1]
    		if comm:lower() == 'help' then
    			add_to_chat(55,'WeaknessTrackerBox loaded! You have access to the following commands:')
    			add_to_chat(55,' 1. wtbox bgcolor <alpha> <red> <green> <blue> --Sets the color of the box.')
    			add_to_chat(55,' 2. wtbox text <size> <red> <green> <blue> --Sets text color and size.')
    			add_to_chat(55,' 3. wtbox pos <posx> <posy> --Sets position of box.')
    			add_to_chat(55,' 4. wtbox unload --Save settings and close wtbox.')
    			add_to_chat(55,' 5. wtbox reset --resets the box back to empty.')
    			add_to_chat(55,' 6. wtbox help --Shows this menu.')
    		elseif comm:lower() == 'create' then
    			wtbox_create()
    		elseif comm:lower() == 'unload' then
    			wtbox_delete()
    		elseif comm:lower() == 'bgcolor' then
    			tb_set_bg_color('wtcbox',args[2],args[3],args[4],args[5])
    			settings['bgalpha'] = args[2]
    			settings['bgred'] = args[3]
    			settings['bggreen'] = args[4]
    			settings['bgblue'] = args[5]
    		elseif comm:lower() == 'pos' then
    			tb_set_location('wtcbox',args[2],args[3])
    			settings['posx'] = args[2]
    			settings['posy'] = args[3]
    		elseif comm:lower() == 'text' then
    			tb_set_font('wtcbox','Arial',args[2])
    			tb_set_color('wtcbox',255,args[3],args[4],args[5])
    			settings['textsize'] = args[2]
    			settings['textred'] = args[3]
    			settings['textgreen'] = args[4]
    			settings['textblue'] = args[5]
    		elseif comm:lower() == 'reset' then
    			tb_delete('wtcbox')
    			wtbox_create()
    		else
    			return
    		end
    	end
    end
    
    function wtbox_create()
    	for line in io.lines(settingsFile) do
    		local g,h,key,value = string.find(line,'<(%w+)>(%d+)</%1>')
    		if value ~= nil then
    			settings[key] = value
    		end
    	end
    	wtbox_set()
    end
    
    function wtbox_set()
    	tb_create('wtcbox')
    	tb_set_text('wtcbox','WTBox')
    	if settings ~= nil then
    		tb_set_bg_color('wtcbox',settings['bgalpha'],settings['bgred'],settings['bggreen'],settings['bgblue'])
    		tb_set_bg_visibility('wtcbox',true)
    		tb_set_color('wtcbox',255,settings['textred'],settings['textgreen'],settings['textblue'])
    		tb_set_font('wtcbox','Times New Roman',settings['textsize'])
    		tb_set_location('wtcbox',settings['posx'],settings['posy'])
    		tb_set_visibility('wtcbox',true)
    	end
    end
    
    function wtbox_refresh()
    	text = wtchats[1]..'\n'
    	for u = currline - settings['chatlines'], currline do
    		text = text..wtchats[currline]
    	end
    end
    
    function wtbox_delete()
    	add_to_chat(55,'WTBox closing and saving settings')
    	local f = io.open(settingsPath..'tmp.txt',"w")
    	f:write("<?xml version=\"1.0\"?>\n")
    	f:write("<!--File Created by wtbox.lua-->\n\n")
    	f:write("\t<settings>\n")
    	f:write("\t\t<posx>"..settings['posx'].."</posx>\n")
    	f:write("\t\t<posy>"..settings['posy'].."</posy>\n")
    	f:write("\t\t<bgalpha>"..settings['bgalpha'].."</bgalpha>\n")
    	f:write("\t\t<bgred>"..settings['bgred'].."</bgred>\n")
    	f:write("\t\t<bggreen>"..settings['bggreen'].."</bggreen>\n")
    	f:write("\t\t<bgblue>"..settings['bgblue'].."</bgblue>\n")
    	f:write("\t\t<textsize>"..settings['textsize'].."</textsize>\n")
    	f:write("\t\t<textred>"..settings['textred'].."</textred>\n")
    	f:write("\t\t<textgreen>"..settings['textgreen'].."</textgreen>\n")
    	f:write("\t\t<textblue>"..settings['textblue'].."</textblue>\n")
    	f:write("\t\t<chatlines>"..settings['chatlines'].."</chatlines>\n")
    	f:write("\t</settings>")
    	io.close(f)
    	local r,es = os.rename(settingsFile,settingsPath..'tmp2.txt')
    	if not r then write(es) end
    	local e,rs = os.rename(settingsPath..'tmp.txt',settingsFile)
    	if not e then write(rs) end
    	local r,es = os.remove(settingsPath..'tmp2.txt')
    	if not r then write(es) end
    	tb_delete('wtcbox')
    	send_command('unalias wtbox')
    	send_command('lua u wtbox')
    end
    
    function event_incoming_text(old,new,color)
    	local c,d,he,stuff = string.find(old,'The fiend appears(.*)vulnerable to ([%w%s]+)!')
    	local aurachange = string.find(old,'The aura of your foe suddenly changes.')
    	local atmaoff = string.find(old,player['name'].."'s Atma effect wears off.")
    	if aurachange ~= nil or atmaoff ~= nil then
    		wtbox_set()
    	end
    	if c ~= nil then
    		
    		if he == ' highly ' then
    			wtchats[#wtchats+1] = "\\cs(255,100,100)"..stuff.." 3!!!\\cr\n"
    		elseif he == ' extremely ' then
    			wtchats[#wtchats+1] = "\\cs(255,255,255)"..stuff.." 5!!!!!\\cr\n"
    		else
    			wtchats[#wtchats+1] = "\\cs(100,175,255)"..stuff.."1!\\cr\n"
    		end
    		if #wtchats < 7 then
    			i = 2
    		else
    			i = #wtchats - settings['chatlines']
    		end
    		text = wtchats[1]..'\n'
    		for u = i, #wtchats do
    				text = text..wtchats[u] 
    		end
    		currline = #wtchats
    		tb_set_text('wtcbox', text)
    		wtbox_refresh()
    	end
    	return new,color
    end
    
    function file_exists(name)
       local f=io.open(name,"r")
       if f~=nil then 
    		local q,r = io.close(f)
    		if not q then write(r) end
    		return true 
    	else
    		return false 
    	end
    end
    
    function split(msg, match)
    	local length = msg:len()
    	local splitarr = {}
    	local u = 1
    	while u < length do
    		local nextanch = msg:find(match,u)
    		if nextanch ~= nil then
    			splitarr[#splitarr+1] = msg:sub(u,nextanch-1)
    			if nextanch~=length then
    				u = nextanch+1
    			else
    				u = length
    			end
    		else
    			splitarr[#splitarr+1] = msg:sub(u,length)
    			u = length
    		end
    	end
    	return splitarr
    end

  4. #204
    Cerberus
    Join Date
    Jun 2007
    Posts
    411
    BG Level
    4
    FFXIV Character
    Ninita Nita
    FFXIV Server
    Excalibur
    FFXI Server
    Shiva
    WoW Realm
    Gnomeregan

    FFOcolor addon finished. This allows you to specify a tab you want ffocolor to show up in, while also changing the color of the text so it is easy to distinguish from that tab's normal text. It also highlights either the line or your name specifically when you are being talked about. You can adjust the list of names to watch via the //ffocolor watchname <name> command. You were need to create a data folder inside your ffocolor folder should you choose to use this addon. Later on the launcher will be updated to include lua addons and anything in this folder will not be overwritten.

    readme.md
    Code:
    Author: Ricky Gall
    Version: 1.01
    
    Addon to make ffochat show up in one of the 5 in-game chat tabs (say/shout/linkshell/party/tell), while also allowing you to show the text in a certain color to easily distinguish it from the chat that normally shows up in that tab.
    
    Abbreviation: //ffocolor
    
    You have access to the following commands:
     1. //ffocolor hlcolor <color#> --Changes the highlight color
     2. //ffocolor chattab <say/shout/linkshell/party/tell> --Changes the chattab
     3. //ffocolor highlight <line/name> --Changes the line or your name color when you are talked about in ffochat
     4. //ffocolor talkedc <color#> --Sets the color of the highlight for when you are talked about
     5. //ffocolor watchname <name> -- Track another name
     6. //ffocolor getcolors -- Show a list of color codes. Be aware this is 255 lines of text
     7. //ffocolor unload --Save settings and close ffocolor.
     8. //ffocolor help --Shows this menu.
    ffocolor.lua
    Code:
    --[[
    ffocolor v1.01
    Copyright (c) 2012, 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 the organization 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 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.
    
    ]]
    function event_load()
    	startAddon()
    end
    
    function event_login()
    	startAddon()
    end
    
    function event_logout()
    	dosettings('save')
    end
    
    function event_unload()
    	dosettings('save')
    	add_to_chat(55,"FFOColor unloading and saving settings.")
    	send_command('unalias ffocolor')
    end
    
    function event_addon_command(...)
        local args = {...}
    	if args[1] ~= nil then
    		comm = args[1]
    		if comm:lower() == 'help' then
    			add_to_chat(55,'FFOcolor loaded! You have access to the following commands:')
    			add_to_chat(55,' 1. ffocolor hlcolor <color#> --Changes the highlight color')
    			add_to_chat(55,' 2. ffocolor chattab <say/shout/linkshell/party/tell> --Changes the chattab')
    			add_to_chat(55,' 3. ffocolor highlight <line/name> --Changes the line or your name color when you are talked about in ffochat')
    			add_to_chat(55,' 4. ffocolor talkedc <color#> --Sets the color of the highlight for when you are talked about')
    			add_to_chat(55,' 5. ffocolor watchname <name> -- Track another name')
    			add_to_chat(55,' 6. ffocolor getcolors -- Show a list of color codes. Be aware this is 255 lines of text')
    			add_to_chat(55,' 7. ffocolor unload --Save settings and close ffocolor.')
    			add_to_chat(55,' 8. ffocolor help --Shows this menu.')
    		elseif comm:lower() == 'talkedc' then
    			settings['talkedc'] = args[2]
    		elseif comm:lower() == 'chattab' then
    			settings['chatTab'] = args[2]
    		elseif comm:lower() == 'hlcolor' then
    			settings['hlcolor'] = args[2]
    		elseif comm:lower() == 'highlight' then
    			settings['highlight'] = args[2]
    		elseif comm:lower() == 'watchname' then
    			names[#names+1] = args[2]
    			settings['namestowatch'] = settings['namestowatch']..','..args[2]
    		elseif comm:lower() == 'getcolors' then
    			getcolors()
    		elseif comm:lower() == 'unload' then
    			send_command('lua u ffocolor')
    		else
    			return
    		end
    	end
    end
    
    function event_incoming_text(old,new,color)
    	if old ~= former then
    		local a,b,txt = string.find(old,'%[%d+:#%w+%](.*):')
    		if b~= nil then
    			tcol = string.char(31,settings['talkedc'])
    			hcol = string.char(31,settings['hlcolor'])
    			ccol = string.char(31,color)
    			for i = 1, #chatTabs do
    				if settings['chatTab']:lower() == chatTabs[i]:lower() then
    					color = tabColor[i]
    				end
    			end
    			fulltext = split(old,' ')
    			new = ''
    			for z = 1, #names do
    				nametest = string.find(old:lower(),'('..names[z]:lower()..')')
    				if nametest ~= nil then break end
    			end
    			for y = 1, #names do
    				playertest = string.find(txt:lower(),'('..names[y]:lower()..')')
    				if playertest ~= nil then break end
    			end
    			if nametest ~= nil then
    				if playertest ~= nil then
    					for u = 1, #fulltext do
    						if u > 1 then
    							new = new..' '
    						end
    						new = new..hcol..fulltext[u]
    					end
    				else
    					if settings['highlight'] == 'name' then
    						for u = 1, #fulltext do
    							for x = 1, #names do
    								wordtest = string.find(fulltext[u]:lower(),'('..names[x]:lower()..')')
    								if wordtest ~= nil then break end
    							end
    							if u > 1 then
    								new = new..' '
    							end
    							if wordtest == nil then
    								new = new..hcol..fulltext[u]
    							else
    								new = new..tcol..fulltext[u]
    							end
    						end
    					else
    						for u = 1, #fulltext do
    							if u > 1 then
    								new = new..' '
    							end
    							new = new..tcol..fulltext[u]
    						end
    					end
    				end
    			else
    				for u = 1, #fulltext do
    					if u > 1 then
    						new = new..' '
    					end
    					new = new..hcol..fulltext[u]
    				end
    			end
    		end
    	end
    	return new,color
    end
    
    function dosettings(arg1)
    	if arg1 == 'get' then
    		for line in io.lines(settingsFile) do
    			local g,h,key,value = string.find(line,'<(%w+)>([%w%d%p]+)</%1>')
    			if value ~= nil then
    				settings[key] = value
    			end
    		end
    		names = split(settings['namestowatch'],',')
    	else
    		local f = io.open(settingsPath..'tmp.txt',"w")
    		f:write("<?xml version=\"1.0\"?>\n")
    		f:write("<!--File Created by FFOColor.lua v1.0-->\n\n")
    		f:write("\t<settings>\n")
    		f:write("\t\t<chatTab>"..settings['chatTab'].."</chatTab> --Chat tab for ffochat to show up in\n")
    		f:write("\t\t<hlcolor>"..settings['hlcolor'].."</hlcolor> --Color to recolor ffochat text\n")
    		f:write("\t\t<talkedc>"..settings['talkedc'].."</talkedc> --Color to highlight when you are talked about\n")
    		f:write("\t\t<highlight>"..settings['highlight'].."</highlight> --Which to highlight when you are talked about\n")
    		f:write("\t\t<namestowatch>"..settings['namestowatch'].."</namestowatch> -- Which names would you light using above method\n")
    		f:write("\t</settings>")
    		io.close(f)
    		local r,es = os.rename(settingsFile,settingsPath..'tmp2.txt')
    		if not r then write(es) end
    		local e,rs = os.rename(settingsPath..'tmp.txt',settingsFile)
    		if not e then write(rs) end
    		local r,es = os.remove(settingsPath..'tmp2.txt')
    		if not r then write(es) end
    	end
    end
    
    function startAddon()
    	player = get_player()
    	settingsPath = lua_base_path..'data/'
    	settingsFile = settingsPath..'settings-'..player['name']..'.xml'
    	chatTabs = {'Say','Tell','Party','Linkshell','Shout'}
    	tabColor = {'1','4','5','6','2'}
    	settings = {}
    	last = ''
    	firstrun = 0
    	former = ''
    	if not file_exists(settingsFile) then
    		firstrun = 1
    		local f = io.open(settingsFile,"w")
    		f:write("<?xml version=\"1.0\"?>\n")
    		f:write("<!--File Created by FFOColor.lua v1.0-->\n\n")
    		f:write("\t<settings>\n")
    		f:write("\t\t<chatTab>Say</chatTab> --Chat tab for ffochat to show up in\n")
    		f:write("\t\t<hlcolor>04</hlcolor> --Color to recolor ffochat text\n")
    		f:write("\t\t<talkedc>167</talkedc> --Color to highlight when you are talked about\n")
    		f:write("\t\t<highlight>line</highlight> --Which to highlight when you are talked about\n")
    		f:write("\t\t<namestowatch>"..player['name'].."</namestowatch> -- Which names would you light using above method\n")
    		f:write("\t</settings>")
    		io.close(f)
    	end
    	send_command('alias ffocolor lua c ffocolor')
    	dosettings('get')
    	if firstrun == 1 then
    		send_command('ffocolor help')
    		add_to_chat(55,'FFOColor settings file created')
    	end	
    end
    
    function file_exists(name)
       local f=io.open(name,"r")
       if f~=nil then 
    		local q,r = io.close(f)
    		if not q then write(r) end
    		return true 
    	else
    		return false 
    	end
    end
    
    function getcolors()
    	colors = {}
    	colors[1] = 'Menu > Font Colors > Chat > Immediate vicinity ("Say")'
    	colors[2] = 'Menu > Font Colors > Chat > Wide area ("Shout")'
    	colors[4] = 'Menu > Font Colors > Chat > Tell target only ("Tell")'
    	colors[5] = 'Menu > Font Colors > Chat > All party members ("Party")'
    	colors[6] = 'Menu > Font Colors > Chat > Linkshell group ("Linkshell")'
    	colors[7] = 'Menu > Font Colors > Chat > Emotes'
    	colors[17] = 'Menu > Font Colors > Chat > Messages ("Message")'
    	colors[142] = 'Menu > Font Colors > Chat > NPC Conversations'
    	colors[20] = 'Menu > Font Colors > For Others > HP/MP others loose'
    	colors[21] = 'Menu > Font Colors > For Others > Actions others evade'
    	colors[22] = 'Menu > Font Colors > For Others > HP/MP others recover'
    	colors[60] = 'Menu > Font Colors > For Others > Beneficial effects others are granted'
    	colors[61] = 'Menu > Font Colors > For Others > Detrimental effects others receive'
    	colors[63] = 'Menu > Font Colors > For Others > Effects others resist'
    	colors[28] = 'Menu > Font Colors > For Self > HP/MP you loose'
    	colors[29] = 'Menu > Font Colors > For Self > Actions you evade'
    	colors[30] = 'Menu > Font Colors > For Self > HP/MP you recover'
    	colors[56] = 'Menu > Font Colors > For Self > Beneficial effects you are granted'
    	colors[57] = 'Menu > Font Colors > For Self > Detrimental effects you receive'
    	colors[59] = 'Menu > Font Colors > For Self > Effects you resist'
    	colors[8] = 'Menu > Font Colors > System > Calls for help'
    	colors[50] = 'Menu > Font Colors > System > Standard battle messages'
    	colors[121] = 'Menu > Font Colors > System > Basic system messages'
    
    	for v = 0, 255, 1 do
    		if(colors[v] ~= nil) then
    			add_to_chat(v, "Color "..v.." - "..colors[v])
    		else
    			add_to_chat(v, "Color "..v.." - This is some random text to display the color.")
    		end
    	end
    end
    
    function split(msg, match)
    	local length = msg:len()
    	local splitarr = {}
    	local u = 1
    	while u < length do
    		local nextanch = msg:find(match,u)
    		if nextanch ~= nil then
    			splitarr[#splitarr+1] = msg:sub(u,nextanch-1)
    			if nextanch~=length then
    				u = nextanch+1
    			else
    				u = length
    			end
    		else
    			splitarr[#splitarr+1] = msg:sub(u,length)
    			u = length
    		end
    	end
    	return splitarr
    end

  5. #205
    BG Content
    Join Date
    Jul 2007
    Posts
    21,105
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    I'd like to gauge interest before I spend too much time making this:


    Anyone interested in this?

  6. #206
    Old Merits
    Join Date
    Apr 2012
    Posts
    1,109
    BG Level
    6

    If you are able customise the colors of weaponskills, crits and misses then absolutely. Even if you can't it seems more asthetically pleasing than normal.

  7. #207
    Old Merits
    Join Date
    Sep 2010
    Posts
    1,094
    BG Level
    6
    FFXI Server
    Ragnarok

    That's pretty cool. I like the single line WS dmg. My only concern would be parser compatibility.

    Seeing customized chat like that makes me wish there was a way to do it for shield blocked attacks.

  8. #208
    An exploitable mess of a card game
    Join Date
    Sep 2008
    Posts
    13,258
    BG Level
    9
    FFXIV Character
    Gouka Mekkyaku
    FFXIV Server
    Gilgamesh
    FFXI Server
    Diabolos

    Tbh, numbers to the left is insanity when reading this. I would prefer . . .

    [Name] Action => Enemy (Amount measurement)

    [Player1] Melee Attack => Tiamat (250 DMG)
    [Player2] Cure => Player1 (30 HP)
    [Player3] Cure => Corse (30 DMG)

  9. #209
    Sea Torques
    Join Date
    Sep 2012
    Posts
    743
    BG Level
    5
    FFXI Server
    Leviathan

    Could make it configurable. Let people write stuff like this in the config:

    [$name] $damage $type -> $target

    And internally, take that string and replace $name with the first name you matched, etc.

  10. #210
    Radsourceful

    Join Date
    Jul 2007
    Posts
    1,964
    BG Level
    6
    FFXI Server
    Bismarck

    Quote Originally Posted by Arcon View Post
    Could make it configurable. Let people write stuff like this in the config:

    [$name] $damage $type -> $target

    And internally, take that string and replace $name with the first name you matched, etc.
    This for sure, I'd definitely use it even without config though

  11. #211
    >The Implying
    Join Date
    May 2006
    Posts
    4,045
    BG Level
    7
    FFXIV Character
    Jeryhn Astracrown
    FFXIV Server
    Excalibur
    FFXI Server
    Cerberus

    Gods yes, I would love that chat log mod. Especially if it had configurable options and colors.

    Also, a question: With these lua scripts, would it be possible to automate communication of abyssea/voidwatch triggers to your party chat?
    Bonus for auto-translate capability.

  12. #212
    An exploitable mess of a card game
    Join Date
    Sep 2008
    Posts
    13,258
    BG Level
    9
    FFXIV Character
    Gouka Mekkyaku
    FFXIV Server
    Gilgamesh
    FFXI Server
    Diabolos

    Quote Originally Posted by Jeryhn View Post
    Gods yes, I would love that chat log mod. Especially if it had configurable options and colors.

    Also, a question: With these lua scripts, would it be possible to automate communication of abyssea/voidwatch triggers to your party chat?
    Bonus for auto-translate capability.
    Yep.

  13. #213
    CoP Dynamis
    Join Date
    Nov 2009
    Posts
    265
    BG Level
    4
    FFXI Server
    Ragnarok

    For anyone LUA proficient and bored, would you ponder an idea of making a Synergy HUD?
    Something SE should’ve done from the start and to put them to shame:
    A textbox displaying target element values, below current element values and somewhere on the side pressure and impurity ratio.
    Could even track your fewel levels.
    I think pressure and impurity aren’t displayed in chatlog with each feed, but are when you check them manually or use ability to lower their level. Also, each feed (when you’re at capped skill) adds a semi constant number to those, ie impurity is +5% per feed.

    Most of that would be done by parsing the chatlog and feeding numbers to a textbox.

  14. #214
    Insert witty title here
    Join Date
    Jun 2007
    Posts
    1,193
    BG Level
    6
    FFXI Server
    Phoenix

    Pressure and impurity are displayed with every fewell feed.
    Also, that chat log re-config looks hot as hell.

  15. #215

    Posted this on xiah, figure I'd post it here too.

    I missed the salvage boat the first time round, and have had to spam them recently for 35s. I thought "Wouldn't it be nice if I knew what these cells did when they dropped?" Then I thought, damn all these cells cluttering up my inventory! If only there were some way to have them auto pass.

    Then I thought Eee-by-gum this Lua thing looks interesting. Might give it a go.

    So anyway I created something that Tells you what cells do as they drop, and autopasses after you've obtained a cell.

    CellHelp

    To use:

    Before entering salvage, or before obtaining any cells, //lua load cellhelp and load your lightluggage profile (/ll profile salvage-<charactername>.

    A text box will appear with all the cells you need. After that, whenever a cell you need drops it will display in the log as You find a <cell name> (<cell function>) /NEED/.

    When the log reads <playername> obtains <cell name>. your LL profile will be updated, and the text box displaying the cells you still need will be altered.

    If a couple of, say, incus cells drop at one time LL will not remove the ones currently in the treasure pool, but will pass every subsequent iteration of that drop.

    There's a bug at the minute where every drop that isn't an unobtained cell will say /Have/ next to it. This will be fixed soon.

    If there's a cell you don't want to obtain, you can type /echo <me> obtains a --cell name--. (The -- and . are necessary) and it'll act as if you've obtained it.

    Other functionality I'd like to have: Alex counter, Auto lot alex if stated.

  16. #216
    Insert witty title here
    Join Date
    Jun 2007
    Posts
    1,193
    BG Level
    6
    FFXI Server
    Phoenix

    Being in the same boat as far as salvage goes, I can't wait to try that out! :D

    {edit} You say that it erases and re-adds the salvage ll profile every time, so editing it won't make you pass ones you don't want... Does it delete everything in that ll profile, like if I already have it set to pass 15/25/35 gear I already have, will that be nuked when I go in, or would I have to load a different ll profile after I have cells done? Is there a way to use this and keep the gear pass/lot profile I have setup already?{/edit}

  17. #217
    The Syrup To Waffles's Waffle
    Join Date
    Jun 2007
    Posts
    5,053
    BG Level
    8
    FFXIV Character
    Cair Bear
    FFXIV Server
    Excalibur
    FFXI Server
    Fenrir

    It uses Salvage-[CharacterName].txt, which I imagine means it's auto-creating/updating/deleting like SalvageHelper does. You'd probably have to close it before starting a new run for it to function properly.

  18. #218

    Quote Originally Posted by Esvedium View Post
    Being in the same boat as far as salvage goes, I can't wait to try that out! :D

    {edit} You say that it erases and re-adds the salvage ll profile every time, so editing it won't make you pass ones you don't want... Does it delete everything in that ll profile, like if I already have it set to pass 15/25/35 gear I already have, will that be nuked when I go in, or would I have to load a different ll profile after I have cells done? Is there a way to use this and keep the gear pass/lot profile I have setup already?{/edit}
    At the minute it loads a separate profile that only passes cells, will be erased everytime the profile is unloaded, and cleared everytime a new cell is obtained. However, I want to have it so that you can add certain items in yourself - for things like Alex passing/Lotting and Gear Passing/Lotting.

    What might be possible, and I won't be able to check until either later today or tomorrow, is I might be able to get it so that it only erases/writes on the 2nd/3rd line of a Text document - That way there'll still be a way to have some things in your ll profile and have it auto-lot and auto-pass.

    Another thing I'm thinking of adding, and this is for my shortsightedness more than anything, is the ability to Query what Rampart you need to kill in ZR. We never remember to check.

    If I can do this, then I'll have it so that hopefully the first line will be for user defined Pass, the second for User defined lots, and the third is for autopassing cells. I'll see what I can do.

  19. #219
    CoP Dynamis
    Join Date
    Nov 2009
    Posts
    265
    BG Level
    4
    FFXI Server
    Ragnarok

    Quote Originally Posted by Podginator View Post
    At the minute it loads a separate profile that only passes cells, will be erased everytime the profile is unloaded, and cleared everytime a new cell is obtained. However, I want to have it so that you can add certain items in yourself - for things like Alex passing/Lotting and Gear Passing/Lotting.

    What might be possible, and I won't be able to check until either later today or tomorrow, is I might be able to get it so that it only erases/writes on the 2nd/3rd line of a Text document - That way there'll still be a way to have some things in your ll profile and have it auto-lot and auto-pass.

    Another thing I'm thinking of adding, and this is for my shortsightedness more than anything, is the ability to Query what Rampart you need to kill in ZR. We never remember to check.

    If I can do this, then I'll have it so that hopefully the first line will be for user defined Pass, the second for User defined lots, and the third is for autopassing cells. I'll see what I can do.
    Earlier in this thread Arcon provided a code snippet for a a parser that looks into a separate 'config' file and merges that file's settings with your main file. You could write extra items to pass in a separate file and do a call for that list to be appended to your dynamically created LL pass list.

  20. #220
    Sea Torques
    Join Date
    Sep 2012
    Posts
    743
    BG Level
    5
    FFXI Server
    Leviathan

    Quote Originally Posted by Zirael View Post
    Earlier in this thread Arcon provided a code snippet for a a parser that looks into a separate 'config' file and merges that file's settings with your main file. You could write extra items to pass in a separate file and do a call for that list to be appended to your dynamically created LL pass list.
    I didn't post the parser itself (although it's in the GitHub repository). I'm currently amending it so it can parse XML, too. But none of this will work nicely until the Lua library updater goes live, which will hopefully be soon.

Closed Thread
Page 11 of 307 FirstFirst ... 9 10 11 12 13 21 61 ... LastLast

Similar Threads

  1. Service and Support
    By Ribeye in forum FFXI: Everything
    Replies: 8
    Last Post: 2009-10-17, 18:23
  2. Windows vista and FFXI problem
    By Takeno in forum FFXI: Everything
    Replies: 1
    Last Post: 2007-07-26, 13:36
  3. Windows Vista and Windower
    By divisortheory in forum FFXI: Everything
    Replies: 35
    Last Post: 2006-06-23, 04:19