PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: osse on 16 October, 2006, 22:59:49

Title: [Split][Request]Mass message script
Post by: osse on 16 October, 2006, 22:59:49
I'll not the timer just the message ones.. would u plz help me

:D:D
Title: [Split][Request]Mass message script
Post by: bastya_elvtars on 17 October, 2006, 01:42:46
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
Title: [Split][Request]Mass message script
Post by: osse on 17 October, 2006, 15:17:43
yes plzzzzzzzzzzzz... Please I write plz if u see....:D:D ;D
Title: [Split][Request]Mass message script
Post by: bastya_elvtars on 17 October, 2006, 16:10:40
I am lost now.
Title: [Split][Request]Mass message script
Post by: osse on 17 October, 2006, 16:14:51
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
Title: [Split][Request]Mass message script
Post by: bastya_elvtars on 17 October, 2006, 17:37:32
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?
Title: [Split][Request]Mass message script
Post by: osse on 17 October, 2006, 18:37:23
Yes. plz..like timed mass message but just 1 time..not more-- ;D ;D ;D
Title: [Split][Request]Mass message script
Post by: Thor on 17 October, 2006, 19:27:40
Code (Lua) Select
function NewUserConnected(curUser)
    if not curUser.bRegistered then
        curUser:SendData(frmHub:GetHubBotName(),"This is an example message to unregistered users.")
    end
end
Title: [Split][Request]Mass message script
Post by: osse on 17 October, 2006, 21:45:39
 :(

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 =
{
Title: [Split][Request]Mass message script
Post by: Thor on 17 October, 2006, 22:24:51
Then ->click here<- (http://forum.ptokax.org/index.php?topic=6313.0)
Title: [Split][Request]Mass message script
Post by: osse on 18 October, 2006, 19:32:00
If u look the script above. I want something like that. But without timer ...

plz..
Title: Re: [Split][Request]Mass message script
Post by: Thor on 18 October, 2006, 20:01:14

Code (lua) Select
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 ;)
Title: Re: [Split][Request]Mass message script
Post by: [HE]Newbie on 19 October, 2006, 13:14:37
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
Title: Re: [Split][Request]Mass message script
Post by: osse on 19 October, 2006, 15:47:46
Quote from: Hungarista on 18 October, 2006, 20:01:14

Code (lua) Select
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:???
Title: Re: [Split][Request]Mass message script
Post by: [HE]Newbie on 19 October, 2006, 18:14:38
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
Title: Re: [Split][Request]Mass message script
Post by: osse on 19 October, 2006, 18:35:22
 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)
Title: Re: [Split][Request]Mass message script
Post by: Thor 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.
Title: Re: [Split][Request]Mass message script
Post by: osse on 19 October, 2006, 19:27:57
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
Title: Re: [Split][Request]Mass message script
Post by: Herodes on 19 October, 2006, 20:23:46
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.
Title: Re: [Split][Request]Mass message script
Post by: [HE]Newbie on 19 October, 2006, 20:36:08
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 ;)
Title: Re: [Split][Request]Mass message script
Post by: osse on 20 October, 2006, 16:49:48
THNX it working now..

:D:D:D:D