All i need in this chat is a message that will tell a NoN-Reg when he trys to pm it the message below and not actaually send the message
This chat is for registered users only. Your message has not been sent.
Quote-- Date: 01-09-2003
--
-- code from klownietklowniet
-- network: [ > DC - UniteD < ]
--
-- Request by peter
--
-- A simple SU (Master) chat
-- 02-09-2003: changed the script abit so all (ReGS, VIPs, OPs and SUs) can chat. (Request by BlazeXXX)
BotName = ".:ReG~OnLy ChAt:."
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(curUser,data)
local MessageRecognized = 0
if isPM(data)==1 then
whoto,from,message=ParsePM(data)
MessageRecognized=1
end
if MessageRecognized==1 and whoto==BotName and (curUser.iProfile>=0 and curUser.iProfile<=4) then
local sus=GetUsersByProfile("Master")
local ops=GetUsersByProfile("Operator")
local vips=GetUsersByProfile("VIP")
local regs=GetUsersByProfile("REG")
for i, n in sus do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in ops do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in vips do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in regs do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
end
end
function ParsePM(data)
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
message = strsub(message,1,strlen(message)-1)
return whoTo,from,message
end
function isPM(data)
if( strsub(data, 1, 3) == "$To" ) then
return 1
else
return 0
end
end
[/SIZE]
Haven't tested it but try this:
-- Date: 01-09-2003
--
-- code from klownietklowniet
-- network: [ > DC - UniteD < ]
--
-- Request by peter
--
-- A simple SU (Master) chat
-- 02-09-2003: changed the script abit so all (ReGS, VIPs, OPs and SUs) can chat. (Request by BlazeXXX)
BotName = ".:ReG~OnLy ChAt:."
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(curUser,data)
local MessageRecognized = 0
if isPM(data)==1 then
whoto,from,message=ParsePM(data)
MessageRecognized=1
end
if MessageRecognized==1 and whoto==BotName and (curUser.iProfile>=0 and curUser.iProfile<=4) then
local sus=GetUsersByProfile("Master")
local ops=GetUsersByProfile("Operator")
local vips=GetUsersByProfile("VIP")
local regs=GetUsersByProfile("REG")
for i, n in sus do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in ops do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in vips do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in regs do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
else
curUser:SendPM(BotName, "This chat is for registered users only. Your message has not been sent.")
end
end
end
function ParsePM(data)
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
message = strsub(message,1,strlen(message)-1)
return whoTo,from,message
end
function isPM(data)
if( strsub(data, 1, 3) == "$To" ) then
return 1
else
return 0
end
end
whoa already back i naction your great by the way while you werent looking i modified it a little i added the REGS profile but thanks ill let you kno if it works
I modified or added to the script that was posted here, did notice the little change... looking good... ;-)
Syntax Error: `end' expected (to close `for' at line 57);
last token read: `else' at line 63 in string "--
..."
Quote--
-- Creator: klownietklowniet
-- Network: [ > DC - UniteD < ]
--
-- Request by Peter
--
-- Edits by R?P?FF?
--
-- A VIP and Higher chat
-- 02-09-2003: klownietklowniet changed the script abit so all (VIPs, OPs and SUs) can chat. (Request by BlazeXXX)
-- 19-10-2003: R?P?FF? added the reg profile in it so now regs are included in script. (Request by Me)
-- 19-10-2003: klownietklowniet added a message so when non reg users pm it, it will respond and act on the message
-- "This chat is for registered users only. Your message has not been sent." (Request by R?P?FF?)
BotName = ".:ReGs~OnLy ChAt:."
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(curUser,data)
local MessageRecognized = 0
if isPM(data)==1 then
whoto,from,message=ParsePM(data)
MessageRecognized=1
end
if MessageRecognized==1 and whoto==BotName and (curUser.iProfile>=0 and curUser.iProfile<=4) then
local sus=GetUsersByProfile("Master")
local ops=GetUsersByProfile("Operator")
local vips=GetUsersByProfile("VIP")
local regs=GetUsersByProfile("REG")
for i, n in sus do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in ops do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in vips do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in regs do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
else
curUser:SendPM(BotName, "This chat is for registered users only. Your message has not been sent.")
end
end
end
function ParsePM(data)
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
message = strsub(message,1,strlen(message)-1)
return whoTo,from,message
end
function isPM(data)
if( strsub(data, 1, 3) == "$To" ) then
return 1
else
return 0
end
end
Hehe.. my bad... easier when it's tabbed properly:
-- Creator: klownietklowniet
-- Network: [ > DC - UniteD < ]
--
-- Request by Peter
--
-- Edits by R?P?FF?
--
-- A VIP and Higher chat
-- 02-09-2003: klownietklowniet changed the script abit so all (VIPs, OPs and SUs) can chat. (Request by BlazeXXX)
-- 19-10-2003: R?P?FF? added the reg profile in it so now regs are included in script. (Request by Me)
-- 19-10-2003: klownietklowniet added a message so when non reg users pm it, it will respond and act on the message
-- "This chat is for registered users only. Your message has not been sent." (Request by R?P?FF?)
BotName = ".:ReGs~OnLy ChAt:."
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(curUser,data)
local MessageRecognized = 0
if isPM(data)==1 then
whoto,from,message=ParsePM(data)
MessageRecognized=1
end
if MessageRecognized==1 and whoto==BotName and (curUser.iProfile>=0 and curUser.iProfile<=4) then
local sus=GetUsersByProfile("Master")
local ops=GetUsersByProfile("Operator")
local vips=GetUsersByProfile("VIP")
local regs=GetUsersByProfile("REG")
for i, n in sus do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in ops do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in vips do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in regs do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
else
curUser:SendPM(BotName, "This chat is for registered users only. Your message has not been sent.")
end
end
function ParsePM(data)
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
message = strsub(message,1,strlen(message)-1)
return whoTo,from,message
end
function isPM(data)
if( strsub(data, 1, 3) == "$To" ) then
return 1
else
return 0
end
end
ok no errors this time but the script code is bogus...
heres what happens...
first i pm it no responce then i reg myself(non ops) in mainchat noone else can see but whether im a reg or not it will send the message you are not regged i tired from my other client(regged op) to type in mainchat and sends mesage to me saying not regged and in addition the message still goes throught to mainchat
anyone help???
main chat? It works only for pm... what did I get wrong?
i pmed you in chevy hide out
BTW:
curUser.iProfile>=0 and curUser.iProfile<=4
will allow the next profile at possition 4 to receive and send aswell (be included in the chat). It should be:
curUser.iProfile>=0 and curUser.iProfile<=3
anyone else gonna help?
I'm not sure what is wrong with it... but I'll test it out as soon as I have some time. I think it should work as it used too...
PS: private messages don't work like main chat messages, they WILL appear in the chat window (pm to bot) of the user that send the pm eather way and there is no way to block that. That is because the hub doesn't send a confirmation that the message was send. That doesn't mean that it is send to all others though...
Ok function of this whole bot is a secondary chat for my users LIKE an op chat but not just for ops
profiles it uses
REGS
VIPS
OPS
SOPS
ADMINS(Master)
Now if the user sneding the message is not regged it will repley
This chat is for registered users only. Your message has not been sent.
its bugged and does send message to anyone or anything and when you type in main it will say that and message and even so still let the message go through
I haven't tested it.. but I kinda refuse to believe that the message was sent to all the others. Btw. the script is ONLY for the first 4 Profiles in PtokaX, the default ones. Don't know if you have changed something there that influences the functionality of the script...
i did i added profile superopi think but that still dont mae a a diff if you want to come 2 my hub i will show you what hapens
SOme plz help phatty or opium or someone plz help
Silly mistake... fixed it:
-- Creator: klownietklowniet
-- Network: [ > DC - UniteD < ]
--
-- Request by Peter
--
-- Edits by R?P?FF?
--
-- A VIP and Higher chat
-- 02-09-2003: klownietklowniet changed the script abit so all (VIPs, OPs and SUs) can chat. (Request by BlazeXXX)
-- 19-10-2003: R?P?FF? added the reg profile in it so now regs are included in script. (Request by Me)
-- 19-10-2003: klownietklowniet added a message so when non reg users pm it, it will respond and act on the message
-- "This chat is for registered users only. Your message has not been sent." (Request by R?P?FF?)
BotName = ".:ReGs~OnLyChAt:."
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(curUser,data)
local MessageRecognized = 0
if isPM(data)==1 then
whoto,from,message=ParsePM(data)
MessageRecognized=1
end
if MessageRecognized==1 and whoto==BotName then
if (curUser.iProfile>=0 and curUser.iProfile<=3) then
local sus=GetUsersByProfile("Master")
local ops=GetUsersByProfile("Operator")
local vips=GetUsersByProfile("VIP")
local regs=GetUsersByProfile("REG")
for i, n in sus do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in ops do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in vips do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
for i, n in regs do
if n == curUser.sName then
else
SendPmToNick(n, BotName, from.." -> "..message)
end
end
else
curUser:SendPM(BotName, "This chat is for registered users only. Your message has not been sent.")
end
end
end
function ParsePM(data)
s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
message = strsub(message,1,strlen(message)-1)
return whoTo,from,message
end
function isPM(data)
if( strsub(data, 1, 3) == "$To" ) then
return 1
else
return 0
end
end
good job it worked :D
but dont touch iprofile as a reg is profile #4
? REG is 3
well see this one users 5 profiles Master,Sop,Op,VIP,Reg
The message is send ONLY to 4 profile group users. Btw, have you changed in the order of the profiles or just added the new profile last?