Post Sun Feb 02, 2014 1:44 pm

BFLogBot

Howdy!

I re-did BFLogBot in Bitfighter, but better: Now you can see if the message is in team chat, or not. It also should be more "economical". It's a levelgen too by the way.

And now, it creates the log file automatically in the screenshots folder in the same folder as the bitfighter.ini.

Happy Logging!

  Code:
-- BFLogBot 1.0
-- by fordcars

function main()
    subscribe(Event.MsgReceived)

    -- Constants
    logFile = "bfLog.txt"

    -- Start
    writeToFile(logFile,"-----------------------------------------------\n",true)
end

function onMsgReceived(message, sender, global)
    if(message ~= nil and sender ~= nil and global ~= nil) then
        local tempString = ""

        if(global) then
            tempString = sender:getName() .. ": " .. message .. "\n"
            writeToFile(logFile,tempString,true)
        else
            tempString = sender:getName() .. " (team chat): " .. message .. "\n"
            writeToFile(logFile,tempString,true)
        end
    end
end
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.