Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This script checks differences in times
- =============================================================
- local timeDiff = function(t2,t1)
- local d1,d2,carry,diff = os.date('*t',t1),os.date('*t',t2),false,{}
- local colMax = {60,60,24,os.date('*t',os.time{year=d1.year,month=d1.month+1,day=0}).day,12}
- d2.hour = d2.hour - (d2.isdst and 1 or 0) + (d1.isdst and 1 or 0)
- for i,v in ipairs({'sec','min','hour','day','month','year'}) do
- diff[v] = d2[v] - d1[v] + (carry and -1 or 0)
- carry = diff[v] < 0
- if carry then diff[v] = diff[v] + colMax[i] end
- end
- return diff
- end
- local td=timeDiff(os.time(),os.time{year=zs.param(2),month=zs.param(3),day=zs.param(4),hour=zs.param(5),min=zs.param(6),sec=zs.param(7)})
- local name = zs.param(1)
- for i,v in pairs(td) do zs.cmd.addkey(name,i,v) end
- This is the script i call when its quest time
- =============================================================
- zs.getclass("q_trigs").enabled = 1
- send("gt @C+@B=@C+(@CQ@Buest @CT@Bime@C)@C+@B=@C+")
- image=math.random(1,23)
- --zs.mxp("<image ./Images/questpic" .. image .. ".jpg>")
- zs.cmd.play("Quest.mp3")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement