need a simple PM2OP script
 

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

need a simple PM2OP script

Started by Bumbi, 05 April, 2007, 13:07:41

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bumbi

Hi
I need a simple Pm2op script so my users can send a message to opchat when they need to reg som friends into my hub. Did have that when I was running Robocop. Can someone help me?

Regards Bumbi  ::)

Leun

#1
Use the search button!!!
There are already such kind of scripts, only not all of them are called pm2ops.

But, I?ve made a very small script for you, for little help ( during my training periode, so I didn?t test it).

Greetz,

--very simple account request bot
-- made in 10  min :-)
-- Didn't test it !!!!

-- The profiles can PM the Bot
sProfiles = {
[-1] = 1,  -- Users
[0] = 0,   -- Masters
[1] = 0,   -- OPs
[2] = 0,   -- VIPs
[3] = 0,   -- REGs
[4] = 0,   -- MODs
[5] = 0,   -- Founders
}

-- Profiles who receive feed
gProfiles = {
[-1] = 0,  -- Users
[0] = 1,   -- Masters
[1] = 1,   -- OPs
[2] = 0,   -- VIPs
[3] = 0,   -- REGs
[4] = 1,   -- MODs
[5] = 1,   -- Founders
}

tSettings = {
	sBot = "Pm2ops",
	sPrefix = "#",
	sCmd = "regme"
}
function Main() 
	frmHub:RegBot(tSettings.sBot)
end

function ChatArrival(curUser,data)
	local data = string.sub(data,1,-2)
	s,e,cmd = string.find(data,"%b<>%s+(%S+)")
	if sProfiles[curUser.iProfile] == 1 then
		if cmd and (cmd== tSettings.sPrefix..tSettings.sCmd) then
			local _,_,sPass = string.find(data,"%b<>%s+%S+%s+(%S+)")
			if sPass then
				SendToPMtoOps("Dear Operators user "..curUser.sName.." wants to be registered can some one help! Password: "..sPass)
				curUser:SendData(tSettings.sBot, "Your request is send to all Operators, they will register you as soon as possible, if you agree with the rules!!")
			else
				curUser:SendData(tSettings.sBot, " *** You have to provide a password!")
			end
		end	
		
	end
end

function ToArrival(curUser,data)
	data = string.sub(data,1,-2)
	local _,_,whoto,data = string.find(data,"$To:%s+(%S+)%s+From:%s+%S+%s+$%b<>%s+(.*)")
	if (whoto == tSettings.sBot) then
		if sProfiles[curUser.iProfile] == 1 then
			SendToPMtoOps("User: <"..curUser.sName.."> needs help: "..data)
		end
	end
end	

function SendToPMtoOps(msg)
	for i,v in frmHub:GetOnlineUsers() do
		if gProfiles[v.iProfile] == 1 then
			v:SendPM(tSettings.sBot,msg)
		end
	end
end

Cêñoßy†ê

Or  try this ..
Not tested either ;)
Code: lua
--[[
	Pm to bot sends message to opchat
]]--

Bot = "PM_to_OPs"

Main = function() 
	frmHub:RegBot(Bot,1,"PM me to give message to all operators","")
end

ToArrival = function(user,data)
	data = string.sub(data,1,-2)
	local _,_,to,msg = string.find(data,"$To:%s+(%S+)%s+From:%s+%S+%s+$%b<>%s+(.*)")
	if to == Bot then
		SendToOpChat("Message from: <"..user.sName.."> -> "..msg)
		user:SendPM(Bot,"Your message is send to all Operators, they will get back to you when they have readed the message.")
	end
end
Powered By Leviathan™ 2nd Generation v. 1.9

Bumbi

Thanks C??o?y??
Working great

Bumbi

SMF spam blocked by CleanTalk