PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: achiever on 07 November, 2006, 09:38:32

Title: message board
Post by: achiever on 07 November, 2006, 09:38:32
--Message Board 1.03 10/20/04 LUA 5
--converted to LUA 5 - 09/15/05
--by Mutor
--
-- Provides common message board. Allow users to read/write the board by profiles
-- Option to delete messages, permission bt profile
-- Caches board messages to exteernal text file for script/hub restarts
--
-- +Changes from v 1.00
-- +Added  case sensitive commands, request by NeoUltimicia
-- +Added  date/time to message, request by NeoUltimicia
-- +Errors now sent to PM as well as main
-- +Corrected save string and tweaked table read
-- +Changes from v 1.01
-- +converted to LUA 5 - by blackwings
-- +these prefixes can be used = !+?$# - by blackwings
-- +Changes from v 1.02
-- +fixed a load file bug - by blackwings
-- +Changes from v 1.03
-- +fixed file handling bug
-- +fixed left over lua4 parts
-- -removed VaildCmd stuff
-- +changed MsgBoard function to ToArrival
-- +fixed Prefix error
-- +added auto detect if bot has hubbotname
-- +fixed some minor bugs
-- +added support for mainchat
-- +fixed extra linespacing
-- ^ Moded by Madman ^
-- ?To Do
-- ?Allow users to delete their own messages
-- ?Add context menu
--
--User Settings-------------------------------------------------------------------------------------
Comm1 = string.lower("read") -- Script Command, read board
Comm2 = string.lower("write") -- Script Command, write to board
Comm3 = string.lower("del") -- Script Command, delete messages
MaxMessages = 50 -- Max number of messages to cache
MsgBoardFile = "MessageBoard.txt" -- Message file, creat this file in your scripts dir.
rprofiles = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=1}  -- Which profiles may read the board?
wprofiles = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=1}  -- Which profiles may write to the board?
dprofiles = {[0]=1,[1]=1,[2]=1} -- Which profiles may delete messages?
Hub = frmHub:GetHubName() -- Hub name, pulled from the Px
Bot = frmHub:GetHubBotName() -- Botname, use frmHub:GetHubBotName() or "BotName"
--End User Settings----------------------------------------------------------------------------------
BoardMessages = {}

function Main()
LoadFromFile(MsgBoardFile)
if not (Bot == frmHub:GetHubBotName()) then
frmHub:RegBot(Bot)
end
end

function ToArrival(user,data)
local s,e,whoTo = string.find(data, "%$To:%s(%S+)")
if whoTo == Bot then
return MsgBoard(user, data)
end
end

function ChatArrival(user, data)
return MsgBoard(user, data)
end

function MsgBoard(user, data)
local data = string.sub(data,1, -2)
local s,e,cmd = string.find(data, "%b<>%s+[%!%+%?%$%#](%S+)")
if cmd then
s,e,Prefix = string.find(data, "%b<>%s+(%p)%S+")
local tCmds = {
[Comm1] = function(user, data)
if rprofiles[user.iProfile]==1 then
ReadBoard(user) return 1
end
end,
[Comm2] = function(user, data)
if wprofiles[user.iProfile]==1 then
local s,e,msg = string.find(data, "%b<>%s+%S+%s(.*)")
if msg == nil then
local dsp
dsp = "\r\n\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
dsp = dsp.."\t"..Hub.."\tMessage Board\r\n"
dsp = dsp.."\tDid you forget what you were going to say?\r\n"
dsp = dsp.."\tCommand syntax is ->> "..Prefix..Comm2.." \r\n"
dsp = dsp.."\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
user:SendData(Bot,dsp)
SendPmToNick(user.sName,Bot,dsp)
return 1
else
Write2Board(user, msg)
return 1
end
end
end,
[Comm3] = function(user, data)
if dprofiles[user.iProfile]==1 then
local s,e,delmsg = string.find(data, "%b<>%s+%S+%s+(%d+)")
if (delmsg == nil) then
local dsp0
dsp0 = "\r\n\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
dsp0 = dsp0.."\t"..Hub.."\tMessage Board\r\n"
dsp0 = dsp0.."\tDelete which message? Provide message number\r\n"
dsp0 = dsp0.."\tCommand syntax is ->> "..Prefix..Comm3.." \r\n"
dsp0 = dsp0.."\tType ->> "..Prefix..Comm1.."  to list messages \r\n"
dsp0 = dsp0.."\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
user:SendData(Bot,dsp0)
SendPmToNick(user.sName,Bot,dsp0)
return 1
else
--if BoardMessages[delmsg] ~= 1 then user:SendData(Bot,dsp0) return 1 end
table.remove(BoardMessages, delmsg)
SaveToFile(MsgBoardFile , BoardMessages , "BoardMessages")
user:SendData(Bot,"Message number [ "..delmsg.." ] has been deleted.")
SendPmToNick(user.sName,Bot,"Message number [ "..delmsg.." ] has been deleted.")
return 1
end
end
end,
}
if tCmds[cmd] then
return tCmds[cmd](user, data)
end
end
end

function ReadBoard(user)
local n = table.getn(BoardMessages)
local dsp1
dsp1 = "\r\n=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
dsp1 = dsp1.."  "..Hub.."\tMessage Board\t Displayng last [ "..n.." ] message(s)\r\n"
dsp1 = dsp1.."=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n\r\n"
for i = 1, n do
dsp1 = dsp1.."\r\n[ "..i.." ]\t"..BoardMessages[i].."\r\n\r\n"
end
SendPmToNick(user.sName, Bot, dsp1)
end

function Write2Board(user, msg)
local dsp2
dsp2 = "\r\n\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
dsp2 = dsp2.."\t[ "..user.sName.." ] just posted to the "..Hub.." Message Board\r\n"
dsp2 = dsp2.."\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n"
dsp2 = dsp2.."\tType "..Prefix..Comm1.." in main/pm to list or "..Prefix..Comm2.." to post .\r\n"
dsp2 = dsp2.."\t=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=<>=-=\r\n\r\n"
SendToAll(Bot, dsp2)
table.insert(BoardMessages, ("On "..os.date("%B %d %Y %X ").." [ "..user.sName.." ] wrote: ")..msg)
if table.getn(BoardMessages) > MaxMessages then table.remove(BoardMessages, 1) end
SaveToFile(MsgBoardFile , BoardMessages , "BoardMessages")
end

function Serialize(tTable, sTableName, sTab)
assert(tTable, "tTable equals nil");
assert(sTableName, "sTableName equals nil");
assert(type(tTable) == "table", "tTable must be a table!");
assert(type(sTableName) == "string", "sTableName must be a string!");
sTab = sTab or "";
sTmp = ""
sTmp = sTmp..sTab..sTableName.." = {\n"
for key, value in tTable do
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
if(type(value) == "table") then
sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
end
sTmp = sTmp..",\n"
end
sTmp = sTmp..sTab.."}"
return sTmp
end

function SaveToFile(file , table , tablename)
local handle = io.open(file,"w+")
handle:write(Serialize(table, tablename))
handle:flush()
handle:close()
end

function LoadFromFile(file)
local handle = io.open(file,"r")
if (handle ~= nil) then
dofile(file)
handle:flush()
handle:close()
end
end

sir,

i was using the script message board from lua 5 in the lua 5.1
the scripts gives no error but when some 1 writes some thing the script is stoped,
and then if u try to read wats writen it shows u a blank board.

can ne 1 help me  :(

thks,

achiever.

ps:- the right click doesnt work when u try some thing from right click option it has no effect at all and when ne next command is typed, it is all shown together.
!read<achiever> !write this script testing <achiever> +read

plzz fix it also :(

thks.
Title: Re: message board
Post by: 6Marilyn6Manson6 on 07 November, 2006, 09:43:14
Update your post without space in [ code] and in [ /code], after wait replyes of Mutor :D
Title: Re: message board
Post by: achiever on 08 November, 2006, 09:03:06
hi,

thank u sir, this script works great n has many features,
thks a lot :D

bye,

achiever.
Title: Re: message board
Post by: achiever on 24 March, 2007, 12:25:39
 :)

that was my duty,

achiever
Posted on: November 09, 2006, 08:39:28 am
hi,

sir can u add just a small part, that when an operator wants to display a message permanently for some time then that message should be kept at the bottom seperately, like a sticky message and should be able to remove it when the need is done.

thks,

achiever
hi mutor,

it has been long time since i posted this request but i m in real need of it so plzz is can this scipt be modified accordingly

thks,
achiever.
Title: Re: message board
Post by: speedX on 24 March, 2007, 15:20:56
For using Message Board v1.09, do we have to delete the old database (v1.08) ??
Title: Re: message board
Post by: speedX on 24 March, 2007, 16:46:18
Quote from: Mutor on 24 March, 2007, 15:27:06
No, sticky messages were added as a separate file to avoid this.
[of course it would hurt to back up your message file :P]
Sticky file will be created if non-existent.

hm..smart boy  :P
Hey Mutor, the +readby command doenst seem to be working in this new version.
It always shows tht "there are no messages by "user"" even if his board messages are there...
Title: Re: message board
Post by: achiever on 24 March, 2007, 21:42:43
hi,

thks a lot mutor

achiever.
the scirpt shows "there are no messages to display" on read command.

i changed
MsgFile = "MessageBoard.dat",

by
MsgFile = "MessageBoard.txt",

and now its working for me with old data, plzz check it out i may be wrong.

thks,
achiever
Title: Re: message board
Post by: achiever on 14 April, 2007, 17:48:24
hi,
yes i had not checked all the commands after making changes in 1.09.
thks for the info, has switched to 1.08b.
thks,
achiever.
hi,

plzz modify the script such that no 1 use this board as an advertise board.
and can it be made such that instead of banning that user, he wont be able to write on message board for some preset time in days and this notification is also added to the sticky messages part.

thks,
achiever
Title: Re: message board
Post by: Yahoo on 15 April, 2007, 06:36:40
Hi mutor..... just add 1 more option in this script. For now thrs only option by which very few no. of messages can be stored in .txt file.

Can u make 1 change by which the .txt file will store all messages added by users but only few latest messages will be shown wen v type +read.

And also wen any user tries to search, the script will search from all the messages stored and not only those few messages.

Like for example, 1000 messages have been stored in .txt file but if i type +read it will show latest 100 messages but for searching, it will search from all 1000 messages.

(Originally Posted by SwapY? in Lua Board#2)
Title: Re: message board
Post by: Yahoo on 15 April, 2007, 07:51:14
actually qwhat he want to say is that (very few no. of messages can be stored in .txt file) means
Max number of messages to cache
MaxMsg = 200,  <--- this should be unlimited i.e when a user write in message board it should be save irrespective of the max number of message for eg if user write 201 message then also it should be save.All message which users write should be save irrespective of max messages setting
The Latest (x) number of messages should only be displayed but the message number should be the origianl one the one that is in the text file for eg:
Max number of messages to read [most recent]
MaxRead = 10
[ 241 ]   April 14 2007 21:06:20  [ orco ]  : someone plzz download and share THE NAMESAKE.
[ 242 ]   April 14 2007 21:25:22  [ djmafia ]  :  will share spiderman 3 full movie in a week  a djmafia release ! ! !
[ 243 ]   April 14 2007 21:37:46  [ djmafia ]  : srry guys ! !it was a fake file ! ! !
[ 244 ]   April 14 2007 22:26:42  [ meetsantyz ]  :  Any interested in selling old pc ( must be  > 2 ghz) or any old moniotor / hard disk  etc... contact me on 9869380948.....  I need 6 old pc in this week... contact ASAP
[ 245 ]   April 14 2007 22:27:04  [ meetsantyz ]  : Any interested in selling old pc ( must be  > 2 ghz) or any old moniotor / hard disk  etc... contact me on 9869380948.....  I need 6 old pc in this week... contact ASAP
[ 246 ]   April 14 2007 22:59:04  [ Noodle ]  : Megadeth - A Tout Le Monde ( Live Ottawa Mar 28 2007 )
[ 247 ]   April 15 2007 00:42:40  [ the_game ]  : sm1 plz share the movie   "bullet proof"    starrin adam sandler....and also   "batman begins "    pls dload or it share it....awesome movie guys....thx
[ 248 ]   April 15 2007 10:45:01  [ Zapper ]  : Encarta Shared by me too ! Download ASAP

i hope u understand what i want to explain to you
Title: Re: message board
Post by: Yahoo on 15 April, 2007, 08:44:43
thanks dude and i am really sorry if i have wrote something wrong
i will like to have a small change in the script instead of
Max number of messages to read [most recent]
MaxRead = 10,
cant be in days for eg
Max number of messages to read [most recent]
MaxRead = 3, <--- days
Title: Re: message board
Post by: achiever on 15 April, 2007, 09:09:43
hi,
thks for the modifications,
but can u plzz add the feature that user can be disabled to write or read by ops for some time.

thks,
achiever.
Title: Re: message board
Post by: Yahoo on 15 April, 2007, 19:08:37
mutor if possible plzz comment on my latest post (about the days)
Title: Re: message board
Post by: Yahoo on 23 April, 2007, 06:11:28
i will like to have small change in the script .can it be possible to make the commands case insensitive
Title: Re: message board
Post by: achiever on 24 April, 2007, 18:37:11
hi mutor,
is it possible to show the message posted today as
Quote[ 209 ]   TODAY 19:58:04  [ yogi7 ] : testing message for today 

and tomorrow it should show this message as
Quote[ 209 ]   YESTERDAY 19:58:04  [ yogi7 ] : testing message for today 

then from day-after-tomarrow it should show the date as it does now.
Quote[ 209 ]   April 24 2007 19:58:04  [ yogi7 ] : testing message for today 

hope u understood me.
i got the idea from this site itself :-)

thks,
Title: Re: message board
Post by: achiever on 25 April, 2007, 09:33:37
well it will be difficult to be done with all the post till now, but i m ready to move on ;-)
will this have all the features of 1.08d ?

thks,
Title: Re: message board
Post by: Yahoo on 25 April, 2007, 11:37:16
sorry for posting this request again but i didnt had any reply for this post
i will like to have small change in the script can it be possible to make the commands case insensitive
Title: Re: message board
Post by: Leun on 25 April, 2007, 11:45:49
remove the string.lower() in the ChatArrival and cmds
Title: Re: message board
Post by: Creative on 25 April, 2007, 17:46:39
Hello Mutor,
                I am using "Message Board 1.08d   10/20/04 LUA 5 .0/5.1" script.
Sir just tell me what should i edit, if i want the sticky message to be seen as,

<Date> Operator Type +rules.

instead of,

Sticky [ 1 ]  *<Master Creative> Type +rules*

Please tell me what addition i should do in this script.
Title: Re: message board
Post by: Yahoo on 26 April, 2007, 17:19:47
can u plzz post the code only for removing the case insensitive
thanks in advance
Title: Re: message board
Post by: Thor on 26 April, 2007, 18:29:35
if string.find(data,v,1,1) or string.find(data,"%d+%.%d+%.%d+%.%d",1,1) then
Btw, I don't understand the second pattern... :-/
Title: Re: message board
Post by: Thor on 27 April, 2007, 16:26:01
string.find(data,"%d+%.%d+%.%d+%.%d",1,1)
It's match with %d+%.%d+%.%d+%.%d and not with numbers I think, because it has four parameter also...
Title: Re: message board
Post by: Creative on 29 April, 2007, 06:37:09
Hello Sir
           As i told that in User Alerts post that i already have Right Click menu, so i would like to disable the submenu option from this script too. Please tell me how to disable submenu option in this script.

I tried to make all profiles 0 in
"-- Which profiles receive command menu(s)?" option but then script +read and +write commands stops working.
Title: Re: message board
Post by: Creative on 29 April, 2007, 17:24:28
Thank you ver much Sir

I appreciate your work very much :)

Keep it Up
Title: Re: message board
Post by: achiever on 30 April, 2007, 12:28:55
hi,
when i m showinig last 12 or ne number of messages then while reading the board i get

QuoteFusion Hub   Message Board    Displayng last [ 169 ] message(s)

which the number of last message on board.

plzz check,
thks,
Title: Re: message board
Post by: Creative on 01 May, 2007, 07:18:32
Hello Sir,
           Same problem i am facing. Whatever the MaxRead number i set, but while reading the message board, it shows

QuoteHyper Hub   Message Board    Displayng last [ 345 ] message(s)
Title: Re: message board
Post by: Yahoo on 01 May, 2007, 09:18:06
thanks for removing case insensitive. i am also facing same problem which is faced by achiever and creative
Title: Re: message board
Post by: achiever on 09 May, 2007, 06:03:28
working fine thanks
sorry for late report but i just noticed that if i delete a sticky message it gets deleted and is not shown again, but when i restart script or hub the message is still there.

plzz check.
thks
Title: Re: message board
Post by: achiever on 09 May, 2007, 07:15:04
yes working fine.

thks,
Quote from: Creative on 25 April, 2007, 17:46:39
just tell me what should i edit, if i want the sticky message to be seen as,

<Date> Operator Type +rules.

instead of,

Sticky [ 1 ]  *<Master Creative> Type +rules*

Please tell me what addition i should do in this script.

i tried it
change line 446 to this
str = str..i.." <"..v[2].."> "..v[1].." :- "..v[3].."\r\n"

and also line 488 to this
table.insert(StickyMessages,{profile,os.date("%m/%d/%Y"),sticky,})

working for me
Quote=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<>=-=
1 <05/09/2007> Operator :- testing format
=-=<>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<>=-=

will just show now
msg.no.    date         profile       mesg

i think this what u asked for.

hope u dont mind me messing with ur script mutor.

thks,
Title: Re: message board
Post by: achiever on 10 May, 2007, 05:48:29
Quote from: Mutor on 09 May, 2007, 22:26:42
Not at all, but that request was already handled in v1.08e
+Changes from v 1.08d By Mutor        04/25/07
+Added case insensitivity for commands Requested by Yahoo
~Changed sticky table/file format Requested by Creative

1 <04/25/2007> Master Mutor   Sticky test message...


i m not sure what he (creative) needed now, but i thought that he did not want to c the username in sticky message so tried the change and posted it. v1.08e still shows users name (to me atleast ;) )

neways mutor thanks a lot for a great script.
Title: Re: message board
Post by: Yahoo on 10 May, 2007, 08:24:48
hi mutor, can u just post tht code for adding the date to sticky message i am using 1.08dversion of message board
thanks in advance
Title: Re: message board
Post by: Yahoo on 10 May, 2007, 13:10:04
bcoz i have made some changes in tht script thts y i wanted the code
Title: Re: message board
Post by: Creative on 10 May, 2007, 14:24:31
Hello Sir.
           Till now i was using "Message Board 1.08d" But as you have made many changes in "Message Board 1.08e" so i tried using 1.08e script. First i deleted old message board.txt and sticky.txt and after restarting the scripts when new files were created, i copied all messages from messageboard.txt to new file.

But still it is showing
Hyper Hub Message Board Displayng last [ 523 ] message(s)

Other commands are working fine.
Title: Re: message board
Post by: Creative on 11 May, 2007, 06:56:54
MaxMsg = 9999,
-- Max number of messages to read [most recent]
MaxRead = 50,
Title: Re: message board
Post by: Yahoo on 11 May, 2007, 10:42:08
what should be the code if i want to show the commands to all users for eg if a user type +read this command must be seen by all users in main chat
Title: Re: message board
Post by: Yahoo on 12 May, 2007, 06:51:05
now the code look some what like this
if cmd then
cmd = string.lower(cmd)
SendToAll(user.sName,frmHub:GetPrefixes()[1]..cmd)
if tCmds[cmd] then

but now i am getting the commands for 2 times i.e qwhen i type +read i get
*** Server command: +read
[PoTtEr:09:52:38] <yahoo> !read
[PoTtEr:09:52:38] <yahoo> +read
and the output is also not shown
Title: Re: message board
Post by: Creative on 13 May, 2007, 07:57:33
Hellp Sir.
           Can you tell me what problem i am facing? i have replied to your questions, please help me.
Title: Re: message board
Post by: Yahoo on 13 May, 2007, 08:54:49
sir it is still not working. shld i send u my message board script??? and i am using the following script
- [ 1 ]  opsecurity_v2.02.lua
- [ 1 ]  block registration.lua
- [ 1 ]  chatrooms.v4.15.lua
- [ 1 ]  Dump_Board_1.09_L5.1.lua
- [ 1 ]  graph.lua
- [ 1 ]  HelP_BoT_1.0_by_6Marilyn6Manson6.lua
- [ 1 ]  Hubtime.lua
- [ 1 ]  life time.lua
- [ 1 ]  membercount (nit).lua
- [ 1 ]  messge board 1.08d.lua
- [ 1 ]  mute.lua
- [ 1 ]  mutor socks5.lua
- [ 1 ]  NetLogin.lua
- [ 1 ]  onjoin.lua
- [ 1 ]  oprules.lua
- [ 1 ]  password recovery.lua
- [ 1 ]  Poll.Bot.v.1.3.LUA5.1-TTB.lua
- [ 1 ]  postman_0.7.lua
- [ 1 ]  record bot.lua
- [ 1 ]  RegLog_1.0f_L5.1.lua
- [ 1 ]  regstats.lua
- [ 1 ]  right click .lua
- [ 1 ]  Rincewind's Anagrams.lua
- [ 1 ]  Rincewind's HubInfo.lua
- [ 1 ]  Rincewind's LastSeen.lua
- [ 1 ]  Rincewind's Numbers.lua
- [ 1 ]  self registration.lua
- [ 1 ]  server_Board_1.08_L5.1.lua
- [ 1 ]  settings_v1.0.lua
- [ 1 ]  Trivia-Ex-V.0.681.lua
- [ 1 ]  userlist.lua
- [ 1 ]  User_Alert_1.0f_L5.1.lua
- [ 1 ]  zztime bot.lua
- [ 1 ]  meanstats.lua
Title: Re: message board
Post by: Creative on 13 May, 2007, 08:56:16
Its displays last 50 messages as i have set MaxRead = 50

But it shows,
QuoteMessage Board    Displayng last [ 523 ] message(s)

Or just tell me, if i use the orignal script again, then what should be done to save all the messages which are already posted by users in my hub.
Title: Re: message board
Post by: Yahoo on 13 May, 2007, 12:39:34
i tried tht also but still i am not getting any output and also the commands are shown 2 times
so if u have time can i send u tht script
Title: Re: message board
Post by: Creative on 13 May, 2007, 13:40:50
Quote from: Yahoo on 11 May, 2007, 10:42:08
what should be the code if i want to show the commands to all users for eg if a user type +read this command must be seen by all users in main chat
As far as i know, just find this line
return user:SendPM(MsgCfg.Bot,tCmds[cmd](user,data)),1

replace the above statement by following,
return user:SendPM(MsgCfg.Bot,tCmds[cmd](user,data)),0
This should work.
Title: Re: message board
Post by: Yahoo on 13 May, 2007, 14:32:10
thanks creative it is working  :D
Title: Re: message board
Post by: Creative on 16 May, 2007, 14:35:53
Hello Mutor,
                Sometimes users try to spam the Message Board by posting same messages 2-3 times.
Is it possible to avoid them from spamming?
Once any user post any message he cant post the same message again, if he try to do this he will get a message that this "This message has already been posted."
I hope u got what i wanted to tell :)
Title: Re: message board
Post by: Creative on 17 May, 2007, 06:09:46
Yes sir, combination of both will be cool. You take your time to add this option :)
I'll wait for this addtion,
Thanks
Title: Re: message board
Post by: achiever on 17 May, 2007, 14:41:27
hi mutor,

can u plzz also add a command to read posts posted on perticular date?
like +readate <07/05/07> or something.

not in hurry for this 1 just got an idea and posted it up :P

thks,
Title: Re: message board
Post by: achiever on 21 May, 2007, 06:31:11
thks a lot, :)
achiever.
Title: Re: message board
Post by: Yahoo on 21 May, 2007, 12:45:36
sir when i change the filename of
--Sticky Message file.
StickyFile = "StickyBoard2.txt",

to
--Sticky Message file.
StickyFile = "StickyBoard.txt",

i get the following error
message board.lua:468: attempt to concatenate field '?' (a nil value)

sir i will also like to know abt the anti-spamming progress as it will be a great addition to a great script

thanks in advance
Title: Re: message board
Post by: achiever on 21 May, 2007, 15:13:04
Quote from: Yahoo on 21 May, 2007, 12:45:36
i get the following error
message board.lua:468: attempt to concatenate field '?' (a nil value)
check ur scripts folder for a file named StickyBoard.txt which is not needed i think, remove it and try running the script
Title: Re: message board
Post by: achiever on 22 May, 2007, 17:29:45
ok. i thought just removing the old files would do it.
Title: Re: message board
Post by: Creative on 23 May, 2007, 07:38:49
Hello Mutor,
                I hope you are working with the script for avoiding Spamming from users. :)
Title: Re: message board
Post by: Creative on 25 May, 2007, 07:56:23
Ya, they sign in by their name in front of the message.... and we can deal with them later, but sometimes operators/masters are busy with their schedule and are not able to keep on eye on them everytime, so i was thinking if the script itself avoid them for posting same messages more than 1 time.
Title: Re: message board
Post by: speedX on 26 May, 2007, 07:11:48
Hello Mutor,
Can the +search and +readby command be associated with MaxRead messages only, and not with the MaxMsg, please.
I mean, tht when a user types +search command or +readby command then they would work within the MaxRead messages only.
Title: Re: message board
Post by: speedX on 29 May, 2007, 10:49:04
Quote from: Mutor on 28 May, 2007, 22:50:35
I see no benefit to doing that.
Especially with respect to the search.
So I won't do that.
??

M8 benefit is there,
Most of the users are not interested in old messages, they use +search and +readby command for new latest messages.
Those users who are interested in reading old messages can use +readdate command :D
Title: Re: message board
Post by: speedX on 07 June, 2007, 07:39:50
Hello Mutor,
Could u plzz add a command like +read x-y ?
if a user types +read 1-100, thn he will get the first 100 messages......
And if he types only +read, he will get the MaxRead messages....
Title: Re: message board
Post by: Yahoo on 07 June, 2007, 18:06:29
gr8 idea speedx i will also love to have such a command
Title: Re: message board
Post by: speedX on 08 June, 2007, 10:26:59
Thx Mutor, but is it possible to change the range command to read.
If user types +read 1-100 he will get the first 100 messages and if he types +read only he will get the maxread messages..
Is it possible m8? coz I have seen a similar command like this in the script Tophubbers by Jiten
Title: Re: message board
Post by: Snooze on 08 June, 2007, 19:49:16
Without digging too far into the script, I'd say that making a "from" - "to" statement would introduce a complexity not needed in a script like this.
Though making a simple !read x (where x is the value from 0 to x) would make much more sense. (if x == nil then get all)

Would that option fit your needs?


-Snooze


Title: Re: message board
Post by: speedX on 08 June, 2007, 20:19:22
Ok Snooze, even tht would be fine for me :)
Title: Re: message board
Post by: Creative on 12 June, 2007, 15:44:58
Hello Mutor,
                In my Ptokax, i have made a new profile which comes after Reg. Please tell me how to allow that new profile to use all commands of this script.
Title: Re: message board
Post by: Naithif on 12 June, 2007, 16:20:03
Quote from: Creative on 12 June, 2007, 15:44:58
Hello Mutor,
                In my Ptokax, i have made a new profile which comes after Reg. Please tell me how to allow that new profile to use all commands of this script.

Just edit these lines according to your profile numbers (if it's a new profile coming after Reg, it should be [4]=1 to allow that one where you write it)

-- Which profiles may read the board?
ReadProf = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=1},
-- Which profiles may write to the board?
WriteProf = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=1},
-- Which profiles may delete messages?
DelProf = {[0]=1,[1]=0,[2]=0},
-- Which profiles may read messages from specified user?
ReadByProf = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=0},
-- Which profiles may search messages for specified string?
SearchProf = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=0},
-- Which profiles receive command menu(s)?
CmdProf = {[0]=1,[1]=1,[2]=1,[3]=1,[-1]=1},
Title: Re: message board
Post by: speedX on 13 June, 2007, 11:05:52
HI Mutor,
How can I make the +readdate command to work with a date format like this
Quote
12 June'07 - 20:38
Title: Re: message board
Post by: speedX on 17 June, 2007, 20:57:25
nope...no time...only date

12 June'07
Title: Re: message board
Post by: speedX on 18 June, 2007, 06:21:52
Quote from: Mutor on 17 June, 2007, 21:17:11
If it's too much trouble to actually use the numerical month

But m8, is it so much different from the existing format??
Title: Re: message board
Post by: speedX on 25 June, 2007, 18:26:36
*BUG

Quote
+read
[ 1 ]   On June 01 2007 00:44:55  [ speedx ] wrote: M

[ 2 ]   On June 05 2007 00:45:00  [ speedx ] wrote: B

[ 3 ]   On June 09 2007 00:45:02  [ speedx ] wrote: C

[ 4 ]   On June 12 2007 00:45:06  [ speedx ] wrote: D

[ 5 ]   On June 23 2007 00:54:47  [ speedx ] wrote: R

[ 6 ]   On June 26 2007 00:54:50  [ speedx ] wrote: A

[ 7 ]   On June 26 2007 00:57:22  [ speedx ] wrote: T

[ 8 ]   On June 26 2007 00:57:26  [ speedx ] wrote: Y

Quote
+readdate 06/25/2007
[ 6 ]   On June 26 2007 00:54:50  [ speedx ] wrote: A

[ 7 ]   On June 26 2007 00:57:22  [ speedx ] wrote: T

[ 8 ]   On June 26 2007 00:57:26  [ speedx ] wrote: Y

Quote
+readdate 06/25/2077
[ 1 ]   On June 01 2007 00:44:55  [ speedx ] wrote: M

[ 2 ]   On June 05 2007 00:45:00  [ speedx ] wrote: B

[ 3 ]   On June 09 2007 00:45:02  [ speedx ] wrote: C

[ 4 ]   On June 12 2007 00:45:06  [ speedx ] wrote: D

[ 5 ]   On June 23 2007 00:54:47  [ speedx ] wrote: R

[ 6 ]   On June 26 2007 00:54:50  [ speedx ] wrote: A

[ 7 ]   On June 26 2007 00:57:22  [ speedx ] wrote: T

[ 8 ]   On June 26 2007 00:57:26  [ speedx ] wrote: Y

It shows all the messages when the second last digit of the year is put anything other than zero.
Title: Re: message board
Post by: Psycho_Chihuahua on 25 June, 2007, 19:23:47
as that is post 12/31/2037 i dont think there is much we can do about it


besides - when posting a bug it would help if wrote more Info instead of letting ppl study your post 20 times to find out what you are talking about
Title: Re: message board
Post by: speedX on 25 June, 2007, 21:15:40
Quote from: Psycho_Chihuahua on 25 June, 2007, 19:23:47
as that is post 12/31/2037 i dont think there is much we can do about it


besides - when posting a bug it would help if wrote more Info instead of letting ppl study your post 20 times to find out what you are talking about

Sorry and thx...
Title: Re: message board
Post by: Creative on 19 July, 2007, 10:20:30
Hello Mutor,
                As i posted earlier about spamming....... i would like if you add one more function by which any user wont be able to add same message more than one time.
I have seen many users adding same messages 2-3 times, when v try to ask ... why u added 2-3 times, they say by mistake it got added....... so it would be better if the script doesnt allow same message to be added again.
I am using "Message Board 1.08e   10/20/04 LUA 5 .0/5.1" script.
And i'll wait for the change :)
Thank You.
Title: Re: message board
Post by: Creative on 20 July, 2007, 10:13:46
Hello Sir,
           Thanks for replying to my request soon :) Script is working fine...... but the problem is, even if one word matches with any text from "MessageBoard.txt" it gives the message.
Can you change the function so that, the script wont allow same line again and not just same word.
I hope you understand what i am trying to say Sir :)
Thank You.
Title: Re: message board
Post by: Creative on 21 July, 2007, 10:27:45
Sir, i am confused  ???........... can you please show me, what change i should make in line 577??
Title: Re: message board
Post by: Snooze on 21 July, 2007, 10:37:30
Change

if string.find(string.lower(txt),msg) then return i,v end

to

--if string.find(string.lower(txt),msg) then return i,v end

Hope it helps,

Snooze
Title: Re: message board
Post by: Creative on 21 July, 2007, 14:13:00
Snooze....... i cant see any change in both codes.....  ???
Title: Re: message board
Post by: Creative on 28 July, 2007, 09:59:00
Hello Mutor,
               i tried to comment on line --if string.find(string.lower(txt),msg) then return i,v end

But i cant find any change. Can you please make the small change so that same messages will be blocked....
Thanks.
Title: Re: message board
Post by: achiever on 28 July, 2007, 11:26:54
hi mutor,

wow this script has been growing like the gaint beanstalk :) and yet i would like to request more!

can the search command be added with a date to search on wards.
i.e +search games 30/01      --will search from the messages of current year from the date till today
or  +search games 30/05/07  --will search from the messages the given year  from the date till today

and the search without date will work as in the script now

also i tried to read 'range'  by command + read 100 - 175 and i got all the messages and also +read 50 gave nothing related to reading specified range, and i m now using
Message Board 1.08i   10/20/04 LUA 5 .0/5.1
plzz check if range command is working or was i wrong.

thanks,
achiever.
Title: Re: message board
Post by: speedX on 29 July, 2007, 09:39:31
Quote from: achiever on 28 July, 2007, 11:26:54
hi mutor,

wow this script has been growing like the gaint beanstalk :) and yet i would like to request more!

can the search command be added with a date to search on wards.
i.e +search games 30/01      --will search from the messages of current year from the date till today
or  +search games 30/05/07  --will search from the messages the given year  from the date till today

and the search without date will work as in the script now
Nice idea m8.....

Quote from: achiever on 28 July, 2007, 11:26:54
also i tried to read 'range'  by command + read 100 - 175 and i got all the messages and also +read 50 gave nothing related to reading specified range, and i m now using
Message Board 1.08i   10/20/04 LUA 5 .0/5.1
plzz check if range command is working or was i wrong.

thanks,
achiever.
Dude the command works, but u r using it in wrong way...
The command is +read x y [There is no hyphen between the values x and y]
Title: Re: message board
Post by: achiever on 29 July, 2007, 10:16:54
pleased u like the idea, hope mutor likes it too and doesnt feel it a waste.

i tried +read 220 235 but this time the command just didnt show, i mean it was not shown on main chat and even it did not show range of messages and also it did not show the whole list which i get with +read.

thanks,
achiever.
Title: Re: message board
Post by: Creative on 08 August, 2007, 18:02:35
Quote from: Creative on 28 July, 2007, 09:59:00
Hello Mutor,
               i tried to comment on line --if string.find(string.lower(txt),msg) then return i,v end

But i cant find any change. Can you please make the small change so that same messages will be blocked....
Thanks.

Hello Mutor,
                I hope you are working on the small request shown above.  :)
Thanks.
Title: Re: message board
Post by: speedX on 09 August, 2007, 06:15:36
Quote from: Mutor on 09 August, 2007, 06:00:03
Thats was added in version 'i' to be found on the previous page of this topic.

Nice....
Thank you Mutor..
Title: Re: message board
Post by: sourabhiitm on 08 October, 2007, 15:59:25
Is there any possibility that i can make 2-3 message boards like this than register in hub.
Title: Re: message board
Post by: speedX on 07 November, 2007, 15:58:21
Hello Mutor,
When we reduce the MaxMsg number in the script thn the Messages in the Message Board are not reduced to tht number instead it stops at the current message number (assuming tht the messages in the message board are more than the MaxMsg. number).So is it possible to delete the older messages and get back to the new number specified?? Also could u add an option whether to enable or disable duplicate message protection?

Is it possible to convert this script to the NEW API?

Thank you.....



Title: Re: message board
Post by: Yahoo on 21 December, 2007, 14:08:03
hello mutor
i found tht whenever a user types +read command in pm the message board is accessable so lot of users are having problem with tht
so can u please change tht so the the command must only be accessable frm main chat
Title: Re: message board
Post by: Yahoo on 23 December, 2007, 05:18:37
Thanks for the code mutor

Can u please recode the script for new API
thanks