PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: [BaGlAnD?]Cyber_SIA? on 09 November, 2004, 22:30:08

Title: Bulletin/message-board
Post by: [BaGlAnD?]Cyber_SIA? on 09 November, 2004, 22:30:08
I'm searching 4 a Messageboard much like Mutor's...

http://board.univ-angers.fr/thread.php?threadid=2979&boardid=12&sid=eab0a8fbfb09dbf1f04c9ca7b8fa2d9b

But i need one where i can use the +Read funktion... :D

I've tried everything and it dosen't work....

I can write - Delete - But not read....

And yeeees, i've done all of the thing he explaind in the tread...

Some one please help...??? ?(

Title:
Post by: enema on 16 November, 2004, 08:18:14
This little thing doesnt have delete function... maybe you can stick them together :D
-- Make a file called releases.txt in \Scripts Folder
-- Made By Optimus

sBot = ""

timedate = date()
file = "releases.txt"

display1 = "Item"
display2 = "Description"
display3 = "Item"

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
_,_,cmd=strfind(data, "%b<>%s+(%S+)")

if (cmd=="!read") then
ReadRelease(user, data, cmd)
return 1

elseif (cmd=="!write") then
if user.bOperator or user.iProfile == 2 then
s,e,cmd,release,desc = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )

if desc == nil then
description = "No "..display2.." specified!"
s,e,cmd,release = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
description = desc
end
if release == nil then
user:SendData(sBot, "*** No "..display1.." specified!")
return 1
end

News("By: "..user.sName.."\t At: "..timedate.."\r\n"..display1..": "..release.."\r\n"..display2..": "..description.."\r\n")
SendToAll(sBot, "New "..display3.." Added....By <"..user.sName.."> Type !read in Main-Chat to show "..display1..".")
return 1
else
user:SendData(sBot, "*** !write is only availible to [VIP] and above!")
return 1
end
end
end
end

function ReadRelease(user, data, cmd)
local release = ""
readfrom(file)
while 1 do
local line = read()
if (line == nil) then
break
else
release = release.." "..line.."\r\n"
end
end
user:SendPM(sBot, "\r\n\r\n".."       "..display3.."s posted by users: ".."\r\n\r\n"..release)
readfrom()
end

function News(what)
appendto(file)
write(what.."\n")
writeto()
end
Title:
Post by: Boostland on 16 November, 2004, 10:26:15
You could allways use the freshstuff mod.

http://board.univ-angers.fr/thread.php?threadid=2966&boardid=11

can remove the other cat's that you don't want and put in a message and or requests section.

Types = {["messages"] = "Messages", ["requests"] = "Requests"}
Title:
Post by: bastya_elvtars on 16 November, 2004, 11:37:54
http://www.plop.nl/ptokaxbots/bastya_elvtars/guestbook.lua