• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

tibia time little question

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
978
Solutions
17
Reaction score
373
GitHub
olrios
Twitch
jamagowy
Ill make a spell what is stronger at night.
Ofc tibia has day and night :)
I have a question, how time in tibia works?

Code:
local time = getWorldTime()     -- or maybe getTibiaTime() ??
if time >= [B][COLOR="Red"]and???[/COLOR][/B]

What is format of tibia's time?
24h? 12h?

I need a part of script:
if is after 22:00 (10pm) then do something...
and before 8:00 (8am) then do something...

sry for eng, just 10 years studing with bad teachers ;p
 
Code:
if getWorldLight()[1] == 40 then
???

I made simple script:
Code:
...
local time = getWorldTime()
local light = getWorldLight()

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Light "..light.." and time "..time..".")
...


And i got these messages:
Code:
Light 215 and time 3.       <- day
Light 215 and time 106.     <- day
Light 215 and time 189.     <- day
Light 215 and time 303.     <- day
Light 215 and time 411.     <- day
Light 215 and time 507.     <- day
Light 215 and time 607.     <- day
Light 215 and time 723.     <- day
Light 215 and time 819.     <- day
Light 215 and time 915.     <- day
Light 215 and time 1043.    <- day
Light 215 and time 1211.    <- day
Light 215 and time 1299.    <- day
Light 215 and time 1363.    <- day
Light 215 and time 1439.    <- day
[after 1440 its 0 becouse 1440min / 60 = 24h]
Light 215 and time 7.    <- day
...

I edited my spell script (not this to checking time and light)
and i add this:
Code:
...
if light ~= 255 then
...

But now i found new problem.
If from 00:00 to 24:00 is the day, where is night?
And how it works in tibia?
2x24h of day + 1x24h of night? (only suggestion)
or maybe tfs have removed day/night system
 
Back
Top