PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: 6Marilyn6Manson6 on 06 May, 2005, 14:52:17

Title: pm to user
Post by: 6Marilyn6Manson6 on 06 May, 2005, 14:52:17
-- pm-to by ??????Hawk??????
-- simple pm to bot
-- 28-01-2005
--## Converted in LUA 5 by 6Marilyn6Manson6 at 06/05/2005
-- Command   !pm    


bot = "PM-to"
function Main()
frmHub:RegBot(bot)
end

function ChatArrival(user, data)
if string.sub(data,1,1) == "<" then
data = string.sub(data, 1, (string.len(data)-1))
local s,e,command,sUser,msg = string.find(data, "%b<>%s+(%S+)%s*(%S*)%s*(.*)")
if command == "!pm"  then
if sUser ~= nil and msg ~= nil then
SendToNick(sUser, "$To: "..sUser.." From: "..bot.." $<"..bot.."> "..msg)
return 1
else
user.SendData(bot,"Command is !pm [user] [text]")
return 1
end
        end
end
end

c ya
Title:
Post by: DorianG on 06 May, 2005, 19:18:52
Whit function ChatArrival you can delete this string:
---> if string.sub(data,1,1) == "<" then