[Split][Request]Mass message 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

[Split][Request]Mass message script

Started by osse, 16 October, 2006, 22:59:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

osse

I'll not the timer just the message ones.. would u plz help me

:D:D

bastya_elvtars

Quote from: osse on 16 October, 2006, 22:59:49
I'll not the timer just the message ones.. would u plz help me

Please? :o
Everything could have been anything else and it would have just as much meaning.

osse

yes plzzzzzzzzzzzz... Please I write plz if u see....:D:D ;D

bastya_elvtars

Everything could have been anything else and it would have just as much meaning.

osse

There is a Timed mass message and i want it not timed just send a mass message to unreg ..when they are login

please..plz...thnx 4 ur help.... ;D

bastya_elvtars

Quote from: osse on 17 October, 2006, 16:14:51
please..plz...thnx 4 ur help.... ;D

So you want a script to send the unregs a PM when they eenter the hub?
Everything could have been anything else and it would have just as much meaning.

osse

Yes. plz..like timed mass message but just 1 time..not more-- ;D ;D ;D

Thor

Code: Lua
function NewUserConnected(curUser)
    if not curUser.bRegistered then
        curUser:SendData(frmHub:GetHubBotName(),"This is an example message to unregistered users.")
    end
end

osse

 :(

The message is with a file text like timed mass massage not a simple mess..

look this mass mess med text ( file ) but not with a timer ..

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

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

CanDo =
{
  • = 1, -- Master
    [1] = 1, -- Operator
    [2] = 1, -- VIP
    [3] = 1, -- Reg
    [4] = 1, -- 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 then
          Temptimerfile = "\r\n"..string.gsub(handle:read("*a"),string.char(10), "\r\n")
          for _,user in ipairs (frmHub:GetOnlineUsers()) do
             if CanDo[user.iProfile]==1 then
                user:SendPM(bot, Temptimerfile)
             end
          end
          handle:close()
       end
    end


Thor


osse

If u look the script above. I want something like that. But without timer ...

plz..

Thor

#11

Code: lua
textfile = "unreg.txt" -- put the file into the scripts folder
 
function NewUserConnected(curUser)
    if not curUser.bRegistered then
        local f = io.open(textfile, "r")
        if f then
            local contents = "\r\n"..string.gsub(f:read("*a"),string.char(10), "\r\n")
            curUser:SendPM(frmHub:GetHubBotName(), contents)
        f:close()
        end
    end
end



That's all ;)

[HE]Newbie

I hope this does what you want:)

--[[ 

	Masser v1.0
	???????????

	CREDITS:
	????????
	Hungarista : for the Reading part of this script

	RECENT CHANGELOG:
	?????????????????
	- None

]]-- 


Settings = {
	["Botname"] = "Masser",
	["Botdescription"] = "Masser script v1.0 by Newbie",
	["Botemail"] = "Masser",
}

Textfile = "Mass.txt" -- The file wich will be send


function Main()
	frmHub:RegBot(Settings["Botname"], 1, Settings["Botdescription"], Settings["Botemail"])
end

function NewUserConnected(User)
	if not User.bRegistered then
		local f = io.open(Textfile, "r")
	if f then
		local contents = "\r\n"..string.gsub(f:read("*a"),string.char(10), "\r\n")
	User:SendPM(Settings["Botname"], contents)
	f:close()
		end
	end
end
There will be 1 day, that i learn

nlgezel.hopto.org:411

osse

Quote from: Hungarista on 18 October, 2006, 20:01:14

Code: lua
textfile = "unreg.txt" -- put the file into the scripts folder
 
function NewUserConnected(curUser)
    if not curUser.bRegistered then
        local f = io.open(textfile, "r")
        if f then
            local contents = "\r\n"..string.gsub(f:read("*a"),string.char(10), "\r\n")
            curUser:SendPM(frmHub:GetHubBotName(), contents)
        f:close()
        end
    end
end



That's all ;)

Thnx ..:D
that the one I wnat it..

if I wanna send the messs in main ???
where I change it ??

curUser:SendPM(frmHub:GetHubBotName(), contents)  .....to curUser:???

[HE]Newbie

#14
Quote from: osse on 19 October, 2006, 15:47:46
Thnx ..:D
that the one I wnat it..

if I wanna send the messs in main ???
where I change it ??

curUser:SendPM(frmHub:GetHubBotName(), contents)  .....to curUser:???


Try to change it with : SendToAll(frmHub:GetHubBotName(), contents) -- Sends it to all users
or you can try to change it to : curUser:sendData(frmHub:GetHubBotName(), contents) -- Sends it to the user who connects
There will be 1 day, that i learn

nlgezel.hopto.org:411

osse

 curUser:sendData(frmHub:GetHubBotName(), contents) -- Sends it to the user who connects

if I use the above commandline i got this message

Syntax ...0061016_1\ptokax\scripts\unregmess1.lua:16: attempt to call method 'sendData' (a nil value)

Thor

If you don't know the API, your best friend is the PtokaXwiki. Check this:
http://ptxwiki.psycho-chihuahua.net/doku.php/scriptinghelp/ptokaxapi#senddata_fromnick_data
So, you have to use curUser:SendData, because it is case-sensitive.

osse

Quote from: Hungarista on 19 October, 2006, 18:42:15
If you don't know the API, your best friend is the PtokaXwiki. Check this:
http://ptxwiki.psycho-chihuahua.net/doku.php/scriptinghelp/ptokaxapi#senddata_fromnick_data
So, you have to use curUser:SendData, because it is case-sensitive.

I do not know..just wanna know how to send data in main....I got the answer how to send data in PM

Thnx for ur help

// B

Herodes

Quote from: osse on 19 October, 2006, 19:27:57
I do not know..just wanna know how to send data in main....I got the answer how to send data in PM

Thnx for ur help

// B
You took the answer for the sending in main too .. look again at the post of Hungarista.

[HE]Newbie

textfile = "unreg.txt" -- put the file into the scripts folder
 
function NewUserConnected(curUser)
    if not curUser.bRegistered then
        local f = io.open(textfile, "r")
        if f then
            local contents = "\r\n"..string.gsub(f:read("*a"),string.char(10), "\r\n")
            curUser:SendData(frmHub:GetHubBotName(), contents)
        f:close()
        end
    end
end


This works for me ;)
There will be 1 day, that i learn

nlgezel.hopto.org:411

osse


SMF spam blocked by CleanTalk