Timed mass message
 

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

Timed mass message

Started by Loading, 06 July, 2005, 00:19:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Loading

hello ppl

i have a timed mass message
but it only sends a message to unreg users

and i want to chose to profile i want the message goes to

like :

netfounder = 1
master = 0
moderator = 0
op = 1
vip = 1
reg = 1
user = 0

the script i have is thiss :
--Lua 5 By Dessamator(added message To Profile)

-- timed mass message from text by ?˜”??•Hawk•??”˜?

-- create a massmessage.txt file in the scripts directory

-- containing your message





SendEvery = 1   ----  time in hrs

textfile = "massmessage.txt"

bot = frmHub:GetHubBotName()

hrs = 1000 * 60 * 60 * SendEvery

ProfileNumber= -1 -- type here the profile u wish to send to




function Main()

	SetTimer(hrs)

	StartTimer()

end





function OnTimer()

	local handle = io.open(textfile, "r") 

	if (handle ~= nil) then 

                  Temptimerfile = "\r\n"

		for line in io.lines(textfile) do 

			Temptimerfile = Temptimerfile.."\r\n"..line

			io.read() 

		end 

		for pos,user in frmHub:GetOnlineUsers(ProfileNumber) do		

			user:SendPM(bot, Temptimerfile) 

		end

		io.close() 

	end 

end

and to tranform  this :

SendEvery = 1   ----  time in hrs

i want te timer im minutes if possible

Best regards

Loading

??????Hawk??????

#1
Not tested  let me know if  alls well  

--Lua 5 By Dessamator(added message To Profile)
-- timed mass message from text by ??????Hawk??????
-- create a massmessage.txt file in the scripts directory
-- containing your message


CanDo = { 
[0] = 1, -- Master 
[1] = 1, -- Operator 
[2] = 1, -- VIP 
[3] = 0, -- Reg 
[4] = 0, -- Moderator 
[5] = 1, -- Netfounder 
[-1] =0, -- User 
} 

SendEvery = 1   ----  time in Mins
textfile = "massmessage.txt"
bot = frmHub:GetHubBotName()
hrs = 1000 * 60 * SendEvery


function Main()
	SetTimer(hrs)
	StartTimer()
end





function OnTimer()
	local handle = io.open(textfile, "r") 
	if (handle ~= nil) then 
                 Temptimerfile = "\r\n"
		for line in io.lines(textfile) do 
			Temptimerfile = Temptimerfile.."\r\n"..line
			io.read() 
		end 
		for prf,sw in CanDo do
			if sw == 1 then
				for pos,user in frmHub:GetOnlineUsers(prf) do		
					user:SendPM(bot, Temptimerfile) 
				end
			end
		end
	end
	io.close() 
end

Loading

i get this error :

[23:40] Syntax E:\Programas\Ptokax 0.3.3.0.b17.04.nt.dbg\scripts\Timed Mass message.lua:96: `end' expected (to close `function' at line 63) near `'

Loading

??????Hawk??????

heheh you must have been  quick  i spotted the mistake as soon as i posted it  ..  

i edited the code..  

try again   :P  :P  :P  :P

Loading

hi

tanks hawk for the modifications

it works in the all profiles

tanks man

Best regards

Loading

??????Hawk??????


chettedeboeuf

Hi Hawks,
Is it possible to have the same script with more messages ??
And with command for add messages as '!addmess' ??

Thank you very much

TopCat

Hai everybody ,

I was looking for a script like this :)

Can someone change this script so it works for in main and not in pm please  :D

--Lua 5 By Dessamator(added message To Profile)
-- timed mass message from text by ??????Hawk??????
-- create a massmessage.txt file in the scripts directory
-- containing your message


CanDo = {
[0] = 1, -- Master
[1] = 1, -- Operator
[2] = 1, -- VIP
[3] = 0, -- Reg
[4] = 0, -- Moderator
[5] = 1, -- Netfounder
[-1] =0, -- User
}

SendEvery = 1   ----  time in Mins
textfile = "massmessage.txt"
bot = frmHub:GetHubBotName()
hrs = 1000 * 60 * SendEvery


function Main()
   SetTimer(hrs)
   StartTimer()
end





function OnTimer()
   local handle = io.open(textfile, "r")
   if (handle ~= nil) then
                 Temptimerfile = "\r\n"
      for line in io.lines(textfile) do
         Temptimerfile = Temptimerfile.."\r\n"..line
         io.read()
      end
      for prf,sw in CanDo do
         if sw == 1 then
            for pos,user in frmHub:GetOnlineUsers(prf) do      
               user:SendPM(bot, Temptimerfile)
            end
         end
      end
   end
   io.close()
end
???? TOPCAT'S HOUSE ????

topcat.no-ip.biz:411

Dessamator

change this
user:SendPM(bot, Temptimerfile)

to this
SendToAll((bot, Temptimerfile)
Ignorance is Bliss.

TopCat

Thx for your reaction Dessamator :)

Ive changed it but getting this error in de ptokax

[00:03] Syntax ...ings\Default\Mijn documenten\Forbiddenpalace\robo10\scripts\advertiser.lua:43: `)' expected near `,'
[00:03] Syntax advertiser.lua:43: `)' expected near `,'

I dont know what is wrong ,Ihope you can tell me ?  :D
???? TOPCAT'S HOUSE ????

topcat.no-ip.biz:411

SMF spam blocked by CleanTalk