Can someboy shrink this 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

Can someboy shrink this script

Started by qaz, 23 June, 2005, 02:44:14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

qaz

(first, iam sorry for bad topic :( )

http://board.univ-angers.fr/thread.php?threadid=4187&boardid=26&sid=c219552736fd0e4b64d765fcdba756c9

the only thing i need from this awesome script is Mass Message to all... so can somebody shrink this script to fit my purpose.

Thanks for your help ?(
-:: Northwind a.k.a qaz ::-

bastya_elvtars

Will this do?

-- QDM (quick-and-dirty mass) by bastya_elvtars

masscmd="massmess" -- no ! needed

Bot="LawMakerBornAgain" -- use your hub bot's name

masslev=4 -- 1: all, 2: reg & above, 3: vip & above, 4: op & su, 5: su only

------------------------------------------------------------------------------------

userlevels={ [-1] = 1, [0] = 5, [1] = 4, [2] = 3, [3] = 2 } -- rights management, no need to edit unless you use robo


-- do not edit below
function massmsg(user,data,env)
	local _,_,message=string.find(data,"%b<>%s+%S+%s+(.+)")
	if message then
		for _,obj in frmHub:GetOnlineUsers() do
			obj:SendData("$To: "..obj.sName.." From: "..Bot.." $<"..user.sName.."> "..message)
		end
	else
		SendTxt(user,env,Bot,"Please write the message too, im not a politician to keep telling nothing...=)")
	end
end

function ChatArrival(user,data)
  data=string.sub(data,1,string.len(data)-1)
  local _,_,cmd=string.find(data,"%b<>%s+[%!%+%#](%S+)")
  if cmd==masscmd then
    if userlevels[user.iProfile]>=masslev then
      massmsg(user,data,"MAIN")
    else
      SendTxt(user,env,Bot,"You are not allowed...")
    end
    return 1
  end
end

function SendTxt(user,env,bot,text)
	if env=="PM" then
		user:SendPM(bot,text)
	else
		user:SendData(bot,text)
	end
end

function Main()
  frmHub:RegBot(Bot)
end
Everything could have been anything else and it would have just as much meaning.

qaz

#2
Works perfect, thank you bastya... you are allmost my personal hero  :P
-:: Northwind a.k.a qaz ::-

SMF spam blocked by CleanTalk