魔兽地图编辑器吧 关注:65,637贴子:3,844,960

如何用t获得 真实时间 如现在2011 04 10

只看楼主收藏回复

rt


IP属地:广东1楼2011-04-10 14:26回复
    GetLocalTimer()


    2楼2011-04-10 14:27
    回复
      2025-12-24 05:05:13
      广告
      不感兴趣
      开通SVIP免广告
      需要japi


      IP属地:江苏3楼2011-04-10 14:27
      回复
        we什么时候这么高科技了
        =================
        好吧确实可以...
        用bug导出bat,再把现在时间导出为文本,再sync数据


        IP属地:天津4楼2011-04-10 14:27
        回复
          点操作啊
          能否做一个例子来看


          IP属地:广东5楼2011-04-10 15:55
          回复
            4l 求指点


            IP属地:广东6楼2011-04-10 16:24
            回复
              回复:4楼
              求指点


              IP属地:广东7楼2011-04-10 16:24
              回复
                其实我只需要开始时候读取一次


                IP属地:广东8楼2011-04-10 16:29
                回复
                  2025-12-24 04:59:13
                  广告
                  不感兴趣
                  开通SVIP免广告
                  4楼求指点


                  9楼2011-04-10 17:15
                  回复
                    iPLstate=0iLastTick = 0iTickCount = 0iPLtime=0sTimeOut=''iFontW=7iFontH=14
                    function myd3dsettext(nShowstate,strText,nAlpha) war3w = getwar3window() win3wl,win3wr,win3wt,win3wb = getclientrect(war3w) if((win3wr-win3wl)<790) then iFontW=5 elseif((win3wr-win3wl)>=790 and (win3wr-win3wl)<1010) then iFontW=6 else iFontW=7 end if nShowPosition==1 then x=(win3wr-win3wl)*0.553 y=(win3wb-win3wt)*0.045 end if nShowPosition==2 then x=(win3wr-win3wl)*0.02 y=(win3wb-win3wt)*0.7345 end if nShowPosition==3 then x=(win3wr-win3wl)*0.768 y=(win3wb-win3wt)*0.7525 end if nShowstate==0 then   idSet, ridSet = d3dsettext(idSet, ridSet,strText, 1000, x, y, "宋体", fontColor, nAlpha, iFontW, 0, 500, 0, 0, 0,0,0) else   idSet, ridSet = d3dsettext(idSet, ridSet,strText, 0, x, y, "宋体", fontColor, nAlpha, iFontW, 0, 500, 0, 0, 0,0,0) endend
                    function runshowfunc() if 1==isplaying() then if 0==iPLstate then iPLstate=1 iLastTick = gettickcount() end iTickCount=gettickcount() iPLtime=tonumber(string.format('%d',(iTickCount-iLastTick)/1000)) if iPLtime>3600 then sTimeH=tonumber(string.format('%d',iPLtime/3600)) sTimeM=tonumber(string.format('%d',iPLtime/60))-sTimeH*60 sTimeS=iPLtime-(sTimeH*3600+sTimeM*60) sTimeOut=sTimeH..':'..sTimeM..':'..sTimeS elseif iPLtime>60 then sTimeM=tonumber(string.format('%d',iPLtime/60)) sTimeS=iPLtime-sTimeM*60 sTimeOut='00:'..sTimeM..':'..sTimeS elseif iPLtime>0 then sTimeOut='00:'..'00:'..iPLtime end if(sTimeOut~='') then   sTimeOut = 'Used['..sTimeOut..'] Now['..os.date("%X",os.time{year=1970, month=1, day=1, hour=0})..']' end myd3dsettext(0,sTimeOut,255) else iPLstate=0 sTimeOut=' ' myd3dsettext(1,sTimeOut,255) endend
                    settimer(1000, 'runshowfunc')


                    IP属地:重庆10楼2011-04-10 17:24
                    回复
                      iPLstate=0
                      iLastTick = 0
                      iTickCount = 0
                      iPLtime=0sTimeOut=''
                      iFontW=7iFontH=14
                      function myd3dsettext(nShowstate,strText,nAlpha)
                      war3w = getwar3window()
                      win3wl,win3wr,win3wt,win3wb = getclientrect(war3w)
                      if((win3wr-win3wl)<790) then
                      iFontW=5
                      elseif((win3wr-win3wl)>=790 and (win3wr-win3wl)<1010) then
                      iFontW=6
                      else
                      iFontW=7
                      end
                      if nShowPosition==1 then
                      x=(win3wr-win3wl)*0.553
                      y=(win3wb-win3wt)*0.045
                      end
                      if nShowPosition==2 then
                      x=(win3wr-win3wl)*0.02
                      y=(win3wb-win3wt)*0.7345
                      end
                      if nShowPosition==3 then
                      x=(win3wr-win3wl)*0.768
                      y=(win3wb-win3wt)*0.7525
                      end
                      if nShowstate==0 then
                         idSet, ridSet = d3dsettext(idSet, ridSet,strText, 1000, x, y, "宋体", fontColor, nAlpha, iFontW, 0, 500, 0, 0, 0,0,0)
                      else
                         idSet, ridSet = d3dsettext(idSet, ridSet,strText, 0, x, y, "宋体", fontColor, nAlpha, iFontW, 0, 500, 0, 0, 0,0,0)
                      end
                      end
                      function runshowfunc()
                      if 1==isplaying() then
                      if 0==iPLstate then
                      iPLstate=1
                      iLastTick = gettickcount()
                      end
                      iTickCount=gettickcount()
                      iPLtime=tonumber(string.format('%d',(iTickCount-iLastTick)/1000))
                      if iPLtime>3600 then
                      sTimeH=tonumber(string.format('%d',iPLtime/3600))
                      sTimeM=tonumber(string.format('%d',iPLtime/60))-sTimeH*60
                      sTimeS=iPLtime-(sTimeH*3600+sTimeM*60)
                      sTimeOut=sTimeH..':'..sTimeM..':'..sTimeS
                      elseif iPLtime>60 then
                      sTimeM=tonumber(string.format('%d',iPLtime/60))
                      sTimeS=iPLtime-sTimeM*60
                      sTimeOut='00:'..sTimeM..':'..sTimeS
                      elseif iPLtime>0 then
                      sTimeOut='00:'..'00:'..iPLtime
                      end
                      if(sTimeOut~='') then
                         sTimeOut = 'Used['..sTimeOut..'] Now['..os.date("%X",os.time{year=1970, month=1, day=1, hour=0})..']'
                      end
                      myd3dsettext(0,sTimeOut,255)
                      else
                      iPLstate=0
                      sTimeOut=' '
                      myd3dsettext(1,sTimeOut,255)
                         end
                      end
                      settimer(1000, 'runshowfunc')
                      --------------------------------------------------
                      从某个脚本里翻出来的...


                      IP属地:重庆11楼2011-04-10 17:39
                      回复
                        膜拜


                        12楼2011-04-10 17:40
                        回复
                          回复:11楼
                          能否标明出处啊


                          IP属地:广东13楼2011-04-10 18:25
                          回复
                            很简单啊,字符串直接读取现实时间


                            IP属地:江西14楼2011-04-10 18:26
                            回复
                              2025-12-24 04:53:13
                              广告
                              不感兴趣
                              开通SVIP免广告


                              IP属地:加拿大15楼2011-04-10 18:27
                              回复