Page 1 of 2

Working on new Addon: GuildRosterExport - Need Advice

Posted: Fri Feb 09, 2018 10:14 pm
by foghladha
Greetings Mod Maker Extraordinaires!

I'm a bit of a mod making novice. I've made a few mods in the past that have been loved (GoIgnoreYourself, Unbearable, LetMeSpeak to name a few) but im no expert at LUA or mod making. I'm just a hack that gets lucky when I find pieces of something else that works when I put them together.

The Project
I'm trying to write a mod that a user can type "/dumpguild" and the game will take the data from GetGuildMemberData() and export it into a saved file named "guild.xml", "guild.lua", or even better "guild.json". It should be a fairly simple script but it's been years since i last LUAed and i'm a bit rusty.

Any pros know how i can take GetGuildMemberData() and export it to a text file?

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sat Feb 10, 2018 9:53 am
by sullemunk
here you go:

https://www.dropbox.com/s/uwidfxvgogz0v ... 0.zip?dl=0

use /dumpguild and it'll export the guildlist to a file under "logs/GExport.txt"

thou it will have timestamps (wich is a tradeoff for using the textlog saving), but you can probably make something to sub them out in post

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sat Feb 10, 2018 5:15 pm
by foghladha
Thanks! Its an awesome head start!

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sat Feb 10, 2018 9:17 pm
by Glorian
Great. Will check it out.

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sat Feb 10, 2018 9:48 pm
by sullemunk
how do you want/need the output format to be?

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sat Feb 10, 2018 11:36 pm
by ragafury
is it possible to make a 2nd command for extended data? (class,level, title, special etc.) seperated by " ; " for easy excel import?

thanks!

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 12:07 am
by sullemunk
added another command: /dumpguild2 wich will output the guildlist with additional info on each memmber to GExport2.txt, (it also has line breaking but some text editors won't show them; ex: notepad, but wordpad will, aslo if opening it into excel, don't seperate with spacing)


https://www.dropbox.com/s/rsf8mxbmpdqxh ... 1.zip?dl=0

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 12:44 am
by Glorian
Very Nice. Got it working and with semicolons seperation in Excel works qite good if you go to excel first and then select Data-Import.

As this might not be possible but Account name would be a great extra information. So I can see what chars each player has at his disposal. But I think this maybe stored in another table. I dont know though.

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 1:07 am
by ragafury
that was fast. :O
many thanks. that makes stuff really easy now.
Spoiler:
other question not concerning this addon, but a "feature" I was used to have in WoW for warband / raidmanagement.

Is there a possibility to make something like a "Have a break, have a kit kat addon?"

was always handy in WoW. can broadcast a timer (e.g 5mins), everybody gets a 5 min countdown on his UI, and there was a possibility for ready checks (warband leader requests status, players can check a box or type a command and confirm that they are ready (or not), if they don't "awnser" in ~20 seconds you get a negative feedback, like "afk").

only handy for bigger grps, but still handy.

https://i.imgur.com/1Zlx2LX.png

yes, I know, godtier visualisation.

Thanks again!

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 9:10 am
by foghladha
I've made some upgrades to the mod on my end to export even more data.

My Modified Version GExport.lua:
---------------------------------------------------
function GExport.Export(input)

GuildMember = GetGuildMemberData()
TextLogDestroy("Export")
TextLogCreate("Export", 300)
TextLogSetEnabled("Export", true)
LogDisplaySetShowTimestamp("Export", false)
LogDisplaySetShowLogName("Export", false)
TextLogSetIncrementalSaving("Export", true, L"logs/export.txt")

nisse = "|"..tostring(GameData.Guild.m_GuildID).."|"..tostring(GameData.Guild.m_GuildName).."|"..tostring(GameData.Guild.m_GuildRank).."|"..tostring(GameData.Guild.m_GuildRenown).."|"..tostring(GameData.Guild.m_GuildExpCurrent).."|"..tostring(GameData.Guild.m_GuildExpNeeded).."\n"

for k in pairs(GuildMember) do
nisse = nisse..""..tostring(GuildMember[k].memberID).."|"..tostring(GuildMember[k].name).."|"..tostring(GuildMember[k].rank).."|"..tostring(GuildMember[k].careerString).."|"..tostring(GuildMember[k].statusNumber).."|"..tostring(GuildMember[k].titleString).."|"..tostring(GuildMember[k].lastLoginNumberYear).."-"..tostring(GuildMember[k].lastLoginNumberMonth).."-"..tostring(GuildMember[k].lastLoginNumberDay).."\n"
end
TextLogAddEntry("Export", 1245, towstring(nisse))
TextLogSaveLog("Export")
TextLogSetIncrementalSaving("Export", false, L"logs/export.txt")
EA_ChatWindow.Print(L"GuildRoster Exported to logs/export.txt")
end

---------------------------------------------------

I was wondering if anyone new a way to pull the current renown and exp of each player in the roster.