PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Cboy301 on 20 March, 2004, 07:56:43

Title: Looking for a tagwall
Post by: Cboy301 on 20 March, 2004, 07:56:43
Is there a script that is basically like the tagwall in Mean Machine? All I need is just the tagwall of sorts.
Title:
Post by: MrZ on 20 March, 2004, 09:34:37
Hia :))

try this :))

--msgboard.lua, created by amutex 12.01.2003 edited by Mephiska
--thx to nathanos for the fine pm-pasing and Dirtyfinger for tokenizing
botname = "MessageBoard"
TimeSpanInHours = 168
function tokenize (inString,token)
_WORDS = {}
local matcher = "([^?"..token.."]+)"
gsub(inString, matcher, function (w) tinsert(_WORDS,w) end)
return _WORDS
end
function GetArgs(data)
s,e,whoTo,from,cmd,arg,arg2 = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(.*)")
return arg,arg2
end
function Main()
SetTimer(TimeSpanInHours*3600000)
StartTimer()
frmHub:RegBot(botname)
end
function OnTimer()
a=remove("msgboard.dat")
SendToAll(botname, "MessageBoard Cleared...")
end
function DataArrival(user, data)
if(strsub(data, 1, 4) == "$To:") then
data=strsub(data,1,strlen(data)-1)
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (whoTo == botname) then
s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")
if (cmd=="+msg") then
arg= GetArgs(data)
local handle=openfile("msgboard.dat","a")
write(handle,date("<"..user.sName.."> wrote @ %m/%d/%Y %T "..arg.."?*******************************************?"))
user:SendPM(botname,"MessageBoard entry saved ....")
SendToAll(botname, "New entry in the messageboard!")
closefile(handle)
end
if (cmd=="+mbhelp") then
local mbhelp=""
readfrom("mbhelp.txt")
while 1 do
local line = read()
if (line == nil) then
break
else
mbhelp = mbhelp..line.."\r\n"
end
end
SendPmToNick(user.sName, botname, mbhelp)
readfrom()
end

if (cmd=="+read") then
handle2=openfile("msgboard.dat","r")
if (handle2==nil) then
else
line = read(handle2,"*a")
line=strsub(line,1,strlen(line)-1)
linearray=tokenize(line,"?")
for i=1,linearray.n do
user:SendPM(botname,linearray[i])
end
closefile(handle2)


end
end
end
end
end


G-luck buddy

Z ya
Title: Prob with that script
Post by: Cboy301 on 21 March, 2004, 08:56:58
Hi Mr.Z! I have that script but it will only allow so many characters is there a way to make it except a longer post?
Title:
Post by: MrZ on 22 March, 2004, 06:10:43
Hia

Sorry buddy, i didnt know that and i cant help u out.
I am not able to figure lua out ;(

hope someone else that is sees this and help u

Z ya