PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Smulf on 07 February, 2004, 13:41:01

Title: Config Mass M
Post by: Smulf on 07 February, 2004, 13:41:01
Hi;

Is it posible to config this script so it sends a PM in a sepret window and not in the main window...
It would also be nice if it didn't wrote: "Private message from Mass MGS from OPname: TEXT", but only: " TEXT"

--Mass Message bot made by SRJbb99 for the [?] network(?[?] Network Solutions 2003)

Bot= "Mas MGS"

function DataArrival(user, data)
if(user.bOperator and strsub(data, 1, strlen(user.sName)+8) == "<"..user.sName.."> mass ") then
SendPmToAll("Mass MGS from " ..user.sName, strsub(data, strlen(user.sName)+9))
end
end


Thanks for your time...
Title:
Post by: NightLitch on 07 February, 2004, 13:51:17
add this to your bot:

function Main()
frmHub:RegBot(Bot)
end

/NL
Title:
Post by: Smulf on 07 February, 2004, 14:02:43
Thanks for the fast reply NL. But it didn't changed anything, have I done it correctly:

--Mass Message bot made by SRJbb99 for the [?] network(?[?] Network Solutions 2003)

Bot= "Mas MGS"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user, data)
if(user.bOperator and strsub(data, 1, strlen(user.sName)+8) == "<"..user.sName.."> mass ") then
SendPMToAll("Mass MGS from " ..user.sName, strsub(data, strlen(user.sName)+9))
end
end


It still writes "Private message from Mass MGS from OPname:   TEXT"
Title:
Post by: NightLitch on 07 February, 2004, 14:15:15
--Mass Message bot made by SRJbb99 for the [?] network(?[?] Network Solutions 2003)
-- Tiny mod by NightLitch

Bot= "Mas MGS"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user, data)
if(user.bOperator and strsub(data, 1, strlen(user.sName)+8) == "<"..user.sName.."> mass ") then
SendPMToAll(Bot," from " ..user.sName, strsub(data, strlen(user.sName)+9))
end
end

this should be right for you
Title:
Post by: Smulf on 07 February, 2004, 14:26:39
Syntax Error: attempt to call global `SendPMToAll' (a nil value)

No error if I press Check Syntax, but when I write "mass " in the main nothing happens and it gives this error in PtokaX...
Title:
Post by: VidFamne on 07 February, 2004, 14:41:53
Try;  SendPmToAll