Автор: prokazzza 10.6.2010, 15:55
Есть скрипт от Chat_History:
CODE
-- This script is converted with PtokaX LUA API Converter v0.9 at 01/17/08 15:57:18
--Chat History On Entry 1.02 LUA 5
--By Mutor The Ugly 4/14/04
--
--Based on a script by Tezlo 1/17/04
--Send chat history to PM on entry
--Перевел и конвертировал в LUA 5.1 X-Ray 01/06/2006
-- +Converted to LUA 5 2/22/05
-----------------------------------------------------------
chatfile = "scripts/Chat_History/chathistory.dat" -- путь до файла данных
maxhistory = 10 -- максимум строк чата для хранения в кеше
botname = "История_чата" -- имя бота
BadChars = {".","?","!","+","-",} -- разрешенные префиксы
function OnStartup()
chathistory = dofile(chatfile) or {}
Core.RegBot(botname,"","",true) -- Comment this line to not have bot appear in user list. Note: If botname is not registered, default dc++ settings will not allow pm's to pop up
-- Enable Pop up messages from offline users / Disable ingnore messages from offline in client 'advanced dc settings'. To allow pop from unregistered botname.
end
function OnExit()
savehistory()
end
function UserConnected(user)
Core.GetUserAllData(user)
local n = #chathistory
local str = " \r\n"
for i = 1, n do str = str.."\r\n"..chathistory[i] end
Core.SendToNick(user.sNick,"<"..botname.."> "..str.."\r\n") -- в Main
-- user:SendPM(botname,str.."\r\n") -- в PM
-- Core.SendToNick(user.sNick,"<"..botname.."> <»«»«»«»«»«»«»«»«»«[ Конец истории чата ]»«»«»«»«»«»«»«»«»«>")
-- user:SendPM(botname,"<»«»«»«»«»«»«»«»«»«[ Конец истории чата ]»«»«»«»«»«»«»«»«»«>")
end
OpConnected = UserConnected
function ChatArrival(user,data)
Core.GetUserAllData(user)
if string.sub(data, 1, 1) ~= "<" then end
local s,e,pre = string.find(data, "^%b<> (.)")
local when = os.date("[%H:%M] ")
local chat = string.sub(data, 1, -2)
if data:match"%b<> is kicking " then
data = data:sub("kicking", "kiсking")
end
for k,v in pairs(BadChars) do
if pre == v then -- disallow command input to cached chat
return
end
end
table.insert(chathistory,when..chat)
if #chathistory > maxhistory then table.remove(chathistory, 1) end
savehistory()
end
function savehistory()
local f,e = io.open( chatfile, "w+" )
if f then
f:write( "return {\n" )
for i = 1, #chathistory do
f:write( "\t"..string.format("%q", chathistory[i])..",\r\n" )
end
f:write( "}" )
f:close()
return 1
else
return nil,"savehistory failed: "..e
end
end
function loadfile(chatfile)
local f,e = io.open( chatfile, "r" )
if f then
local r = f:read( "*a" )
f:close()
return r
else
return nil,"loadfile failed: "..e
end
end
RegConnected = UserConnected
Помогите плиз убрать бота из списка юзеров.
Вопрос решён! Тема удалена.
Автор: Accelerator 10.6.2010, 17:11
Поставь перед
Код
Core.RegBot(botname,"","",true) -- Comment this line to not have bot appear in user list. Note: If botname is not
Цитата
--
или
Код
botname = "История_чата" -- имя бота
меняем на
Код
botname = SetMan.GetString(21)