No, that ins't the right place to look..
look for date("some textstring")
if you find it, post it here
//Skrollster
QuoteOriginally posted by Skrollster
No, that ins't the right place to look..
look for date("some textstring")
if you find it, post it here
//Skrollster
-- zFuNBoTz by JenZen?.
-- Everything in this script file is ? Copyrightet by JenZen? 2003
-- This release was meant for [DK]Burger-Banden - burger-banden.kyed.com
-- Defines the name of the bot
Bot = "[Guard]"
-- The timezone for your country (How many hours is the dirrerence from GMT)
gmt = "(+1 GMT)"
textArray = {}
QWarray = {}
antall = 0
function Main()
frmHub:RegBot(Bot)
loadText()
getLine()
SetTimer(1*60000)
StartTimer()
end
function OnTimer()
getLine()
end
-- Triggers that will be send in the mainchat. This is triggers that are loaded from textfiles.
triggertext = {
["+shootafaker"]="zFuNBoTz/shootafaker.txt",
["+gun"]="zFuNBoTz/gun.txt",
["+hey"]="zFuNBoTz/hey.txt",
["+kaffe"]="zFuNBoTz/kaffe.txt",
["+weed"]="zFuNBoTz/weed.txt",
["+love"]="zFuNBoTz/love.txt",
["+morgen"]="zFuNBoTz/morgen.txt",
["+sleep"]="zFuNBoTz/sleep.txt",
["+smoke"]="zFuNBoTz/smoke.txt",
["+vel"]="zFuNBoTz/vel.txt",
["+warning"]="zFuNBoTz/warning.txt",
["+lol"]="zFuNBoTz/lol.txt",
["+delfin"]="zFuNBoTz/delfin.txt",
}
-- Triggers that will be send in main chat. This is the triggers which have the reason text here.
Trigger = {
["+morgen"]=date("Good morning, [USER], today is %A the %d/%m %Y... did you know the time is %T "..gmt.."?"),
["+nat"]="[USER] siger godnat og sov godt! Vi ses i morgen her p? Blue Lagoon",
["+bed"]="[USER] siger godnat og sov godt! Vi ses i morgen her p? Blue Lagoon",
["+sleep"]="[USER] says good night and sleep well! See you all tomorrow at Blue Lagoon",
["+hey"]="Well hello hello [USER]!",
["+away"]="The user [USER] is going away and can not answer anymore Messages",
["-away"]="[USER] is back from away mode! Nice to have you back!",
brb="Hurry up [USER] we miss you allready!",
fuck="Heyy [USER] don't say that word!",
["+bye"]="See you later [USER] ( I hope )",
lol="Loooool sq!",
haha="Det er sq sjovt! Hehehe!",
["+tillykke"]="Du ?nskes TilLykke Med Dagen af [USER]! H?ber du m? f? en god dag!",
cola="Cola?? F?j da [USER]! Hvad er det for en gang spr?jt at servere n?r man stadig kan k?be ?l!",
wb="Welcome back!"
}
-- These triggers will be sent in pm to the user. Loaded from text files
TriggerPrivate = {
["+newbie"]="zFuNBoTz/newbie.txt",
["+nybe"]="zFuNBoTz/nybe.txt",
["+divx"]="zFuNBoTz/divx.txt",
["+adr"]="zFuNBoTz/adr.txt",
["+country"]="zFuNBoTz/country.txt",
["+gamekey"]="zFuNBoTz/gamekey.txt",
["+smiley"]="zFuNBoTz/forkortsmiley.txt",
["+moresmiley"]="zFuNBoTz/moresmiley.txt",
["+routerhelp"]="zFuNBoTz/routerhelp.txt",
["+kopiregler"]="zFuNBoTz/reglerkopiering.txt",
}
function DataArrival(curUser, sData)
if( strsub(sData, 1, 1) == "<" ) then
-- get the msg only using regular expression
s,e,msg = strfind(sData, "%b<> ([ -z]*)")
if (msg == "+bed") then
local text1 = ""
readfrom("zFuNBoTz/bed1.txt")
while 1 do
local line = read()
if (line == nil) then
break
else
text1 = text1..line.."\r\n"
end
end
readfrom()
local text2 = ""
readfrom("zFuNBoTz/bed2.txt")
while 1 do
local line = read()
if (line == nil) then
break
else
text2 = text2..line.."\r\n"
end
end
readfrom()
hey = random(1,2)
if hey == 1 then
SendToAll("[zFuNBoTz] - from "..curUser.sName,text1)
elseif hey == 2 then
SendToAll("[zFuNBoTz] - from "..curUser.sName,text2)
end
end
-- look in the table
for key, value in triggertext do
if( strfind( strlower(msg), key) ) then
answer, x = gsub(value, "%b[]", curUser.sName)
local text = ""
readfrom(answer)
while 1 do
local line = read()
if (line == nil) then
break
else
text = text..line.."\r\n"
end
end
SendToAll("[zFuNBoTz] - from "..curUser.sName, text)
end
readfrom()
end
for key, value in Trigger do
if( strfind( strlower(msg), key) ) then
answer, x = gsub(value, "%b[]", curUser.sName)
SendToAll( Bot, answer ) -- send bot's answer
end
end
end
if( strsub(sData, 1, 1) == "<" ) or ( strsub(sData, 1, 4) == "$To:") then
s,e,msg = strfind(sData, "%b<> ([ -z]*)")
for key, value in TriggerPrivate do
if( strfind( strlower(msg), key) ) then
answer, x = gsub(value, "%b[]", curUser.sName)
local text = ""
readfrom(answer)
while 1 do
local line = read()
if (line == nil) then
break
else
text = text..line.."\r\n"
end
end
SendPmToNick(curUser.sName, Bot, text)
end
readfrom()
end
end
data = strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
if (cmd=="+joke" or cmd=="!joke" or cmd=="+joke" or cmd=="-joke") then
curUser:SendPM("[zFuNBoTz] - Joke from "..curUser.sName, txt2)
return 1;
end
if (cmd=="!fun" or cmd=="!fun" or cmd=="+fun" or cmd=="-fun" or cmd=="+funbot" or cmd=="-funbot" or cmd=="!funbot") then
SendPmToNick(curUser.sName, Bot, "\r\n\r\n Current Fun commands on this hub:".."\r\n +divx - Shows the DivX faq".."\r\n +shootafaker - '44 Magnum Meets A Faker".."\r\n +gun - BLAOW! Another Faker Bites The Dust!".."\r\n +hey - Say Hello In Main Chat".."\r\n +kaffe - Kaffetid!".."\r\n +weed - Cheech & Chong Party Time!".."\r\n +love - Groovy Kind Of Love".."\r\n +morgen - Godmorgen I Hubben".."\r\n +newbie - Direct Connect FAQ In English".."\r\n +nybe - Direct Connect FAQ P? Dansk".."\r\n +bed - Goin' To Bed".."\r\n +smoke - Smokin'".."\r\n +vel - Velkommen".."\r\n +warning - Official Warning".."\r\n +lol - Laugh Out Loud".."\r\n +adr - Show Network Info".."\r\n +away - Away Besked".."\r\n -away - Tilbage p? hubben".."\r\n +bye - Ses Senere".."\r\n +tillykke - Tillykke Med Dagen".."\r\n +nat - God Nat p? hubben".."\r\n +country - Shows a list of all countrycodes".."\r\n +gamekey - Shows keys and serials for the most popular games".."\r\n +smiley - Shows some smileys and shortenings".."\r\n +moresmiley - More smileys".."\r\n +kopiregler - Viser de g?ldende regler for kopiering af digitale medier i DK".."\r\n +routerhelp - Shows how u use active mode when you have a router or firewall".."\r\n")
return 1;
end
end
function tokenize (inString,token)
_WORDS = {}
local matcher = "([^"..token.."]+)"
gsub(inString, matcher, function (w) tinsert(_WORDS,w) end)
return _WORDS
end
function loadText()
handle = openfile("zFuNBoTz/joke.txt", "r")
if (handle) then
local line = read(handle)
while line do
if ((line ~= "") and (strfind(line, "*", 1, plain))) then
tinsert(textArray, line)
antall = antall + 1
end
line = read(handle)
end
closefile(handle)
end
end
function getLine()
lngWord = random(1, antall)
QWarray = tokenize(textArray[lngWord], "*")
txt1 = QWarray[1]
txt2 = QWarray[2]
end
crash, that isn't too good..
try to put the line in Main()
i'v only tried it with lua.exe and it works..
//skrollster
ok, so ptokax doesn't accept that we just set the time local to be our own, we have to set it all.... thanks..