1. Im writing an addon which adds a * to the officernote when its not wednesday. On wednesday the stars get counted and converted to a number.

    example. 5/4/3/5/*** ==> 5/4/3/5/3

    Now the adding of stars and the parsing is working. But i cant update the officernote on wednesday.

    function Attendance:DoActivity()

        SendChatMessage("Updating attendance now, please stay online during this" , "GUILD")

       

        --todo: wednesday parse

        if date("%A") == "Wednesday" then

            for i=1,GetNumGuildMembers(true) do

                officernoteParsed = ""

                name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i)

                if not (strfind(officernote,"*") == nil) then

                    officernoteParsed = strsub(officernote,1,strfind(officernote,"*")-1)  .. tonumber(strlen(officernote)-strlen(strsub(officernote,1,strfind(officernote,"*")-1))) .. "/"

                    self:Print(officernoteParsed)

                    GuildRosterSetOfficerNote(i,officernoteParsed .. "")

                else

                    officernoteParsed = officernote .. "0/"

                    self:Print(officernoteParsed)

                    GuildRosterSetOfficerNote(i,officernoteParsed)

                end

            end

        end

       

        for i=1,GetNumGuildMembers(true) do

            name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i)

            if online == 1 then

                smfUitvoer:AddMessage("Giving attendance to: " .. name, 0.0, 1.0, 0.0,20)

                GuildRosterSetOfficerNote(i,officernote .. "*")

            else

                smfUitvoer:AddMessage("No attendance for " .. name .. " since he/she is offline", 1.0, 0.0, 0.0, 20)

            end

        end

        smfUitvoer:AddMessage("_",0.0, 0.0, 0.0, 20)

        SendChatMessage("Attendance has been updated" , "GUILD");

    end

    So the 2nd for loop is working correcly. the first for loop is doin everyhting except the GuildRosterSetOfficerNote. Does anyone see the problem?

  2. Im writing an addon which adds a * to the officernote when its not wednesday. On wednesday the stars get counted and converted to a number.

    example. 5/4/3/5/*** ==> 5/4/3/5/3

    Now the adding of stars and the parsing is working. But i cant update the officernote on wednesday.

    function Attendance:DoActivity()

        SendChatMessage("Updating attendance now, please stay online during this" , "GUILD")

       

        --todo: wednesday parse

        if date("%A") == "Wednesday" then

            for i=1,GetNumGuildMembers(true) do

                officernoteParsed = ""

                name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i)

                if not (strfind(officernote,"*") == nil) then

                    officernoteParsed = strsub(officernote,1,strfind(officernote,"*")-1)  .. tonumber(strlen(officernote)-strlen(strsub(officernote,1,strfind(officernote,"*")-1))) .. "/"

                    self:Print(officernoteParsed)

                    GuildRosterSetOfficerNote(i,officernoteParsed .. "")

                else

                    officernoteParsed = officernote .. "0/"

                    self:Print(officernoteParsed)

                    GuildRosterSetOfficerNote(i,officernoteParsed)

                end

            end

        end

       

        for i=1,GetNumGuildMembers(true) do

            name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i)

            if online == 1 then

                smfUitvoer:AddMessage("Giving attendance to: " .. name, 0.0, 1.0, 0.0,20)

                GuildRosterSetOfficerNote(i,officernote .. "*")

            else

                smfUitvoer:AddMessage("No attendance for " .. name .. " since he/she is offline", 1.0, 0.0, 0.0, 20)

            end

        end

        smfUitvoer:AddMessage("_",0.0, 0.0, 0.0, 20)

        SendChatMessage("Attendance has been updated" , "GUILD");

    end

    So the 2nd for loop is working correcly. the first for loop is doin everyhting except the GuildRosterSetOfficerNote. Does anyone see the problem?

  3. OK, I did not fix your code (still learning here) but I did streamline it to make it more readable. http://pastey.net/111896 is what I did with it.

    Maybe either you or Mr Whitehead could explain why you have the boolean "true" in your GetGuildMembers() ...

  4. BTW, I think I missed a comma at the end of "online" on line 22. Should be

    local name, , , , , , , officernote, online, = GetGuildRosterInfo(i)

    And here is a very rough bit of code to figure out Wednesday: http://pastey.net/111897 You will probably have to tweak it.