chatroom bot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

chatroom bot

Started by jsjen, 15 April, 2004, 14:08:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jsjen

We have a chatroom, is it possible to have a chat bot in there to answer newbie questions and just general chat when they say a word?.

Also can we show the last 20 lines of chat when someone logs in??


Thanks Jason

currently use this for chatroom

-- Chat-Room
-- Original VipChat v1.0
-- By Guibs 10/11/2003
-- Enjoy :)
-- Simple Modify by NightLitch
-- to Master Bot Only
-- Simple Mod by SaintSinner thanks to phatty and plop and NL for the hints.
-- Simple Modify by WickeD to ChatRoom for User/Reg/Vip/Moderator/Op/Admin/Master.




function Main()
ChatRoom = "ChatRoom"
frmHub:RegBot(ChatRoom)
end
Levels= { [-1]=0,[0]=0,[1]=0,[2]=0,[3]=0,[4]=0,[5]=0}
------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
if(strsub(data,1,4) == "$To:") then
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if whoTo == ChatRoom then
if Levels[user.iProfile] then
s,e,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
MasterChatRoom(user,msg)
elseif Levels[user.iProfile] == nil then
user:SendPM(ChatRoom, "That chat is for, User/Reg/Vip/Moderator/Op/Admin/Master. Your message has not been sent.")

end
end
end
end


function MasterChatRoom(user,msg)
local allprofiles = GetProfiles()
local index, profile, index2, nick
for index, profile in allprofiles do
local users = GetUsersByProfile(profile)
for index2, nick in users do
local usr = GetItemByName(nick)
if usr ~= nil then
if user.sName == usr.sName then
else
if Levels[user.iProfile] then
usr:SendData("$To: "..usr.sName.." From: "..ChatRoom.." $<"..user.sName.."> " ..msg)


end
end
end
end
end
end



nErBoS

Hi,

It?s possible to do but the script would only respond to exactly pharses, or words, but if you do a search in words the script could be always be answering even when is not need.

In my opinion why do not make a file with F.A.Q. then users could se a file by a command, would be much easear and last heavy to your line.

Best regards, nErBoS
--## nErBoS Spot ##--

jsjen

can we get the chatroom bot to send a pm to people who log in to show them last 20 lines of chat?

I have a script running for the main chat but cause it lags so much somedays people use chatroom.

one question why does main chat lag some times? and chatroom doesnt?

plop

QuoteOriginally posted by jsjen
can we get the chatroom bot to send a pm to people who log in to show them last 20 lines of chat?

I have a script running for the main chat but cause it lags so much somedays people use chatroom.

one question why does main chat lag some times? and chatroom doesnt?
sounds like or a bug on the scripts you are running.
if you pm 2 a bot/chatroom it doesn't get checked by the other scripts you are running and so use less resources.

can you give some system specs + the names of the scripts you are running?

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

jsjen

mm specs.

machine p4 2.4, 500meg ram,on 256 dsl connection.

hub running ptokaX 0.326

bots in hub are

chatroom.lua   C: 80   T: 85
historian.lua   C: 78   T: 91
leacher.lua   C: 77   T: 111
UserHelperBot.lua   C: 56   T: 86
removeuser.lua   C: 102   T: 143
RoboCopv7.0a.lua   C: 645   T: 697
sharegrowth.lua   C: 86   T: 109

Do any of these bots do the same job?

plop

ment the real names of the scripts, not the filenames.
forgot 2 ask the amount of users you have.

leacher.lua C: 77 T: 111  -- leech blocker i guess.

maby try removing some of the scripts and add them 1 by 1, then you might find which script is causing the lag.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

jsjen

We change the names of our bots to suit the hub. Did you want the origional names?

Yes it is a leech blocker.

We have maybe 40 people at any one time, I know really small hub. But the complain about the 5-10 second lag, so I got the chatroom bot and it didnt lag.

I removed all bots and it seemed a little better.

Thanks for your help.

plop

QuoteOriginally posted by jsjen
I removed all bots and it seemed a little better.
wait a sec, is the database from ptokax enabled??
if so try flushing the database or even disable it (hub restart needed).

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

jsjen

that seems to work, but occasionally I get a few seconds lag which I dont usually get with tha hub on my pc.

Thanks for your help

jsjen

I was wondering if I could still ask for this.

I wish the chatroom to have a chat history that would show last chats when a registered user enteres the hub

I hope this would be possible

J

SMF spam blocked by CleanTalk