For the current event it's nice to login with every character and get the story-buff.
before login next tron i'd like to print it to a file.
So after all characters are done, i can check the list an login the correct character.
How can I actually print the right buff to the file (not all buffs if possible only the story buff).
function logbuffevent()
local filename = getExecutionPath() .. "/logs/eventbuff.log";
local file, err = io.open(filename, "a+");
for i, buff in pairs(player.Buffs) do
if string.find("story", string.lower(buff)) then
if file then
file:write(" Character name: " ..player.Name.. " \tDate: " .. os.date() .. " Buff: "..buff.."\n")
file:close();
end
end
end
end
This is under the assumption the buff has "story" in it, I can't remember if it does or not.
If it doesn't then you will need to create a table of all of the buff names and do a search of the buff names against the players current buffs. Little bit more involved but still very doable.
Remember no matter you do in life to always have a little fun while you are at it
function logbuffevent()
local filename = getExecutionPath() .. "/logs/eventbuff.log";
local file, err = io.open(filename, "a+");
for i, buff in pairs(player.Buffs) do
if string.find("Element:", buff.Name) then
if file then
file:write(" Character name: " ..player.Name.. " \tDate: " .. os.date() .. " Buff: "..buff.Name.."\n")
file:close();
end
end
end
end
I did concider getting a list of all the buff id's but when I logged lots of alts and got buffs I got to over 10 different names before i stopped counting.
There is probably a list in the US forums regarding buff names and how many.
Remember no matter you do in life to always have a little fun while you are at it
function logbuffevent()
local filename = getExecutionPath() .. "/logs/eventbuff.log";
local file, err = io.open(filename, "a+");
for i, buff in pairs(player.Buffs) do
printf(buff.Name.."\n")
if string.find(buff.Name , "Element") then
if file then
file:write(" Character name: " ..player.Name.. " \tDate: " .. os.date() .. " \tBuff: "..buff.Name.."\n")
file:close();
end
end
end
end