PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: OneHero on 16 June, 2004, 11:31:57

Title: wazzup
Post by: OneHero on 16 June, 2004, 11:31:57
where can i find this script?

when u writes !wassup, u will see the last 50 lines
Title:
Post by: MrZ on 16 June, 2004, 16:55:11
Hia :))

I think plop has it in -Artificial Insanety-  (http://board.univ-angers.fr/thread.php?threadid=550&boardid=15&sid=4ecbf33d7e9831b0200d75309708d1ad)  is what ur looking for? Otherwise u better ask for a stand alone.

Z ya
Title:
Post by: OneHero on 17 June, 2004, 07:53:35
QuoteOriginally posted by MrZ
Hia :))

I think plop has it in -Artificial Insanety-  (http://board.univ-angers.fr/thread.php?threadid=550&boardid=15&sid=4ecbf33d7e9831b0200d75309708d1ad)  is what ur looking for? Otherwise u better ask for a stand alone.

Z ya

then i'll ask for a stand alone script...
Title:
Post by: tezlo on 17 June, 2004, 12:04:20
it's been done here (http://board.univ-angers.fr/thread.php?threadid=1070&boardid=11&sid=1ceef77cb40945698ca22879b15f9137) already
made it co act on a command..
maxhistory = 50

function Main()
chathistory = dofile("chathistory.dat") or {}
end

function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, cmd = strfind(data, "^%b<> ([%!%+%?]%a+)")
if s then
if cmd == "!wassup" then
local n = getn(chathistory)
local str = ">> last "..n.." chat messages.."
for i = 1, n do str = str.."\n"..chathistory[i] end
user:SendData(str)
return 1
end
else
tinsert(chathistory, date("[%H:%M] ")..strsub(data, 1, -2))
if getn(chathistory) > maxhistory then tremove(chathistory, 1) end
savehistory()
end
end
end

function savehistory()
local f = openfile("chathistory.dat", "w+")
assert(f, "chathistory.dat")
write(f, "return {\n")
for i = 1, getn(chathistory) do
write(f, "\t"..format("%q", chathistory[i])..",\n")
end write(f, "}") closefile(f)
end
Title:
Post by: OneHero on 18 June, 2004, 09:20:02
thx a lot :D

but if i dont want to show the comand line !wassup in the main chat, what do i do then?
Title:
Post by: plop on 18 June, 2004, 13:13:47
aaa leave it, tez edited his post allready. lol
re-copy the script OneHero.

plop