Ok I thought I would put a simple script into the forum again. :P
Name: Simple Multi Chat Bot
Description: Multi Chats for PtokaX
Developer: NightLitch
Date: 2007-05-06
Usage:
- Only operators can Add/Remove chats
- Simple functions for handling everything
- Edit the commands in script for own setup
- Requests for extending the script are welcome
Enjoy!
Quote from: Mutor on 06 May, 2007, 20:12:25
Users of this script should be aware it is ONLY for LUA 5.1
I think this is needless to say, since users are supposed to use versions that are supported officially.
Quote from: Mutor on 06 May, 2007, 22:59:46
Yeah, good thing they always do that.
Not always, but they are supposed to. However, I have seen a support requset for TD4 not so long ago. ;D
Quote from: Mutor on 06 May, 2007, 22:59:46
Is my sarcasm coming through OK?
Sure, as usual. :-P
i am getting the following errors
1)Simple.Multi.Chat.Bot.lua:125: attempt to index a nil value
2)Simple.Multi.Chat.Bot.lua:125: attempt to concatenate local 'to' (a table value)
This function is flawed:
[tCmd.JoinChat] = function(to,nick)
if not FindNickInChat(to, nick) then
GetItemByName(nick):SendData("$To: "..nick.." From: "..to.." $<"..to.."> *** You've joined the chat. Exit chat with: "..tCmd.ExitChat)
SendMsgToChat(to, to, "*** "..nick.." joined the chat.")
AddNickToChat(to, nick)
else
GetItemByName(nick):SendData("$To: "..nick.." From: "..to.." $<"..to.."> *** You've allready joined this chat.")
end
end,
[tCmd.ExitChat] = function(to,nick)
if FindNickInChat(to, nick) then
GetItemByName(nick):SendData("$To: "..nick.." From: "..to.." $<"..to.."> *** You've exit this chat.")
RemoveNickFromChat(to, nick)
SendMsgToChat(to, to, "*** "..nick.." has left the chat.")
end
end,