determinate determinate

Author Topic: MessageBoard 2.0 LUA 5.1x [Strict][API 2]  (Read 6955 times)

0 Members and 1 Guest are viewing this topic.

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« on: December 24, 2007, 08:46:21 am »
Bug in mbdelsticky command fixed, Thanks achiever for report.
Added option for sticky time stamp, always reply in private message,
sticky/message display order.
Script updated 01/03/08
Code: [Select]
--[[

MessageBoard 2.0 LUA 5.1x [Strict] [API 2]

By Mutor 12/24/07


A simple message board with stickies for the new PtokaX API
This is a complete rewrite of the script and thus a new format.
Previous message logs are incompatible with this version.

-Provides context menu [right click]
-Menus/commands permission per profile, per command
-Hub tab commands display in main, user list commands display in pm from bot.
-Option to always display in private message
-Option to display stickies or messages first
-Duplicate message/percentage same message, block feature
-Anti-advertisment option [ops protected]
-Max message cache limit. Read message limit.
-Alphabetic command listing
-Error reporting to OpNick

Last Revision: 01/03/08

MessageBoard 2.0 Command Help

Command Description
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
+mbdelmsg       Remove A Message From The Board
+mbdelmymsg     Remove My Message From The Board
+mbdelsticky    Remove A Sticky From The Board
+mbhelp         MessageBoard 2.0 Help
+mbquery        Search Board Messages For String
+mbread         Read Board Messages
+mbreaddate     Read Board Messages For Date
+mbreadmine     Read My Board Messages
+mbreadnick     Read Board Messages For Nick
+mbreadrange    Read Board Messages For Date Range
+mbsticky       Post A Sticky Message To The Board
+mbwrite        Post A Message To The Board

ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


]]

MbCfg = {
-- Admins nick for status / error messages
OpNick = "Mutor",
-- "Botname" ["" = hub bot]
BotNick = "[MessageBoard]",
-- Should bot have a key? true/false
BotIsOp = true,
-- Bot's description
BotDesc = "",
-- Bot Email address
BotMail = "user@domain.com",
-- "Command Menu" ["" = hub name]
Menu = SetMan.GetString(0),
-- "Command SubMenu" ["" = script name]
SubMenu = "MessageBoard 2.0",
-- File to save messages
MsgFile = "MessageBoard20.dat",
-- File to save sticky messages
StickyFile = "StickyBoard20.dat",
-- Always reply in PM? true/false
PmOnly = true,
-- List Messages Before Stickies? true/false
MsgFirst = true,
-- Prefix Sticky Message With Time Stamp  true/false
StickyTs = true,
-- Maximum number of messages to cache
MaxCache = 500,
-- Default number of messages to read
ReadCnt = 10,
-- Enable Anti-Advertisement filtering?  true/false
AaEnabled = true,
-- Anti-Advertisement triggers
AaTrigs = {
"bounceme.net","hopto.org","myftp.biz","myftp.org","myvnc.com","no-ip.biz","no-ip.info","no-ip.org",
"redirectme.net","servebeer.com","serveblog.net","servecounterstrike.com","serveftp.com","servegame.com",
"servehalflife.com","servehttp.com","servemp3.com","servepics.com","servequake.com","sytes.net","mine.nu",
"zapto.org","blogsyte.com","cable-modem.org","ciscofreak.com","damnserver.com","ditchyourip.com",
"dnsiskinky.com","geekgalaxy.com","homesecuritymac.com","homesecuritypc.com","myactivedirectory.com",
"mymediapc.net","mypsx.net","net-freaks.com","no-ip.ca","no-ip.co.uk","no-ip.com","no-ip.net","point2this.com",
"pointto.us","quicksytes.com","securityexploits.com","securitytactics.com","serveexchange.com","servehumour.com",
"servep2p.com","servesarcasm.com","stufftoread.com","unusualperson.com","workisboring.com","dns2go","myftpsite",
},
-- Acceptable percentage of same words allowed in new posting [set as 101 to disable]
MatchLimit = 25,
}

local Path = Core.GetPtokaXPath().."scripts/"
OnStartup = function()
MbCfg.Script,MbCfg.Prefixes = "MessageBoard 2.0",SetMan.GetString(29)
if MbCfg.BotNick == "" then MbCfg.BotNick = SetMan.GetString(21) end
if MbCfg.BotDesc == "" then MbCfg.BotDesc = SetMan.GetString(21).." "..MbCfg.Script end
if MbCfg.BotNick ~= SetMan.GetString(21) then
Core.RegBot(MbCfg.BotNick, MbCfg.BotDesc, MbCfg.BotMail, MbCfg.BotIsOp)
end
if MbCfg.Menu == "" then MbCfg.Menu = SetMan.GetString(0) end
if MbCfg.SubMenu == "" then MbCfg.SubMenu = MbCfg.Script end
if not MbCfg.MsgFile:find("^"..Path,1,true) then MbCfg.MsgFile = Path..MbCfg.MsgFile end
if not MbCfg.StickyFile:find("^"..Path,1,true) then MbCfg.StickyFile = Path..MbCfg.StickyFile end
if loadfile(MbCfg.MsgFile) then
dofile(MbCfg.MsgFile)
else
BoardMessages = {}
SaveFile(MbCfg.MsgFile,BoardMessages,"BoardMessages")
end
if loadfile(MbCfg.StickyFile) then
dofile(MbCfg.StickyFile)
else
StickyMessages = {}
SaveFile(MbCfg.StickyFile,StickyMessages,"StickyMessages")
end
collectgarbage("collect")
OnError(MbCfg.Script.." ".._VERSION.." by Mutor has been started, using "..Mem().." of memory.")
end

OnExit = function()
OnError(MbCfg.Script.." ".._VERSION.." by Mutor has been stopped. Freeing "..Mem().." of memory.")
end

OnError = function(msg)
local user = Core.GetUser(MbCfg.OpNick)
if user then Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..msg.."|") end
end

UserConnected = function(user)
if SendMbCmds(user) then
local Prof = ProfMan.GetProfile(user.iProfile).sProfileName
local msg = "Welcome "..user.sNick..", "..Prof.."'s "..MbCfg.Script.." commands "..
"enabled. Right click hub tab or user list for menu."
Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..msg.."|")
end
end
OpConnected,RegConnected = UserConnected,UserConnected

ChatArrival = function(user,data)
local _,_,to = data:find("^$To: (%S+) From:")
local _,_,cmd = data:find("%b<> ["..MbCfg.Prefixes.."](%a+)")
if cmd and MbCmds[cmd] and MbCmds[cmd][2][user.iProfile] then
if MbCfg.AaEnabled and not Core.GetUserValue(user,11) then
for _,v in ipairs(MbCfg.AaTrigs) do
if data:lower():find(v:lower(),1,1) or data:find("%d-%.%d-%.%d-%.%d-") then
return Core.SendToAll("<"..MbCfg.BotNick.."> Let's all laugh at "..
user.sNick..", who tried and failed to advertise on the message board." ),true
end
end
end
local reply = MbCmds[cmd][1](user,data,cmd)
if reply:len() > 0 then
if to and to == MbCfg.BotNick or MbCfg.PmOnly then
Core.SendPmToUser(user,MbCfg.BotNick,reply.."|")
else
Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..reply.."|")
end
end
return true
end
end
ToArrival = ChatArrival

Mem = function() collectgarbage("collect") return string.format("%-.2f Kb.",collectgarbage("count")) end

ReadBoard = function(from,to,query,auth,date,daterange)
local arg = ""
local z
if auth or query or date then
if query then arg = "For Search String: "..query elseif auth then arg = "For Author: "..auth end
z = true
from,to = 1,#BoardMessages
end
if not from then
from = 1
else
z = true
end
if not to then
to = math.min(from + MbCfg.ReadCnt,#BoardMessages)
else
to = math.min(to,#BoardMessages)
end
local s,m,x,result,mc,sc = "","","-","",0,0
if not z and next(StickyMessages) then
for i,v in ipairs(StickyMessages) do
if date or daterange then
local d1,d2 = os.date("%x",v[3]):gsub("%D",""),os.date("%x",date):gsub("%D","")
if daterange then
d3 = os.date("%x",daterange):gsub("%D","")
if d1 >= d2 or d1 <= d3 then
sc = sc + 1
s = s.." ["..i.."]  "..v[1].."\n"
end
else
if d1 == d2 then
sc = sc + 1
s = s.." ["..i.."]  "..v[1].."\n"
end
end
elseif auth then
if v[2]:lower():find(auth:lower(),1,true) then
sc = sc + 1
s = s.." ["..i.."]  "..v[1].."\n"
end
elseif not query or v[1]:gsub("^.+> ",""):find(query) then
sc = sc + 1
s = s.." ["..i.."]  "..v[1].."\n"
end
end
end
if next(BoardMessages) then
for i = from, to do
if date then
arg = "For: "..os.date("%x",date)
local d1,d2 = os.date("%x",BoardMessages[i][3]):gsub("%D",""),os.date("%x",date):gsub("%D","")
if daterange then
arg = arg.." To: "..os.date("%x",daterange)
d3 = os.date("%x",daterange):gsub("%D","")
if d1 >= d2 or d1 <= d3 then
mc = mc + 1
m = m.." ["..i.."]  "..BoardMessages[i][1].."\n\n"
end
else
if d1 == d2 then
mc = mc + 1
m = m.." ["..i.."]  "..BoardMessages[i][1].."\n\n"
end
end
elseif auth then
if BoardMessages[i][2]:lower():find(auth:lower(),1,true) then
mc = mc + 1
m = m.." ["..i.."]  "..BoardMessages[i][1].."\n\n"
end
elseif not query or BoardMessages[i][1]:gsub("^.+> ",""):find(query) then
mc = mc + 1
arg = tostring(to - from + 1).." Messages"
m = m.." ["..i.."]  "..BoardMessages[i][1].."\n\n"
end
mc = tostring(mc)
end
end
if m:len() > 0 then
result = "\n\n----[ "..mc.."  Board Messages ]"..x:rep(175).."\n\n"..m..x:rep(175).."[ "..mc.."  Board Messages ]----\n"
end
if s:len() > 0 then
local so = "\n\n----[ "..sc.."  Sticky Messages ]"..x:rep(175).."\n"..s..x:rep(175).."[ "..sc.."  Sticky Messages ]----\n"
if MbCfg.MsgFirst then
result = result..so
else
result = so..result
end
end
if result:len() > 0 then
return "Results: "..arg..result
else
return "No matching entries found."
end
end

Query = function(from,to,query)
end

WriteMsg = function(user,msg,sticky)
local check,reply = CheckMsg(msg,sticky)
if check then
return "I'm sorry that is too close a match to an existing entry. Last match found:\n\n"..
" [# "..check.."] - "..reply.."\n\n"
else
local msgtype = "board message"
local prof = "Unregistered User"
if user.iProfile ~= -1 then
prof = ProfMan.GetProfile(user.iProfile).sProfileName
end
local msgprefix = "[ "..os.date().." ] <"..user.sNick.."> "
if sticky then
msgtype = "sticky message"
if MbCfg.StickyTs then
table.insert(StickyMessages,1,{msgprefix:gsub("<","%1"..prof.." ")..msg,user.sNick,os.time()})
else
table.insert(StickyMessages,1,{msgprefix:gsub("^%b[] <","<"..prof.." ")..msg,user.sNick,os.time()})
end
SaveFile(MbCfg.StickyFile,StickyMessages,"StickyMessages")
else
table.insert(BoardMessages,1,{msgprefix..msg,user.sNick,os.time()})
SaveFile(MbCfg.MsgFile,BoardMessages,"BoardMessages")
end
while #BoardMessages > MbCfg.MaxCache do
table.remove(BoardMessages,#BoardMessages)
end
local reply = prof.." "..user.sNick.." just posted a "..msgtype..
" to the message board. Type "..MbCfg.Prefixes:sub(1,1).."mbread to read messages."
Core.SendToAll("<"..MbCfg.BotNick.."> "..reply.."|")
return prof.." "..user.sNick..", your "..msgtype.." was successfully posted."
end
end

CheckMsg = function(msg,sticky)
local T = BoardMessages
if sticky then T = StickyMessages end
if next(T) then
msg = msg:lower(msg)
for i,v in ipairs(T) do
local txt = v[1]:lower():gsub("^%[.-%] ","")
--Exact match, case insensitive
if txt:lower() == msg:lower() then return i,v[1] end
--Match anywhere within message, case insensitive
if txt:lower():find(msg:lower()) then return i,v[1] end
--Run a loop to find percentage of match
local len,cnt = 0,0
for word in txt:gmatch("%S+") do
len = len + 1
if msg:lower():find(word,1,1) then
cnt = cnt + 1
end
end
local pct = (cnt/len) * 100 or 0
if pct >= MbCfg.MatchLimit then
return i,v[1].." String match: "..string.format("%.2f%%",pct)
end
end
end
end

SendMbCmds = function(user)
local u,p,m,s,t,c = "$UserCommand 1 ",MbCfg.Prefixes:sub(1,1),MbCfg.Menu,MbCfg.SubMenu,{},""
for i,v in pairs(MbCmds) do
if v[2][user.iProfile] then
local desc,arg1,arg2 = v[1]()
table.insert(t,{desc,u.."1 "..m.."\\"..s.."\\"..desc.."$<%[mynick]> "..p..i..arg1.."&#124;|",
u.."2 "..m.."\\"..s.."\\"..desc.."$$To: "..MbCfg.BotNick.." From: %[mynick] "..
"$<%[mynick]> "..p..i..arg2.."&#124;|"})
end
end
table.sort(t, function(a,b)return a[1] < b[1] end)
for i,v in ipairs(t) do
c = c..v[2]..v[3]
end
collectgarbage("collect")
if c:len() > 0 then
Core.SendToUser(user,c)
return true
end
end

MbCmds = {
mbwrite = {function(user,data,cmd)
if user then
local _,_,post = data:find("%b<> %p"..cmd.." (.+)|")
if not post then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message>"
else
return WriteMsg(user,post,false)
end
else
return "Post A Message To The Board"," %[line:Message]"," %[line:Message]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbsticky = {function(user,data,cmd)
if user then
local _,_,post = data:find("%b<> %p"..cmd.." (.+)|")
if not post then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <sticky message>"
else
return WriteMsg(user,post,true)
end
else
return "Post A Sticky Message To The Board"," %[line:Sticky Message]"," %[line:Sticky Message]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbread = {function(user,data,cmd)
if user then
local _,_,lo,hi = data:find("%b<> %p"..cmd.." ([%d]-) ([%d]-)|")
if lo then lo = tonumber(lo) end
if hi then hi = tonumber(hi) end
return ReadBoard(lo,hi,nil,nil,nil,nil)
else
return "Read Board Messages"," %[line:Start Range # (Optional)] %[line:End Range # (Optional)]",
" %[line:Start Range # (Optional)] %[line:End Range # (Optional)]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbreadnick = {function(user,data,cmd)
if user then
local _,_,nick = data:find("%b<> %p"..cmd.." (%S+)|")
if nick then
return ReadBoard(nil,nil,nil,nick,nil,nil)
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <nick name>"
end
else
return "Read Board Messages For Nick"," %[line:Nickname]"," %[line:Nickname]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreadmine = {function(user,data,cmd)
if user then
return ReadBoard(nil,nil,nil,user.sNick,nil,nil)
else
return "Read My Board Messages","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreaddate = {function(user,data,cmd)
if user then
local _,_,m,d,y = data:find("%b<> %p"..cmd.." (%d%d)%/(%d%d)%/(%d%d%d%d)|$")
if m and d and y then
local x = {["month"] = m,["day"] = d,["year"] = y}
local t = os.time(x)
if not t then
return "Date is out of range"
else
return ReadBoard(nil,nil,nil,nil,t,nil)
end
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <mm/dd/yyyy>"
end
else
return "Read Board Messages For Date"," %[line:Date in mm/dd/yyyy format]"," %[line:Date in mm/dd/yyyy format]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreadrange = {function(user,data,cmd)
if user then
local _,_,nick = data:find("%b<> %p"..cmd.." (%S+)|")
local _,_,m,d,y,m2,d2,y2 = data:find("%b<> %p"..cmd.." (%d%d*)%/(%d%d*)%/(%d%d%d%d) (%d%d*)%/(%d%d*)%/(%d%d%d%d)|$")
if m and d and y and m2 and d2 and y2 then
local x,x2 = {["month"] = m,["day"] = d,["year"] = y},{["month"] = m2,["day"] = d2,["year"] = y2}
local t,t2 = os.time(x),os.time(x2)
if t and t2 then
if t > t2 then
return "Start date may not be later than end date."
else
return ReadBoard(nil,nil,nil,nil,t,t2)
end
else
local s = ""
if not t then s = "Start date is" end
if not t2 then
if s:len() == 0 then s = "End date is" else s = s.." and end date are both" end
end
return "Error! "..s.." out of range."
end
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <mm/dd/yyyy> <mm/dd/yyyy>"
end
else
return "Read Board Messages For Date Range",
" %[line:Start Date in mm/dd/yyyy format] %[line:End Date in mm/dd/yyyy format]",
" %[line:Start Date in mm/dd/yyyy format] %[line:End Date in mm/dd/yyyy format]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbquery = {function(user,data,cmd)
if user then
local _,_,query = data:find("%b<> %p"..cmd.." (.+)|")
if query then
return ReadBoard(nil,nil,query,nil,nil,nil)
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <search string>"
end
else
return "Search Board Messages For String"," %[line:Search String]"," %[line:Search String]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = false}
},
mbdelmsg = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if BoardMessages[tonumber(int)] then
table.remove(BoardMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", message number "..int.." is invalid."
end
end
else
return "Remove A Message From The Board"," %[line:Message Number]"," %[line:Message Number]"
end
end,
{[-1] = false,[0] = true,[1] = false,[2] = false,[3] = false}
},
mbdelmymsg = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if BoardMessages[tonumber(int)] then
if BoardMessages[tonumber(int)][2]:lower() == user.sNick:lower() then
table.remove(BoardMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", message number "..int.." is not yours."
end
else
return "Sorry "..user.sNick..", message number "..int.." is invalid."
end
end
else
return "Remove My Message From The Board"," %[line:Message Number]"," %[line:Message Number]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbdelsticky = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if StickyMessages[tonumber(int)] then
table.remove(StickyMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", sticky number "..int.." is invalid."
end
end
else
return "Remove A Sticky From The Board"," %[line:Sticky Number]"," %[line:Sticky Number]"
end
end,
{[-1] = false,[0] = true,[1] = false,[2] = false,[3] = false}
},
mbhelp = {function(user,data,cmd)
if user then
local reply,t,c = "\n\n\t"..MbCfg.Script.." Command Help\n\n\tCommand"..
"\t\tDescription\r\n\t"..string.rep("Ż",40).."\r\n",{},""

for i,v in pairs(MbCmds) do
local desc,args = MbCmds[i][1]()
table.insert(t,"\t+"..string.format("%-15s",i).."\t"..desc.."\r\n")
end
table.sort(t, function(a,b)return a < b end)
for i,v in ipairs(t) do
c = c..v
end
if c:len() > 0 then
return reply..c.."\n\t"..string.rep("Ż",40).."\r\n\r\n"
end
else
return MbCfg.Script.." Help","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
}
}

Serialize = function(tTable, sTableName, hFile, sTab)
sTab = sTab or "";
hFile:write(sTab..sTableName.." = {\n" )
for key, value in ipairs(tTable) do
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
if(type(value) == "table") then
Serialize(value, sKey, hFile, sTab.."\t")
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
hFile:write( sTab.."\t"..sKey.." = "..sValue)
end
hFile:write( ",\n")
end
hFile:write( sTab.."}")
end

SaveFile = function(file,table, tablename )
local hFile = io.open (file , "wb")
Serialize(table, tablename, hFile)
hFile:close()
collectgarbage("collect")
end
« Last Edit: June 28, 2008, 05:18:20 pm by Mutor »
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline achiever

  • Lord
  • ***
  • Posts: 264
  • Karma: +25/-22
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #1 on: January 02, 2008, 08:52:56 am »
hi,

i think on deleting sticky message the message from board messages gets deleted. plz check
and can the time stamp of sticky message be removed just from the sticky messages

Regards
thks,
achiever.

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #2 on: January 02, 2008, 02:15:30 pm »
Bug fixed, sticky timestamp is now optional. [currently enabled]
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #3 on: January 02, 2008, 04:50:52 pm »
hello mutor
thanks for conversion of message board script
The script for new API2 is different from old one
I think the old script was better then new
one

So if possible can u please convert old Message
Board script for new API

Thanks in Advance
"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #4 on: January 02, 2008, 04:54:27 pm »
This IS the conversion.
Better how? They have nearly identical function.
« Last Edit: January 02, 2008, 04:56:50 pm by Mutor »
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #5 on: January 02, 2008, 05:18:53 pm »
but the ouput is different
display of message board and sticky message is different
if possible please upgrade old script


i think old one was better
"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #6 on: January 02, 2008, 05:26:25 pm »
Guy this is it, yes the output is different. It's what I wanted
There will be no reversion to the previous format.

i think old one was better
I don't. :P
« Last Edit: January 02, 2008, 05:46:35 pm by Mutor »
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #7 on: January 02, 2008, 05:59:55 pm »
k
thanks
its just because we have different views

but in new version
message board is shown in main chat can u please show tht in pm
and sticky message below message board
PLEASE

Thanks in Advance
"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #8 on: January 02, 2008, 06:06:07 pm »
Hub tab command displays in main, user list command displays in pm.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #9 on: January 02, 2008, 06:10:21 pm »
but i will like to have sticky message at the bottom if possible
"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #10 on: January 02, 2008, 06:22:29 pm »
Thats doesn't make much sense to me. The intent of s sticky is to be noticed
more so than the messages. Everything that uses sticky messages list them first.

You are welcome to edit the script to suit your own [somewhat particular needs]
if you feel so strongly that these little things need be changed. You've been around
for years now, the "I don't know LUA" reason for not doing so is wearing a little thin.  :P
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #11 on: January 02, 2008, 06:29:35 pm »
my message board appear on main chat and sticky message appear before message board

check this out
Code: [Select]
<[HeavY]> Master PoTtEr just posted a sticky message to the message board. Type !mbwrite to read messages.
*** Server command: +read
<PoTtEr> +read
*** Server command: +mbread
<[MessageBoard]>

Results 0 messages

----[ Sticky Messages ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 [1]  [ 01/02/08 22:47:46 ] <Master PoTtEr> 123456

 [2]  [ 01/02/08 18:33:07 ] <Master PoTtEr> llllllllll

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------[ Sticky Messages ]----


----[ Board Messages ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 [1]  [ 12/27/07 14:46:11 ] <test> [ Mostwanted ] wrote: Sharing<<<<<<MOVIE : :  GOOD LUCK CHUCK DVD RIP >>>>....................enjoy

 [21]  [ 12/27/07 16:04:31 ] <test> [ Mostwanted ] Sharing Pictures of Dabbo Ratnani Male Calendar [2008] ... cool pics-Must see !!  ... NjoY*

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------[ Board Messages ]----

"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #12 on: January 02, 2008, 06:35:10 pm »
Yes stickies first, as it has always been.
Use user list commands or enable the newly added option of PmOnly for reply in PM.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #13 on: January 03, 2008, 05:18:26 am »
Sorry sir
but in old message board i.e
Message Board 1.08f   10/20/04 LUA 5 .0/5.1
converted to LUA 5 - 09/15/05
by Mutor

Message board is displayed 1st and at the end sticky messages are displayed
check this out
Code: [Select]
[ 1275 ]   On December 13 2007 22:26:46  [ L0v3rBOy ] wrote: Sharing New CS Frag Movie [Astalavista]pubmasters_The_Revenge_trail Yenjoy !!!
 [ 1276 ]   On December 13 2007 22:27:01  [ L0v3rBOy ] wrote: Sharing New CS Frag Movie [Astalavista]fizzlimited_wmv.wmv Yenjoy !!!
 [ 1277 ]   On December 13 2007 22:27:31  [ L0v3rBOy ] wrote: Sharing New CS Frag Movie [Astalavista]hollie_and_molander-BIA Yenjoy !!!
 [ 1278 ]   On December 15 2007 20:15:06  [ rooney ] wrote: Boston Legal S04Ep09 shared njoyyyy!!!!!!
 [ 1279 ]   On December 15 2007 20:28:20  [ vichi ] wrote: hitman movie shared............. tnx to the downloaders

---<>-------------------------------------------------------------------------------------------------------------------------<>---
*Note: This is not a forum. Please use this feature only for one way communication.*
1]   09 Jul [Operator] :   Please dont advertise abt other hubs in Main Chat , Message Board or PM
---<>-------------------------------------------------------------------------------------------------------------------------<>---
"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #14 on: January 04, 2008, 01:43:50 am »
Yes that was by request, and I wouldn't doubt a request by you. :P
Earlier versions had stickies first. I've added it as an option for you.
Script above, updated with the change.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #15 on: January 04, 2008, 05:36:02 am »
Thank you very much
Thanks
 :)

i just found a small error
when i added a sticky message i got this message

*** User command: $To: [MessageBoard] From: PoTtEr $<PoTtEr> !mbsticky testing sticky
<[HeavY]> Master PoTtEr just posted a sticky message to the message board. Type !mbwrite to read messages.
« Last Edit: January 04, 2008, 05:44:35 am by Yahoo »
"BoRN FIGhTEr"

Offline Prathmesh

  • Junior Member
  • **
  • Posts: 13
  • Karma: +2/-0
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #16 on: March 26, 2008, 05:52:57 pm »
Fine script though I had few problems.

Even though I set
Code: [Select]
AaEnabled = false,Message board script will keep blocking main chat messages containing any ips triggers and thus humiliating the users.

I thought Anti-Ad should keep ONLY message board spam away ISNT IT ?

After little help of SpeedX I manged to get function outta script that blocks ALL spam.

I have a requests Plz keep the Anti-Ad Function for only Message boards and not the main chat. Anything such as ips and custom triggers should be filtered while adding a message to tables.


Code: [Select]
if MbCfg.AaEnabled and user.iProfile == -1 or not ProfMan.GetProfile(user.iProfile).tProfilePermissions.bIsOP then
Causes problems In SpeedX's opinion

Thank You Very Much for a fine script.

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #17 on: March 26, 2008, 10:07:04 pm »
Fine script though I had few problems.

Even though I set
Code: [Select]
AaEnabled = false,Message board script will keep blocking main chat messages containing any ips triggers and thus humiliating the users.
I thought Anti-Ad should keep ONLY message board spam away ISNT IT ?
No it doesn't. Yes it is
Code: [Select]
if cmd and MbCmds[cmd] and MbCmds[cmd][2][user.iProfile] thenMeaning: Must be a command and a board command and the user's profile must be enabled for this board command.
Code: [Select]
if MbCfg.AaEnabled and user.iProfile == -1 or not ProfMan.GetProfile(user.iProfile).tProfilePermissions.bIsOP thenCauses problems In SpeedX's opinion
SpeedX opinion is of no concern to me or any scripter I know of. :P
It may be long winded but it neither creates or propagates any problem.
Anyone can make such a statement, but I haven't heard the reasoning.
Perhaps neither of you understand the line's logic as applied.
Meaning:If Anti-Ad is enabled and user is not registered or user is registered but is not an op.
Code: [Select]
if MbCfg.AaEnabled and not Core.GetUserValue(user,11) thenIs a shorter line with a single call with the same meaning/result.
« Last Edit: March 26, 2008, 10:08:44 pm by Mutor »
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Prathmesh

  • Junior Member
  • **
  • Posts: 13
  • Karma: +2/-0
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #18 on: March 27, 2008, 09:56:06 am »
Tested a VERY FRESH copy deleted all tables it works!  :D
Though when set true it acts like it is anti spam bot and block any ip and custom triggers in main chat  :-[ can you please modify and keep the anti-ad only for tables(filtering whatever gose to dat files) instead of main plz this function will be most dramatic since I already have other options like disconnecting warning kicking ... if I wish to keep the spam away(I mostly dont ban ips since there are lots of gamers who seek fellow gamers and private gaming servers. Those private gaming server ips could not be posted in main due to anti-ad function.)

2ndly Can u plz tell me how do I modify the commands I want to use old commands !read & !write <message> since everyone in hubs are familiar with it.
I personally could have done with the notepad ++ but I'm afraid I ll mess up once again.

Thank you very once again much for such a nice script.

CHAPTER TWO[THE EDIT]

It started to have problems again I'm on 0.4.0.0b
Code: [Select]
[22:10:44] <~MessageBoard~> MessageBoard 2.0 LUA 5.1x [Strict] [API 2].lua:138: attempt to index a nil value
[22:10:44] <Prathmesh[]> not message board
[22:10:52] <~MessageBoard~> MessageBoard 2.0 LUA 5.1x [Strict] [API 2].lua:138: attempt to index a nil value
[22:10:52] <Prathmesh[]> dchub://
[22:10:59] <~MessageBoard~> MessageBoard 2.0 LUA 5.1x [Strict] [API 2].lua:138: attempt to index a nil value

having this error

line 138 is
Code: [Select]
if MbCfg.AaEnabled and user.iProfile == -1 or not ProfMan.GetProfile(user.iProfile).tProfilePermissions.bIsOP then
I really dont know ABC of API 2 atall so cant really figure out the problem

script used unmodifed but few b values like " AaEnabled , StickyTs " changed


EDIT# 2

A Small Typo found
Line 288
Code: [Select]
" to the message board. Type "..MbCfg.Prefixes:sub(1,1).."mbwrite to read messages."
Which should be mbread insted of mbwrite
« Last Edit: March 27, 2008, 07:10:13 pm by Prathmesh »

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #19 on: March 27, 2008, 06:18:04 pm »
Script above updated.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Prathmesh

  • Junior Member
  • **
  • Posts: 13
  • Karma: +2/-0
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #20 on: March 29, 2008, 05:12:11 pm »
I guess you replied when I was doing the edit

in function write
Line 138 
Code: [Select]
" to the message board. Type "..MbCfg.Prefixes:sub(1,1).."mbwrite to read messages."
Its not a syntax typo though you should edit that mbwrite to mbread.

Regards

Prathmesh...

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #21 on: March 29, 2008, 05:51:19 pm »
Indeed, thanks for report.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Back4mHell

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #22 on: August 23, 2008, 06:48:52 pm »
getting this error
[22:16] Syntax Messborad.lua:59: attempt to index global 'SetMan' (a nil value)

help
thks

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #23 on: August 23, 2008, 09:05:46 pm »
Oh boy another noob.    :P
This is for the new API (2) [as indicated in the script title]

This is intent for Px 0.3.6.0d or later.
There were previous version for API 1.
This is not one of them.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #24 on: September 28, 2008, 08:20:53 am »
hello mutor,
i dont knw whether u would like my request

but the latest messages are shown 1st in this script..
actually when we write +mbread command the czdc++ window scrolls down at the end of the page.
so we have to scroll the window to the top to read the latest messages
cant we change so that the latest message appears last (just like old script)
"BoRN FIGhTEr"

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
MessageBoard 2.1 LUA 5.1x [Strict] [API 2]
« Reply #25 on: September 28, 2008, 03:33:27 pm »
I don't have to like it, but in this case it is my preference. :P
Rather than changing the order each time a read order request,
is made, I have added an option so users can choose for themselves.

Code: [Select]
-- Descending read order? true/false [false = ascending]
Descend = false,

Let the testing begin.

Code: [Select]
--[[

MessageBoard 2.1 LUA 5.1x [Strict] [API 2]

By Mutor 12/24/07


A simple message board with stickies for the new PtokaX API
This is a complete rewrite of the script and thus a new format.
Previous message logs are incompatible with this version.

-Provides context menu [right click]
-Menus/commands permission per profile, per command
-Hub tab commands display in main, user list commands display in pm from bot.
-Option to always display in private message
-Option to display stickies or messages first
-Duplicate message/percentage same message, block feature
-Anti-advertisment option [ops protected]
-Max message cache limit. Read message limit.
-Alphabetic command listing
-Error reporting to OpNick

+Changes from 2.0 09/28/08
+Added option for ascending/descending read order requested by Yahoo

MessageBoard 2.1 Command Help

Command Description
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
+mbdelmsg       Remove A Message From The Board
+mbdelmymsg     Remove My Message From The Board
+mbdelsticky    Remove A Sticky From The Board
+mbhelp         MessageBoard 2.1 Help
+mbquery        Search Board Messages For String
+mbread         Read Board Messages
+mbreaddate     Read Board Messages For Date
+mbreadmine     Read My Board Messages
+mbreadnick     Read Board Messages For Nick
+mbreadrange    Read Board Messages For Date Range
+mbsticky       Post A Sticky Message To The Board
+mbwrite        Post A Message To The Board

ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


]]

MbCfg = {
-- Admins nick for status / error messages
OpNick = "Mutor",
-- "Botname" ["" = hub bot]
BotNick = "[MessageBoard]",
-- Should bot have a key? true/false
BotIsOp = true,
-- Bot's description
BotDesc = "",
-- Bot Email address
BotMail = "user@domain.com",
-- "Command Menu" ["" = hub name]
Menu = "",
-- "Command SubMenu" ["" = script name]
SubMenu = "",
-- File to save messages
MsgFile = "MessageBoard20.dat",
-- File to save sticky messages
StickyFile = "StickyBoard20.dat",
-- Always reply in PM? true/false
PmOnly = true,
-- List Messages Before Stickies? true/false
MsgFirst = true,
-- Prefix Sticky Message With Time Stamp  true/false
StickyTs = true,
-- Maximum number of messages to cache
MaxCache = 500,
-- Default number of messages to read
ReadCnt = 10,
-- Enable Anti-Advertisement filtering?  true/false
AaEnabled = true,
-- Anti-Advertisement triggers
AaTrigs = {
"bounceme.net","hopto.org","myftp.biz","myftp.org","myvnc.com","no-ip.biz","no-ip.info","no-ip.org",
"redirectme.net","servebeer.com","serveblog.net","servecounterstrike.com","serveftp.com","servegame.com",
"servehalflife.com","servehttp.com","servemp3.com","servepics.com","servequake.com","sytes.net","mine.nu",
"zapto.org","blogsyte.com","cable-modem.org","ciscofreak.com","damnserver.com","ditchyourip.com",
"dnsiskinky.com","geekgalaxy.com","homesecuritymac.com","homesecuritypc.com","myactivedirectory.com",
"mymediapc.net","mypsx.net","net-freaks.com","no-ip.ca","no-ip.co.uk","no-ip.com","no-ip.net","point2this.com",
"pointto.us","quicksytes.com","securityexploits.com","securitytactics.com","serveexchange.com","servehumour.com",
"servep2p.com","servesarcasm.com","stufftoread.com","unusualperson.com","workisboring.com","dns2go","myftpsite",
},
-- Acceptable percentage of same words allowed in new posting [set as 101 to disable]
MatchLimit = 25,
-- Descending read order? true/false [false = ascending]
Descend = true,
}

local Path = Core.GetPtokaXPath().."scripts/"
OnStartup = function()
MbCfg.Script,MbCfg.Prefixes = "MessageBoard 2.1",SetMan.GetString(29)
if MbCfg.BotNick == "" then MbCfg.BotNick = SetMan.GetString(21) end
if MbCfg.BotDesc == "" then MbCfg.BotDesc = SetMan.GetString(21).." "..MbCfg.Script end
if MbCfg.BotNick ~= SetMan.GetString(21) then
Core.RegBot(MbCfg.BotNick, MbCfg.BotDesc, MbCfg.BotMail, MbCfg.BotIsOp)
end
if MbCfg.Menu == "" then MbCfg.Menu = SetMan.GetString(0) end
if MbCfg.SubMenu == "" then MbCfg.SubMenu = MbCfg.Script end
if not MbCfg.AaEnabled then MbCfg.AaTrigs = nil end
if not MbCfg.MsgFile:find("^"..Path,1,true) then MbCfg.MsgFile = Path..MbCfg.MsgFile end
if not MbCfg.StickyFile:find("^"..Path,1,true) then MbCfg.StickyFile = Path..MbCfg.StickyFile end
if loadfile(MbCfg.MsgFile) then
dofile(MbCfg.MsgFile)
else
BoardMessages = {}
SaveFile(MbCfg.MsgFile,BoardMessages,"BoardMessages")
end
if loadfile(MbCfg.StickyFile) then
dofile(MbCfg.StickyFile)
else
StickyMessages = {}
SaveFile(MbCfg.StickyFile,StickyMessages,"StickyMessages")
end
OnError(MbCfg.Script.." ".._VERSION.." by Mutor has been started, using "..Mem().." of memory.")
end

OnExit = function()
OnError(MbCfg.Script.." ".._VERSION.." by Mutor has been stopped. Freeing "..Mem().." of memory.")
end

OnError = function(msg)
local user = Core.GetUser(MbCfg.OpNick)
if user then Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..msg.."|") end
end

UserConnected = function(user)
if SendMbCmds(user) then
local Prof = "Unregistered User"
if user.iProfile ~= -1 then Prof = ProfMan.GetProfile(user.iProfile).sProfileName end
local msg = "Welcome "..user.sNick..", "..Prof.."'s "..MbCfg.Script.." commands "..
"enabled. Right click hub tab or user list for menu."
Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..msg.."|")
end
end
OpConnected,RegConnected = UserConnected,UserConnected

ChatArrival = function(user,data)
local _,_,to = data:find("^$To: (%S+) From:")
local _,_,cmd = data:find("%b<> ["..MbCfg.Prefixes.."](%a+)")
if cmd and MbCmds[cmd] and MbCmds[cmd][2][user.iProfile] then
if MbCfg.AaEnabled and not Core.GetUserValue(user,11) then
for _,v in ipairs(MbCfg.AaTrigs) do
if data:lower():find(v:lower(),1,1) or data:find("%d-%.%d-%.%d-%.%d-") then
return Core.SendToAll("<"..MbCfg.BotNick.."> Let's all laugh at "..
user.sNick..", who tried and failed to advertise on the message board." ),true
end
end
end
local reply = MbCmds[cmd][1](user,data,cmd)
if reply:len() > 0 then
if to and to == MbCfg.BotNick or MbCfg.PmOnly then
Core.SendPmToUser(user,MbCfg.BotNick,reply.."|")
else
Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..reply.."|")
end
end
return true
end
end
ToArrival = ChatArrival

Mem = function() collectgarbage("collect") return string.format("%-.2f Kb.",collectgarbage("count")) end

ReadBoard = function(from,to,query,auth,date,daterange)
local arg = ""
local z
if auth or query or date then
if query then arg = "For Search String: "..query elseif auth then arg = "For Author: "..auth end
z = true
from,to = 1,#BoardMessages
end
if not from then from = 1 else z = true end
if not to then to = math.min(from + MbCfg.ReadCnt,#BoardMessages) else to = math.min(to,#BoardMessages) end
local sret,ret,m,s,x,result = {},{},"","","-",""
if not z and next(StickyMessages) then
for i,v in ipairs(StickyMessages) do
if date or daterange then
local d1,d2 = os.date("%x",v[3]):gsub("%D",""),os.date("%x",date):gsub("%D","")
if daterange then
d3 = os.date("%x",daterange):gsub("%D","")
if d1 >= d2 or d1 <= d3 then
s = s.." ["..i.."]  "..v[1].."\n"
table.insert(sret,{i," ["..i.."]  "..v[1].."\n"})
end
else
if d1 == d2 then table.insert(sret,{i," ["..i.."]  "..v[1].."\n"}) end
end
elseif auth then
if v[2]:lower():find(auth:lower(),1,true) then
table.insert(sret,{i," ["..i.."]  "..v[1].."\n"})
end
elseif not query or v[1]:gsub("^.+> ",""):find(query) then
table.insert(sret,{i," ["..i.."]  "..v[1].."\n"})
end
end
end
if next(BoardMessages) then
for i = from, to do
if date then
arg = "For: "..os.date("%x",date)
local d1,d2 = os.date("%x",BoardMessages[i][3]):gsub("%D",""),os.date("%x",date):gsub("%D","")
if daterange then
arg = arg.." To: "..os.date("%x",daterange)
d3 = os.date("%x",daterange):gsub("%D","")
if d1 >= d2 or d1 <= d3 then
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
else
if d1 == d2 then
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
end
elseif auth then
if BoardMessages[i][2]:lower():find(auth:lower(),1,true) then
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
elseif not query or BoardMessages[i][1]:gsub("^.+> ",""):find(query) then
arg = tostring(to - from + 1).." Messages"
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
end
end
if #ret > 0 then
if MbCfg.Descend then table.sort(ret, function(a,b) return a[1] > b[1] end) end
for i,v in ipairs(ret) do m = m..v[2] end
result = "\n\n----[ "..tostring(#ret).."  Board Messages ]"..x:rep(175).."\n\n"..m..x:rep(175).."[ "..tostring(#ret).."  Board Messages ]----\n"
end
if #sret > 0 then
if MbCfg.Descend then table.sort(sret, function(a,b) return a[1] > b[1] end) end
for i,v in ipairs(sret) do s = s..v[2] end
local so = "\n\n----[ "..tostring(#sret).."  Sticky Messages ]"..x:rep(175).."\n"..s..x:rep(175).."[ "..tostring(#sret).."  Sticky Messages ]----\n"
if MbCfg.MsgFirst then result = result..so else result = so..result end
end
if result:len() > 0 then return "Results: "..arg..result else return "No matching entries found." end
end

WriteMsg = function(user,msg,sticky)
local check,reply = CheckMsg(msg,sticky)
if check then
return "I'm sorry that is too close a match to an existing entry. Last match found:\n\n"..
" [# "..check.."] - "..reply.."\n\n"
else
local msgtype = "board message"
local prof = "Unregistered User"
if user.iProfile ~= -1 then
prof = ProfMan.GetProfile(user.iProfile).sProfileName
end
local msgprefix = "[ "..os.date().." ] <"..user.sNick.."> "
if sticky then
msgtype = "sticky message"
if MbCfg.StickyTs then
table.insert(StickyMessages,1,{msgprefix:gsub("<","%1"..prof.." ")..msg,user.sNick,os.time()})
else
table.insert(StickyMessages,1,{msgprefix:gsub("^%b[] <","<"..prof.." ")..msg,user.sNick,os.time()})
end
SaveFile(MbCfg.StickyFile,StickyMessages,"StickyMessages")
else
table.insert(BoardMessages,1,{msgprefix..msg,user.sNick,os.time()})
SaveFile(MbCfg.MsgFile,BoardMessages,"BoardMessages")
end
while #BoardMessages > MbCfg.MaxCache do table.remove(BoardMessages,#BoardMessages) end
local reply = prof.." "..user.sNick.." just posted a "..msgtype..
" to the message board. Type "..MbCfg.Prefixes:sub(1,1).."mbread to read messages."
Core.SendToAll("<"..MbCfg.BotNick.."> "..reply.."|")
return prof.." "..user.sNick..", your "..msgtype.." was successfully posted."
end
end

CheckMsg = function(msg,sticky)
local T = BoardMessages
if sticky then T = StickyMessages end
if next(T) then
msg = msg:lower(msg)
for i,v in ipairs(T) do
local txt = v[1]:lower():gsub("^%[.-%] ","")
--Exact match, case insensitive
if txt:lower() == msg:lower() then return i,v[1] end
--Match anywhere within message, case insensitive
if txt:lower():find(msg:lower()) then return i,v[1] end
--Run a loop to find percentage of match
local len,cnt = 0,0
for word in txt:gmatch("%S+") do
len = len + 1
if msg:lower():find(word,1,1) then cnt = cnt + 1 end
end
local pct = (cnt/len) * 100 or 0
if pct >= MbCfg.MatchLimit then return i,v[1].." String match: "..string.format("%.2f%%",pct) end
end
end
end

SendMbCmds = function(user)
local u,p,m,s,t,c = "$UserCommand 1 ",MbCfg.Prefixes:sub(1,1),MbCfg.Menu,MbCfg.SubMenu,{},""
for i,v in pairs(MbCmds) do
if v[2][user.iProfile] then
local desc,arg1,arg2 = v[1]()
table.insert(t,{desc,u.."1 "..m.."\\"..s.."\\"..desc.."$<%[mynick]> "..p..i..arg1.."&#124;|",
u.."2 "..m.."\\"..s.."\\"..desc.."$$To: "..MbCfg.BotNick.." From: %[mynick] "..
"$<%[mynick]> "..p..i..arg2.."&#124;|"})
end
end
table.sort(t, function(a,b)return a[1] < b[1] end)
for i,v in ipairs(t) do c = c..v[2]..v[3] end
if c:len() > 0 then Core.SendToUser(user,c) Mem() return true end
Mem()
end

MbCmds = {
mbwrite = {function(user,data,cmd)
if user then
local _,_,post = data:find("%b<> %p"..cmd.." (.+)|")
if not post then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message>"
else
return WriteMsg(user,post,false)
end
else
return "Post A Message To The Board"," %[line:Message]"," %[line:Message]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbsticky = {function(user,data,cmd)
if user then
local _,_,post = data:find("%b<> %p"..cmd.." (.+)|")
if not post then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <sticky message>"
else
return WriteMsg(user,post,true)
end
else
return "Post A Sticky Message To The Board"," %[line:Sticky Message]"," %[line:Sticky Message]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbread = {function(user,data,cmd)
if user then
local _,_,lo,hi = data:find("%b<> %p"..cmd.." ([%d]-) ([%d]-)|")
if lo then lo = tonumber(lo) end
if hi then hi = tonumber(hi) end
return ReadBoard(lo,hi,nil,nil,nil,nil)
else
return "Read Board Messages"," %[line:Start Range # (Optional)] %[line:End Range # (Optional)]",
" %[line:Start Range # (Optional)] %[line:End Range # (Optional)]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbreadnick = {function(user,data,cmd)
if user then
local _,_,nick = data:find("%b<> %p"..cmd.." (%S+)|")
if nick then
return ReadBoard(nil,nil,nil,nick,nil,nil)
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <nick name>"
end
else
return "Read Board Messages For Nick"," %[line:Nickname]"," %[line:Nickname]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreadmine = {function(user,data,cmd)
if user then
return ReadBoard(nil,nil,nil,user.sNick,nil,nil)
else
return "Read My Board Messages","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreaddate = {function(user,data,cmd)
if user then
local _,_,m,d,y = data:find("%b<> %p"..cmd.." (%d%d)%/(%d%d)%/(%d%d%d%d)|$")
if m and d and y then
local x = {["month"] = m,["day"] = d,["year"] = y}
local t = os.time(x)
if not t then
return "Date is out of range"
else
return ReadBoard(nil,nil,nil,nil,t,nil)
end
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <mm/dd/yyyy>"
end
else
return "Read Board Messages For Date"," %[line:Date in mm/dd/yyyy format]"," %[line:Date in mm/dd/yyyy format]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreadrange = {function(user,data,cmd)
if user then
local _,_,nick = data:find("%b<> %p"..cmd.." (%S+)|")
local _,_,m,d,y,m2,d2,y2 = data:find("%b<> %p"..cmd.." (%d%d*)%/(%d%d*)%/(%d%d%d%d) (%d%d*)%/(%d%d*)%/(%d%d%d%d)|$")
if m and d and y and m2 and d2 and y2 then
local x,x2 = {["month"] = m,["day"] = d,["year"] = y},{["month"] = m2,["day"] = d2,["year"] = y2}
local t,t2 = os.time(x),os.time(x2)
if t and t2 then
if t > t2 then
return "Start date may not be later than end date."
else
return ReadBoard(nil,nil,nil,nil,t,t2)
end
else
local s = ""
if not t then s = "Start date is" end
if not t2 then
if s:len() == 0 then s = "End date is" else s = s.." and end date are both" end
end
return "Error! "..s.." out of range."
end
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <mm/dd/yyyy> <mm/dd/yyyy>"
end
else
return "Read Board Messages For Date Range",
" %[line:Start Date in mm/dd/yyyy format] %[line:End Date in mm/dd/yyyy format]",
" %[line:Start Date in mm/dd/yyyy format] %[line:End Date in mm/dd/yyyy format]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbquery = {function(user,data,cmd)
if user then
local _,_,query = data:find("%b<> %p"..cmd.." (.+)|")
if query then
return ReadBoard(nil,nil,query,nil,nil,nil)
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <search string>"
end
else
return "Search Board Messages For String"," %[line:Search String]"," %[line:Search String]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = false}
},
mbdelmsg = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if BoardMessages[tonumber(int)] then
table.remove(BoardMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", message number "..int.." is invalid."
end
end
else
return "Remove A Message From The Board"," %[line:Message Number]"," %[line:Message Number]"
end
end,
{[-1] = false,[0] = true,[1] = false,[2] = false,[3] = false}
},
mbdelmymsg = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if BoardMessages[tonumber(int)] then
if BoardMessages[tonumber(int)][2]:lower() == user.sNick:lower() then
table.remove(BoardMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", message number "..int.." is not yours."
end
else
return "Sorry "..user.sNick..", message number "..int.." is invalid."
end
end
else
return "Remove My Message From The Board"," %[line:Message Number]"," %[line:Message Number]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbdelsticky = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if StickyMessages[tonumber(int)] then
table.remove(StickyMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", sticky number "..int.." is invalid."
end
end
else
return "Remove A Sticky From The Board"," %[line:Sticky Number]"," %[line:Sticky Number]"
end
end,
{[-1] = false,[0] = true,[1] = false,[2] = false,[3] = false}
},
mbhelp = {function(user,data,cmd)
if user then
local reply,t,c = "\n\n\t"..MbCfg.Script.." Command Help\n\n\tCommand"..
"\t\tDescription\r\n\t"..string.rep("Ż",40).."\r\n",{},""

for i,v in pairs(MbCmds) do
local desc,args = MbCmds[i][1]()
table.insert(t,"\t+"..string.format("%-15s",i).."\t"..desc.."\r\n")
end
table.sort(t, function(a,b)return a < b end)
for i,v in ipairs(t) do
c = c..v
end
if c:len() > 0 then
return reply..c.."\n\t"..string.rep("Ż",40).."\r\n\r\n"
end
else
return MbCfg.Script.." Help","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
}
}

Serialize = function(tTable, sTableName, hFile, sTab)
sTab = sTab or "";
hFile:write(sTab..sTableName.." = {\n" )
for key, value in ipairs(tTable) do
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
if(type(value) == "table") then
Serialize(value, sKey, hFile, sTab.."\t")
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
hFile:write( sTab.."\t"..sKey.." = "..sValue)
end
hFile:write( ",\n")
end
hFile:write( sTab.."}")
end

SaveFile = function(file,table, tablename )
local hFile = io.open (file , "wb")
Serialize(table, tablename, hFile)
hFile:close()
collectgarbage("collect")
end
« Last Edit: October 02, 2008, 10:13:38 pm by Mutor »
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Yahoo

  • Lord
  • ***
  • Posts: 265
  • Karma: +32/-14
  • People Say "I Dont Know English"
    • Yahoo
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #26 on: September 29, 2008, 12:32:31 pm »
thanks a lot

working fine
"BoRN FIGhTEr"

Offline tojajestem

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #27 on: October 01, 2008, 11:53:23 pm »
Hi!

Can anybody tell me how to allow unregistered users use MsgBoard on my hub ?

I'm running local hub, and have no need to block it...

PS Sorry for my "english", but i don't use the language for a long time...

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #28 on: October 02, 2008, 01:40:11 am »
Each command [starting ~line 314] has a profile permission table,
Code: [Select]
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}Unregistered users are profile -1, set [-1] = true for each command
unregistered user are allowed to use. Defaults ignore them because of
the possibility of spamming the message board on public hubs.
Bear in mind, you shouldn't allow users the delete command [that's really
for Master, Ops] yet you may allow them to delete their own messages.
« Last Edit: October 02, 2008, 01:46:00 am by Mutor »
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline tojajestem

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #29 on: October 02, 2008, 10:13:00 am »
THX ;)

Next question...

I've got something like that:
 "\scripts\msg.lua:86: attempt to index a nil value"

line 86:  local Prof = ProfMan.GetProfile(user.iProfile).sProfileName


What should i do ?

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #30 on: October 02, 2008, 10:15:43 pm »
Yes that was my mistake, I did not account for unregistered users
having command access. The script above [v2.1] has been corrected
and updated. Thanks for the report.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Jusper

  • Member
  • ***
  • Posts: 35
  • Karma: +11/-1
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #31 on: January 11, 2009, 03:04:04 pm »
Mutor, can u add a feature, that shows all the messages (or 10 last messages) on user connect in PM&

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #32 on: January 11, 2009, 04:11:04 pm »
I don't like forcing pm's on user connection so user's
can enable this feature for themselves by command
!msghistory

Code: [Select]
--[[

MessageBoard 2.2 LUA 5.1x [Strict] [API 2]

By Mutor 12/24/07


A simple message board with stickies for the new PtokaX API
This is a complete rewrite of the script and thus a new format.
Previous message logs are incompatible with this version.

-Provides context menu [right click]
-Menus/commands permission per profile, per command
-Hub tab commands display in main, user list commands display in pm from bot.
-Option to always display in private message
-Option to display stickies or messages first
-Duplicate message/percentage same message, block feature
-Anti-advertisment option [ops protected]
-Max message cache limit. Read message limit.
-Alphabetic command listing
-Error reporting to OpNick

+Changes from 2.0 09/28/08
+Added option for ascending/descending read order requested by Yahoo

+Changes from 2.1 01/11/09
+Added option for message history at login requested by Jusper
+Added user command to toggle history [per user]


MessageBoard 2.2 Command Help

Command Description
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
+mbdelmsg       Remove A Message From The Board
+mbdelmymsg     Remove My Message From The Board
+mbdelsticky    Remove A Sticky From The Board
+mbhelp         MessageBoard 2.2 Help
+mbquery        Search Board Messages For String
+mbread         Read Board Messages
+mbreaddate     Read Board Messages For Date
+mbreadmine     Read My Board Messages
+mbreadnick     Read Board Messages For Nick
+mbreadrange    Read Board Messages For Date Range
+mbsticky       Post A Sticky Message To The Board
+mbwrite        Post A Message To The Board
+msghistory     Toggle Message History At Login



]]

MbCfg = {
-- Admins nick for status / error messages
OpNick = "Mutor",
-- "Botname" ["" = hub bot]
BotNick = "[MessageBoard]",
-- Should bot have a key? true/false
BotIsOp = true,
-- Bot's description
BotDesc = "",
-- Bot Email address
BotMail = "user@domain.com",
-- "Command Menu" ["" = hub name]
Menu = "",
-- "Command SubMenu" ["" = script name]
SubMenu = "",
-- File to save messages
MsgFile = "MessageBoard20.dat",
-- File to save sticky messages
StickyFile = "StickyBoard20.dat",
-- Always reply in PM? true/false
PmOnly = true,
-- List Messages Before Stickies? true/false
MsgFirst = true,
-- Prefix Sticky Message With Time Stamp  true/false
StickyTs = true,
-- Maximum number of messages to cache
MaxCache = 500,
-- Default number of messages to read
ReadCnt = 10,
-- Enable Anti-Advertisement filtering?  true/false
AaEnabled = true,
-- Anti-Advertisement triggers
AaTrigs = {
"bounceme.net","hopto.org","myftp.biz","myftp.org","myvnc.com","no-ip.biz","no-ip.info","no-ip.org",
"redirectme.net","servebeer.com","serveblog.net","servecounterstrike.com","serveftp.com","servegame.com",
"servehalflife.com","servehttp.com","servemp3.com","servepics.com","servequake.com","sytes.net","mine.nu",
"zapto.org","blogsyte.com","cable-modem.org","ciscofreak.com","damnserver.com","ditchyourip.com",
"dnsiskinky.com","geekgalaxy.com","homesecuritymac.com","homesecuritypc.com","myactivedirectory.com",
"mymediapc.net","mypsx.net","net-freaks.com","no-ip.ca","no-ip.co.uk","no-ip.com","no-ip.net","point2this.com",
"pointto.us","quicksytes.com","securityexploits.com","securitytactics.com","serveexchange.com","servehumour.com",
"servep2p.com","servesarcasm.com","stufftoread.com","unusualperson.com","workisboring.com","dns2go","myftpsite",
},
-- Acceptable percentage of same words allowed in new posting [set as 101 to disable]
MatchLimit = 35,
-- Descending read order? true/false [false = ascending]
Descend = true,
-- Send message history to connecting users? true/false
History = true,
}

local Path = Core.GetPtokaXPath().."scripts/"
OnStartup = function()
MbCfg.Script,MbCfg.Prefixes = "MessageBoard 2.2",SetMan.GetString(29)
if MbCfg.BotNick == "" then MbCfg.BotNick = SetMan.GetString(21) end
if MbCfg.BotDesc == "" then MbCfg.BotDesc = SetMan.GetString(21).." "..MbCfg.Script end
if MbCfg.BotNick ~= SetMan.GetString(21) then
Core.RegBot(MbCfg.BotNick, MbCfg.BotDesc, MbCfg.BotMail, MbCfg.BotIsOp)
end
if MbCfg.Menu == "" then MbCfg.Menu = SetMan.GetString(0) end
if MbCfg.SubMenu == "" then MbCfg.SubMenu = MbCfg.Script end
if not MbCfg.AaEnabled then MbCfg.AaTrigs = nil end
if not MbCfg.MsgFile:find("^"..Path,1,true) then MbCfg.MsgFile = Path..MbCfg.MsgFile end
if not MbCfg.StickyFile:find("^"..Path,1,true) then MbCfg.StickyFile = Path..MbCfg.StickyFile end
MbCfg.HistoryFile = Path.."MsgHistory.dat"
if loadfile(MbCfg.MsgFile) then
dofile(MbCfg.MsgFile)
else
BoardMessages = {}
SaveFile(MbCfg.MsgFile,BoardMessages,"BoardMessages")
end
if loadfile(MbCfg.StickyFile) then
dofile(MbCfg.StickyFile)
else
StickyMessages = {}
SaveFile(MbCfg.StickyFile,StickyMessages,"StickyMessages")
end
if loadfile(MbCfg.HistoryFile) then
dofile(MbCfg.HistoryFile)
else
History = {}
SaveFile(MbCfg.HistoryFile,History,"History")
end
OnError(MbCfg.Script.." ".._VERSION.." by Mutor has been started, using "..Mem().." of memory.")
end

OnExit = function()
OnError(MbCfg.Script.." ".._VERSION.." by Mutor has been stopped. Freeing "..Mem().." of memory.")
end

OnError = function(msg)
local user = Core.GetUser(MbCfg.OpNick)
if user then Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..msg.."|") end
end

UserConnected = function(user)
if SendMbCmds(user) then
local Prof = "Unregistered User"
if user.iProfile ~= -1 then Prof = ProfMan.GetProfile(user.iProfile).sProfileName end
local msg = "Welcome "..user.sNick..", "..Prof.."'s "..MbCfg.Script.." commands "..
"enabled. Right click hub tab or user list for menu."
Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..msg.."|")
end
local Chk = function(n) for i,v in ipairs(History) do if n:lower() == v:lower() then return true end end end
if next(BoardMessages) and MbCfg.History and Chk(user.sNick) then
local sfx = "\r\n\r\n\tType "..MbCfg.Prefixes:sub(1,1).."msghistory to toggle this pm on/off"
local lo,hi = 1,math.min(MbCfg.ReadCnt,#BoardMessages)
local msg = ReadBoard(lo,hi,nil,nil,nil,nil)..sfx
Core.SendPmToUser(user,MbCfg.BotNick,msg.."|")
end
end
OpConnected,RegConnected = UserConnected,UserConnected

ChatArrival = function(user,data)
local _,_,to = data:find("^$To: (%S+) From:")
local _,_,cmd = data:find("%b<> ["..MbCfg.Prefixes.."](%a+)")
if cmd and MbCmds[cmd] and MbCmds[cmd][2][user.iProfile] then
if MbCfg.AaEnabled and not Core.GetUserValue(user,11) then
for _,v in ipairs(MbCfg.AaTrigs) do
if data:lower():find(v:lower(),1,1) or data:find("%d-%.%d-%.%d-%.%d-") then
return Core.SendToAll("<"..MbCfg.BotNick.."> Let's all laugh at "..
user.sNick..", who tried and failed to advertise on the message board." ),true
end
end
end
local reply = MbCmds[cmd][1](user,data,cmd)
if reply:len() > 0 then
if to and to == MbCfg.BotNick or MbCfg.PmOnly then
Core.SendPmToUser(user,MbCfg.BotNick,reply.."|")
else
Core.SendToUser(user,"<"..MbCfg.BotNick.."> "..reply.."|")
end
end
return true
end
end
ToArrival = ChatArrival

Mem = function() collectgarbage("collect") return string.format("%-.2f Kb.",collectgarbage("count")) end

ReadBoard = function(from,to,query,auth,date,daterange)
local arg = ""
local z
if auth or query or date then
if query then arg = "For Search String: "..query elseif auth then arg = "For Author: "..auth end
z = true
from,to = 1,#BoardMessages
end
if not from then from = 1 else z = true end
if not to then to = math.min(from + MbCfg.ReadCnt,#BoardMessages) else to = math.min(to,#BoardMessages) end
local sret,ret,m,s,x,result = {},{},"","","-",""
if not z and next(StickyMessages) then
for i,v in ipairs(StickyMessages) do
if date or daterange then
local d1,d2 = os.date("%x",v[3]):gsub("%D",""),os.date("%x",date):gsub("%D","")
if daterange then
d3 = os.date("%x",daterange):gsub("%D","")
if d1 >= d2 or d1 <= d3 then
s = s.." ["..i.."]  "..v[1].."\n"
table.insert(sret,{i," ["..i.."]  "..v[1].."\n"})
end
else
if d1 == d2 then table.insert(sret,{i," ["..i.."]  "..v[1].."\n"}) end
end
elseif auth then
if v[2]:lower():find(auth:lower(),1,true) then
table.insert(sret,{i," ["..i.."]  "..v[1].."\n"})
end
elseif not query or v[1]:gsub("^.+> ",""):find(query) then
table.insert(sret,{i," ["..i.."]  "..v[1].."\n"})
end
end
end
if next(BoardMessages) then
for i = from, to do
if date then
arg = "For: "..os.date("%x",date)
local d1,d2 = os.date("%x",BoardMessages[i][3]):gsub("%D",""),os.date("%x",date):gsub("%D","")
if daterange then
arg = arg.." To: "..os.date("%x",daterange)
d3 = os.date("%x",daterange):gsub("%D","")
if d1 >= d2 or d1 <= d3 then
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
else
if d1 == d2 then
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
end
elseif auth then
if BoardMessages[i][2]:lower():find(auth:lower(),1,true) then
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
elseif not query or BoardMessages[i][1]:gsub("^.+> ",""):find(query) then
arg = tostring(to - from + 1).." Messages"
table.insert(ret,{i," ["..i.."]  "..BoardMessages[i][1].."\n\n"})
end
end
end
if #ret > 0 then
if MbCfg.Descend then table.sort(ret, function(a,b) return a[1] > b[1] end) end
for i,v in ipairs(ret) do m = m..v[2] end
result = "\n\n----[ "..tostring(#ret).."  Board Messages ]"..x:rep(175).."\n\n"..m..x:rep(175).."[ "..tostring(#ret).."  Board Messages ]----\n"
end
if #sret > 0 then
if MbCfg.Descend then table.sort(sret, function(a,b) return a[1] > b[1] end) end
for i,v in ipairs(sret) do s = s..v[2] end
local so = "\n\n----[ "..tostring(#sret).."  Sticky Messages ]"..x:rep(175).."\n"..s..x:rep(175).."[ "..tostring(#sret).."  Sticky Messages ]----\n"
if MbCfg.MsgFirst then result = result..so else result = so..result end
end
if result:len() > 0 then return "Results: "..arg..result else return "No matching entries found." end
end

WriteMsg = function(user,msg,sticky)
if MbCfg.AaEnabled and not Core.GetUserValue(user,11) then
for _,v in ipairs(MbCfg.AaTrigs) do
if msg:lower():find(v:lower(),1,1) or msg:find("%d-%.%d-%.%d-%.%d-") then
return "Invalid string detected: "..string.format("%q",v)..". You may not advertise here."
end
end
end
local check,reply = CheckMsg(msg,sticky)
if check then
return "I'm sorry that is too close a match to an existing entry. Last match found:\n\n"..
" [# "..check.."] - "..reply.."\n\n"
else
local msgtype = "board message"
local prof = "Unregistered User"
if user.iProfile ~= -1 then
prof = ProfMan.GetProfile(user.iProfile).sProfileName
end
local msgprefix = "[ "..os.date().." ] <"..user.sNick.."> "
if sticky then
msgtype = "sticky message"
if MbCfg.StickyTs then
table.insert(StickyMessages,1,{msgprefix:gsub("<","%1"..prof.." ")..msg,user.sNick,os.time()})
else
table.insert(StickyMessages,1,{msgprefix:gsub("^%b[] <","<"..prof.." ")..msg,user.sNick,os.time()})
end
SaveFile(MbCfg.StickyFile,StickyMessages,"StickyMessages")
else
table.insert(BoardMessages,1,{msgprefix..msg,user.sNick,os.time()})
SaveFile(MbCfg.MsgFile,BoardMessages,"BoardMessages")
end
while #BoardMessages > MbCfg.MaxCache do table.remove(BoardMessages,#BoardMessages) end
local reply = prof.." "..user.sNick.." just posted a "..msgtype..
" to the message board. Type "..MbCfg.Prefixes:sub(1,1).."mbread to read messages."
Core.SendToAll("<"..MbCfg.BotNick.."> "..reply.."|")
return prof.." "..user.sNick..", your "..msgtype.." was successfully posted."
end
end

CheckMsg = function(msg,sticky)
local T = BoardMessages
if sticky then T = StickyMessages end
if next(T) then
msg = msg:lower(msg)
for i,v in ipairs(T) do
local txt = v[1]:lower():gsub("^%[.-%] ","")
--Exact match, case insensitive
if txt:lower() == msg:lower() then return i,v[1] end
--Match anywhere within message, case insensitive
if txt:lower():find(msg:lower()) then return i,v[1] end
--Run a loop to find percentage of match
local len,cnt = 0,0
for word in txt:gmatch("%S+") do
len = len + 1
if msg:lower():find(word,1,1) then cnt = cnt + 1 end
end
local pct = (cnt/len) * 100 or 0
if pct >= MbCfg.MatchLimit then return i,v[1].." String match: "..string.format("%.2f%%",pct) end
end
end
end

SendMbCmds = function(user)
local u,p,m,s,t,c = "$UserCommand 1 ",MbCfg.Prefixes:sub(1,1),MbCfg.Menu,MbCfg.SubMenu,{},""
for i,v in pairs(MbCmds) do
if v[2][user.iProfile] then
local desc,arg1,arg2 = v[1]()
table.insert(t,{desc,u.."1 "..m.."\\"..s.."\\"..desc.."$<%[mynick]> "..p..i..arg1.."&#124;|",
u.."2 "..m.."\\"..s.."\\"..desc.."$$To: "..MbCfg.BotNick.." From: %[mynick] "..
"$<%[mynick]> "..p..i..arg2.."&#124;|"})
end
end
table.sort(t, function(a,b)return a[1] < b[1] end)
for i,v in ipairs(t) do c = c..v[2]..v[3] end
if c:len() > 0 then Core.SendToUser(user,c) Mem() return true end
Mem()
end

MbCmds = {
mbwrite = {function(user,data,cmd)
if user then
local _,_,post = data:find("%b<> %p"..cmd.." (.+)|")
if not post then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message>"
else
return WriteMsg(user,post,false)
end
else
return "Post A Message To The Board"," %[line:Message]"," %[line:Message]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbsticky = {function(user,data,cmd)
if user then
local _,_,post = data:find("%b<> %p"..cmd.." (.+)|")
if not post then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <sticky message>"
else
return WriteMsg(user,post,true)
end
else
return "Post A Sticky Message To The Board"," %[line:Sticky Message]"," %[line:Sticky Message]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbread = {function(user,data,cmd)
if user then
local _,_,lo,hi = data:find("%b<> %p"..cmd.." ([%d]-) ([%d]-)|")
if lo then lo = tonumber(lo) end
if hi then hi = tonumber(hi) end
return ReadBoard(lo,hi,nil,nil,nil,nil)
else
return "Read Board Messages"," %[line:Start Range # (Optional)] %[line:End Range # (Optional)]",
" %[line:Start Range # (Optional)] %[line:End Range # (Optional)]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbreadnick = {function(user,data,cmd)
if user then
local _,_,nick = data:find("%b<> %p"..cmd.." (%S+)|")
if nick then
return ReadBoard(nil,nil,nil,nick,nil,nil)
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <nick name>"
end
else
return "Read Board Messages For Nick"," %[line:Nickname]"," %[line:Nickname]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreadmine = {function(user,data,cmd)
if user then
return ReadBoard(nil,nil,nil,user.sNick,nil,nil)
else
return "Read My Board Messages","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreaddate = {function(user,data,cmd)
if user then
local _,_,m,d,y = data:find("%b<> %p"..cmd.." (%d%d)%/(%d%d)%/(%d%d%d%d)|$")
if m and d and y then
local x = {["month"] = m,["day"] = d,["year"] = y}
local t = os.time(x)
if not t then
return "Date is out of range"
else
return ReadBoard(nil,nil,nil,nil,t,nil)
end
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <mm/dd/yyyy>"
end
else
return "Read Board Messages For Date"," %[line:Date in mm/dd/yyyy format]"," %[line:Date in mm/dd/yyyy format]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbreadrange = {function(user,data,cmd)
if user then
local _,_,nick = data:find("%b<> %p"..cmd.." (%S+)|")
local _,_,m,d,y,m2,d2,y2 = data:find("%b<> %p"..cmd.." (%d%d*)%/(%d%d*)%/(%d%d%d%d) (%d%d*)%/(%d%d*)%/(%d%d%d%d)|$")
if m and d and y and m2 and d2 and y2 then
local x,x2 = {["month"] = m,["day"] = d,["year"] = y},{["month"] = m2,["day"] = d2,["year"] = y2}
local t,t2 = os.time(x),os.time(x2)
if t and t2 then
if t > t2 then
return "Start date may not be later than end date."
else
return ReadBoard(nil,nil,nil,nil,t,t2)
end
else
local s = ""
if not t then s = "Start date is" end
if not t2 then
if s:len() == 0 then s = "End date is" else s = s.." and end date are both" end
end
return "Error! "..s.." out of range."
end
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <mm/dd/yyyy> <mm/dd/yyyy>"
end
else
return "Read Board Messages For Date Range",
" %[line:Start Date in mm/dd/yyyy format] %[line:End Date in mm/dd/yyyy format]",
" %[line:Start Date in mm/dd/yyyy format] %[line:End Date in mm/dd/yyyy format]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = false,[3] = false}
},
mbquery = {function(user,data,cmd)
if user then
local _,_,query = data:find("%b<> %p"..cmd.." (.+)|")
if query then
return ReadBoard(nil,nil,query,nil,nil,nil)
else
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <search string>"
end
else
return "Search Board Messages For String"," %[line:Search String]"," %[line:Search String]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = false}
},
mbdelmsg = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if BoardMessages[tonumber(int)] then
table.remove(BoardMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", message number "..int.." is invalid."
end
end
else
return "Remove A Message From The Board"," %[line:Message Number]"," %[line:Message Number]"
end
end,
{[-1] = false,[0] = true,[1] = false,[2] = false,[3] = false}
},
mbdelmymsg = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if BoardMessages[tonumber(int)] then
if BoardMessages[tonumber(int)][2]:lower() == user.sNick:lower() then
table.remove(BoardMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", message number "..int.." is not yours."
end
else
return "Sorry "..user.sNick..", message number "..int.." is invalid."
end
end
else
return "Remove My Message From The Board"," %[line:Message Number]"," %[line:Message Number]"
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbdelsticky = {function(user,data,cmd)
if user then
local _,_,int = data:find("%b<> %p"..cmd.." (%d+)|")
if not int then
return "Error!, Usage: "..MbCfg.Prefixes:sub(1,1)..cmd.." <message number>"
else
if StickyMessages[tonumber(int)] then
table.remove(StickyMessages,tonumber(int))
return "Message number "..int.." has been deleted."
else
return "Sorry "..user.sNick..", sticky number "..int.." is invalid."
end
end
else
return "Remove A Sticky From The Board"," %[line:Sticky Number]"," %[line:Sticky Number]"
end
end,
{[-1] = false,[0] = true,[1] = false,[2] = false,[3] = false}
},
msghistory = {function(user,data,cmd)
if user then
local Chk = function(n)
for i,v in ipairs(History) do if n:lower() == v:lower() then return i end end
return false
end
local status,result,x = "added to","You will now receive message history at login.",Chk(user.sNick)
if x then
table.remove(History,x)
status,result = "removed from","You will no "..
"longer receive message history at login."
else
table.insert(History,user.sNick)
end
SaveFile(MbCfg.HistoryFile,History,"History")
return "You have been "..status.." the history table. "..result
else
return "Toggle Message History At Login","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
},
mbhelp = {function(user,data,cmd)
if user then
local reply,t,c = "\n\n\t"..MbCfg.Script.." Command Help\n\n\tCommand"..
"\t\tDescription\r\n\t"..string.rep("Ż",40).."\r\n",{},""

for i,v in pairs(MbCmds) do
local desc,args = MbCmds[i][1]()
table.insert(t,"\t+"..string.format("%-15s",i).."\t"..desc.."\r\n")
end
table.sort(t, function(a,b)return a < b end)
for i,v in ipairs(t) do
c = c..v
end
if c:len() > 0 then
return reply..c.."\n\t"..string.rep("Ż",40).."\r\n\r\n"
end
else
return MbCfg.Script.." Help","",""
end
end,
{[-1] = false,[0] = true,[1] = true,[2] = true,[3] = true}
}
}

Serialize = function(tTable, sTableName, hFile, sTab)
sTab = sTab or "";
hFile:write(sTab..sTableName.." = {\n" )
for key, value in ipairs(tTable) do
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
if(type(value) == "table") then
Serialize(value, sKey, hFile, sTab.."\t")
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
hFile:write( sTab.."\t"..sKey.." = "..sValue)
end
hFile:write( ",\n")
end
hFile:write( sTab.."}")
end

SaveFile = function(file,table, tablename )
local hFile = io.open (file , "wb")
Serialize(table, tablename, hFile)
hFile:close()
collectgarbage("collect")
end
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline HyperT3nsion

  • Junior Member
  • **
  • Posts: 20
  • Karma: +0/-1
  • Hyper T3nsion...! Magician!
    • Dirty South Crew Website
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #33 on: January 12, 2009, 07:32:37 pm »
yes this script is helping me a lot...
but do you know a script that makes the...
bot make a private message...
to the.. users...

http://www.dscmz.co.cc <--- My Website

Ptokax Rules...

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: MessageBoard 2.0 LUA 5.1x [Strict][API 2]
« Reply #34 on: January 12, 2009, 07:35:48 pm »
There is an option for that...
Code: [Select]
-- Always reply in PM? true/false
PmOnly = true,
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

 

determinate determinate