PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Twix on 27 October, 2003, 02:51:34

Title: PMtoOps
Post by: Twix on 27 October, 2003, 02:51:34
Hi

I'm after a script, or piece of code that will create a PMtoOp user, so users can send it a PM and the message appears in opchat. If possible, I would like it to reply to the user saying the message has been sent.

TIA

Twix
Title:
Post by: raz on 27 October, 2003, 14:27:20
here u go.
botname = "{?2?M}?Pm-To-Ops"
chatbotname = "{?2?M}?OpChat"

function Main()
frmHub:RegBot(botname)
frmHub:RegBot(chatbotname)
end

function DataArrival(user,data)
if (strsub(data, 1, strlen(botname) + 5) == "$To: "..botname) then
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
_,_,message = strfind(data,"$%b<>%s+(.+)")
SendPmToOps(chatbotname, "<"..user.sName.."> "..message)
end
end
:D
Title:
Post by: Twix on 27 October, 2003, 15:03:14
Thnx, works like a charm  :]