BFLogBot
Posted: Wed Apr 03, 2013 6:17 pm
Sorry, I was bored again :/
This bot will log everything said in chat. Make sure that you create a file called "bflog.txt" and write the path to that file in the code, where it says so
Examples:
Happy bitting!
BOT CODE:
This bot will log everything said in chat. Make sure that you create a file called "bflog.txt" and write the path to that file in the code, where it says so
Examples:
Happy bitting!
BOT CODE:
- Code:
- ---------BFLogBot
---------by fordcars
function getName() -- Called once
return("BFLogBot")
end
function main() -- This is the first code ran, after loose code
playerShip = nil
subscribe(Event.MsgReceived)
file = nil
file = io.open("ENTER TXT PATH HERE", "a+")
file:write("---------------------------------- \n")
file:close()
end
function onMsgReceived(message, player)
file = io.open("ENTER TXT PATH HERE", "a+")
if (player:getName() == nil) then
file:write("UNKNOWN: " .. message .. "\n")
file:close()
return
else
playerShip = player:getName()
file:write(playerShip .. ": " .. message .. "\n")
file:close()
return
end
end