PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: OpiumVolage on 10 October, 2003, 23:48:38

Title: A second chat on your hub.
Post by: OpiumVolage on 10 October, 2003, 23:48:38
botName = "SecondChat"
tabUsers = {}

function Main() frmHub:RegBot(botName) end
function OpConnected(user, data) tinsert(tabUsers, user.sName) end
function OpDisConnected(user, data) tremove(tabUsers, user.sName) end
function NewUserConnected(user, data) tinsert(tabUsers, user.sName) end
function UserDisConnected(user, data) tremove(tabUsers, user.sName) end

function DataArrival(user, data)
if strsub(data, 1, 3) == "$To" then
local s, e, to, what = strfind(data, "^%$To: (%S+) From: %S+ %$(.*)")
if s and to == botName then
for i=1, getn(tabUsers) do
if not (tabUsers[i] == user.sName) then
SendToNick(tabUsers[i], "$To: "..tabUsers[i].." From: "..botName.." $"..what)
end
end
return 1
end
end
end
Title:
Post by: piglja on 11 October, 2003, 14:14:21
hmm, Opium, and is it working when scripts are restarted?:)
Title:
Post by: OpiumVolage on 15 October, 2003, 16:19:52
No it doesn't work when scripts are restarted :)
Idea to do so whitout using a file, is to parse the $MyINFO's and $GetInfo seen on the hub, and update tabUsers. Do i need to say that an associative table seem more adapted to do this ? ;)
Title:
Post by: BlazeXxX on 21 October, 2003, 12:04:34
Hmm Is it possible ot make it , so Only ppl who types +join would enter this chat and +part would log off them from that chat..

someone did a chat like this b4, but it was only workin on TD versions :'( If possible, could you create one like that, that works in IceCube IV versions pls ?

Thx..
Title:
Post by: ptaczek on 21 October, 2003, 13:24:56
QuoteOriginally posted by BlazeXxX
Hmm Is it possible ot make it , so Only ppl who types +join would enter this chat and +part would log off them from that chat..

someone did a chat like this b4, but it was only workin on TD versions :'( If possible, could you create one like that, that works in IceCube IV versions pls ?

Thx..

Hi, do you have that script for TD4? I would like to see what's so special on it. Between TD4 a nd IceCube scripting API should not be so big difference.
Title:
Post by: BlazeXxX on 21 October, 2003, 15:10:30
Hmm Yea.. I tried with IceCube version and it was repeating msgs more than 5 times to each users, even if they reconnect..

I asked [asx] Wellx abt this, he said its only compatible with TD3 and 4..

If u want , pls leave a pm to me in forum.. I will send that script over :)
Title:
Post by: [ES]latinmusic on 21 October, 2003, 17:10:09
QuoteOriginally posted by BlazeXxX If u want , pls leave a pm to me in forum.. I will send that script over :)
Anw what about to post the script here, or is something classified?