PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Trust_in_Trance on 29 January, 2004, 17:48:11

Title: 2 scripts needed
Post by: Trust_in_Trance on 29 January, 2004, 17:48:11
Hi perhaps you can help me.  ?(

1.) The first script i need should show the actually time and Date in Main chat. The time should be shown each Hour and when a user tipes !thetime  in main chat.

2.) The second script i need would`t be so short.
It should work like Frehstuff but i need outher sections: SVCD Vcd Xvid and DVD. And when a user connects it should show the 10 newest items on each sektion.

Perhaps you can help me.




 :D Excause me for my bad english :D
Title:
Post by: kepp on 29 January, 2004, 19:05:30
1.

Bot = "Time"
Pre = "+"

function Main()
SetTimer(600000)
StartTimer()
end


function DataArrival(curUser,data)
if strsub(data,1,1)=="<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd==Pre.."time") then
curUser:SendData(Bot, The local time is now : "..date()) return 1
end
end
end


function OnTimer()
SendToAll(Bot, "The local time is now : "..date())
end
Title: Thx for the first one but
Post by: Trust_in_Trance on 30 January, 2004, 09:45:44
it doesn`t work.

Syntax Error: `)' expected;
  last token read: `local' at line 16 in string
Title:
Post by: plop on 30 January, 2004, 17:11:46
Bot = "Time"
Pre = "+"

function Main()
SetTimer(600000)
StartTimer()
end


function DataArrival(curUser,data)
if strsub(data,1,1)=="<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd==Pre.."time") then
curUser:SendData(Bot, "The local time is now : "..date()) return 1
end
end
end


function OnTimer()
SendToAll(Bot, "The local time is now : "..date())
end
he forgot a ", now it works.

plop