PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: NightLitch on 06 May, 2007, 19:05:04

Title: Simple.Multi.Chat.Bot
Post by: NightLitch on 06 May, 2007, 19:05:04
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!

Title: Re: Simple.Multi.Chat.Bot
Post by: bastya_elvtars on 06 May, 2007, 22:28:17
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.
Title: Re: Simple.Multi.Chat.Bot
Post by: bastya_elvtars on 06 May, 2007, 23:06:54
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
Title: Re: Simple.Multi.Chat.Bot
Post by: Yahoo on 07 May, 2007, 19:06:25
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)
Title: Re: Simple.Multi.Chat.Bot
Post by: bastya_elvtars on 07 May, 2007, 19:22:07
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,