Ranking
Original Post
Chat Bot
Hello. I was wondering how i could make a chat bot. So if someone put !help in chat it would show a list of commands they could do for example !spec would put them in spectators or !mytc would tell them how much TC they have. For the chat bot i want to make it would need to be able to read the amount of TC someone has and it would need to be able to detect when someone does a command in chat. The bot i am trying to make will be similar to frans old bet bot, the one that manages nudges, fukes, etc.

Also, it would be great if someone could send me a link of all the toribash lua functions and stuff like that, i am experienced in c# code so all i need to learn for lua is the syntax and functions. Thanks!
Several lua documentations can be found online. Documentation for most important custom functions of Toribash can be found in the data/script/sdk folder.

What you are looking for is the "add_hook" functions and the "console" hook. These let you register a function that is called everytime something is written to the console. E.g:

local function echoStuff(code, msg)
    echo(code)
    echo(msg)
end

add_hook("console", "", echoStuff)
This will call echoStuff everytime before a message is displayed in the console and simply print it's code (which can be used to identify the type of message (normal chat message, whisper, etc)) and the message itself. This will still print the original message, so it will appear twice. If you want to prevent that, simply add "return 1" before "end"

I could be wrong about the order of arguments, better test that yourself.

There are lots of different hooks. You can find a list in data/script/startup.lua. You wont need any appart from "console" for this project though.

Another function you will need is "run_cmd". It lets you execute (almost) any console command you can enter yourself. So run_cmd("ls foo.lua") will load the foo.lua script. I think that can be used to chat via the "/say" command, e.g.: run_cmd("say Hello World!"). I'm not 100% sure if this will work though. It could be that "/say" is one of the commands you can't execute with run_cmd.

I don't think you can find out how many TC a player has via lua.
Signature temporarily out of order.