IssyPutchy

TGW Watch code

Dec 14th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.04 KB | None | 0 0
  1. -- #################
  2. -- Default variables
  3. -- #################
  4. var_screen = 0
  5. zoommin = 1
  6. zoommax = 19
  7. scalemin = 40
  8. scalemax = 400
  9.  
  10. -- #################
  11. -- Talking clock
  12. -- #################
  13. var_lock=0
  14.  
  15. function timeis()
  16.  wm_sfx('thetimeis190')
  17. end
  18. function amam()
  19.  wm_sfx('amam190')
  20. end
  21. function pmpm()
  22.  wm_sfx('pmpm190')
  23. end
  24. function one()
  25.  wm_sfx('one190')
  26. end
  27. function two()
  28.  wm_sfx('two190')
  29. end
  30. function three()
  31.  wm_sfx('three190')
  32. end
  33. function four()
  34.  wm_sfx('four190')
  35. end
  36. function five()
  37.  wm_sfx('five190')
  38. end
  39. function six()
  40.  wm_sfx('six190')
  41. end
  42. function seven()
  43.  wm_sfx('seven190')
  44. end
  45. function eight()
  46.  wm_sfx('eight190')
  47. end
  48. function nine()
  49.  wm_sfx('nine190')
  50. end
  51. function ten()
  52.  wm_sfx('ten190')
  53. end
  54. function eleven()
  55.  wm_sfx('eleven190')
  56. end
  57. function twelve()
  58.  wm_sfx('twelve190')
  59. end
  60. function thirteen()
  61.  wm_sfx('thirteen190')
  62. end
  63. function fifteen()
  64.  wm_sfx('fifthteen190')
  65. end
  66. function teen()
  67.  wm_sfx('teen190')
  68. end
  69. function twenty()
  70.  wm_sfx('twenty190')
  71. end
  72. function thirty()
  73.  wm_sfx('thirty190')
  74. end
  75. function forty()
  76.  wm_sfx('forty190')
  77. end
  78. function fifty()
  79.  wm_sfx('fifty190')
  80. end
  81. function ohh()
  82.  wm_sfx('ohh190')
  83. end
  84. function oclock()
  85.  wm_sfx('oclock190')
  86. end
  87.  
  88. function hour()
  89.  if {dht} == "one" then
  90.   one()
  91.    elseif {dht} == "two" then
  92.   two()
  93.    elseif {dht} == "three" then
  94.   three()
  95.    elseif {dht} == "four" then
  96.   four()
  97.    elseif {dht} == "five" then
  98.   five()
  99.    elseif {dht} == "six" then
  100.   six()
  101.    elseif {dht} == "seven" then
  102.   seven()
  103.    elseif {dht} == "eight" then
  104.   eight()
  105.    elseif {dht} == "nine" then
  106.   nine()
  107.    elseif {dht} == "ten" then
  108.   ten()
  109.    elseif {dht} == "eleven" then
  110.   eleven()
  111.    elseif {dht} == "twelve" then
  112.   twelve()
  113.  end
  114. end
  115.  
  116. function minute()
  117.  if {dmot} ~= "" then
  118.   if {dmot} == "one" then
  119.    one()
  120.     elseif {dmot} == "two" then
  121.    two()
  122.     elseif {dmot} == "three" then
  123.    three()
  124.     elseif {dmot} == "four" then
  125.    four()
  126.     elseif {dmot} == "five" then
  127.    five()
  128.     elseif {dmot} == "six" then
  129.    six()
  130.     elseif {dmot} == "seven" then
  131.    seven()
  132.     elseif {dmot} == "eight" then
  133.    eight()
  134.     elseif {dmot} == "nine" then
  135.    nine()
  136.     elseif {dmot} == "ten" then
  137.    ten()
  138.     elseif {dmot} == "clock" then
  139.    oclock()
  140.   end
  141.  end
  142. end
  143.  
  144. function minutet()
  145.  if {dmtt} ~= "" then
  146.   if {dmtt} == "ten" then
  147.    ten()
  148.     elseif {dmtt} == "twenty" then
  149.    twenty()
  150.     elseif {dmtt} == "thirty" then
  151.    thirty()
  152.     elseif {dmtt} == "forty" then
  153.    forty()
  154.     elseif {dmtt} == "fifty" then
  155.    fifty()
  156.     elseif {dmtt} == "o'" and {dmot} ~= "clock" then
  157.    ohh()
  158.     elseif {dmtt} == "eleven" then
  159.    eleven()
  160.     elseif {dmtt} == "twelve" then
  161.    twelve()
  162.     elseif {dmtt} == "thirteen" then
  163.    thirteen()
  164.     elseif {dmtt} == "fifteen" then
  165.    fifteen()
  166.     elseif {dm} == 14 then
  167.    wm_schedule {
  168.     { action='run_function', run_function=four },
  169.     { action='sleep', sleep=0.5 },
  170.     { action='run_function', run_function=teen },
  171.    }
  172.     elseif {dm} == 16 then
  173.    wm_schedule {
  174.     { action='run_function', run_function=six },
  175.     { action='sleep', sleep=0.5 },
  176.     { action='run_function', run_function=teen },
  177.    }
  178.     elseif {dm} == 17 then
  179.    wm_schedule {
  180.     { action='run_function', run_function=seven },
  181.     { action='sleep', sleep=0.5 },
  182.     { action='run_function', run_function=teen },
  183.    }
  184.     elseif {dm} == 18 then
  185.    wm_schedule {
  186.     { action='run_function', run_function=eight },
  187.     { action='sleep', sleep=0.5 },
  188.     { action='run_function', run_function=teen },
  189.    }
  190.     elseif {dm} == 19 then
  191.    wm_schedule {
  192.     { action='run_function', run_function=nine },
  193.     { action='sleep', sleep=0.5 },
  194.     { action='run_function', run_function=teen },
  195.    }
  196.   end
  197.  end
  198. end
  199.  
  200. function amorpm()
  201.  if {da} == 'AM' then
  202.   amam() else
  203.   pmpm()
  204.  end
  205. end
  206.  
  207. var_lock=0
  208.  function lock()
  209.   if var_lock==0 then
  210.    var_lock=1
  211.     else
  212.    var_lock=0
  213.  end
  214. end
  215.  
  216. function telltime()
  217.  if var_lock==0 then
  218.   wm_schedule {
  219.    { action='run_function', run_function=lock },
  220.    { action='run_function', run_function=timeis },
  221.    { action='sleep', sleep=1 },
  222.    { action='run_function', run_function=hour },
  223.    { action='sleep', sleep=1 },
  224.    { action='run_function', run_function=minutet },
  225.    { action='sleep', sleep=1 },
  226.    { action='run_function', run_function=minute },
  227.    { action='sleep', sleep=1 },
  228.    { action='run_function', run_function=amorpm },
  229.    { action='run_function', run_function=lock },
  230.   }
  231.  end
  232. end
  233.  
  234. -- #################
  235. -- Tasker-bourne variables
  236. -- #################
  237. -- #### WMTG Support
  238. function wmtg_tags()
  239.  var_taskeron=wm_tag('{tgottasker}')
  240.  var_tasker=tonumber(var_taskeron)
  241.  var_bar=wm_tag('{twmbar}')
  242.  var_baro=tonumber(var_bar)
  243.  var_lum=wm_tag('{twmlight}')
  244.  var_lux=tonumber(var_lum)
  245.  var_tes=wm_tag('{twmmag}')
  246.  var_mag=tonumber(var_tes)
  247.  var_dis=wm_tag('{twmscreen}')
  248.  var_display=tonumber(var_dis)
  249.  var_con=wm_tag('{twmnet}')
  250.  var_net=tonumber(var_con)
  251.  var_txt=wm_tag('{twmsms}')
  252.  var_sms=tonumber(var_txt)
  253.  var_inb=wm_tag('{twmcall}')
  254.  var_call=tonumber(var_inb)
  255.  var_varvpn=wm_tag('{tovpn}')
  256.  var_vpn=tonumber(var_varvpn)
  257.  var_dim_raw=wm_tag('{twmfakedim}')
  258.  var_dim=tonumber(var_dim_raw)
  259. end
  260. -- #### Use AutoWear BPM or built-in
  261. function bpm_map()
  262.  h2bpm=wm_tag("{th2bpm}")
  263.  var_s_bpm=tonumber(h2bpm)
  264.   if var_s_bpm ~= null or var_s_bpm == 0 then
  265.    bpm=wm_tag("{th2bpm}")
  266.     else
  267.    bpm=wm_tag({shr})
  268.   end
  269.  var_s_heart=tonumber(bpm)
  270. end
  271. -- #### Ping Tasker to check support
  272. var_hasTasker = 0
  273. var_s_taskerupdate = 0
  274. function checktasker(a)
  275.  if a == 0 then
  276.   wm_action('m_task:WMCheckTasker')
  277.   taskerupdate = wm_tag("{ttimes}")
  278.   var_s_taskerupdate = tonumber(taskerupdate)
  279.  elseif a == 1 then
  280.    if ({depoch}-var_s_taskerupdate) < 30 then
  281.     var_hasTasker = 1
  282.    else
  283.     var_hasTasker = 0
  284.    end
  285.  end
  286. end
  287. -- #### Tasker variables to update in seconds
  288. function tasker_sec()
  289.  cell_1g=wm_tag('{tatsignalstrengthgsm}')
  290.  cell_2g=wm_tag('{tatsignalstrengthcdma}')
  291.  cell_3g=wm_tag('{tatsignalstrengthwcdma}')
  292.  cell_4g=wm_tag('{tatsignalstrengthlte}')
  293.  signal=wm_tag('{tcellsig}')
  294.  var_s_signal=tonumber(signal)
  295.  var_s_cell_1g=tonumber(cell_1g)
  296.  var_s_cell_2g=tonumber(cell_2g)
  297.  var_s_cell_3g=tonumber(cell_3g)
  298.  var_s_cell_4g=tonumber(cell_4g)
  299.  gtype=wm_tag("{tgtype}")
  300.  gname=wm_tag("{tgname}")
  301.  var_s_cell_type=tostring(gtype)
  302.  var_s_cell_name=tostring(gname)
  303.  locx=wm_tag("{tlocxy1}")
  304.  locy=wm_tag("{tlocxy2}")
  305.  locg=wm_tag("{tloc}")
  306.  locn=wm_tag("{tlocn}")
  307.  locspd=wm_tag("{tlocspd}")
  308.  localt=wm_tag("{tlocalt}")
  309.  locacc=wm_tag("{tlocacc}")
  310.  locnacc=wm_tag("{tlocnacc}")
  311.  var_s_locx=tonumber(locx)
  312.  var_s_locy=tonumber(locy)
  313.  var_s_locg=tonumber(locg)
  314.  var_s_locn=tonumber(locn)
  315.  var_s_locspd=tonumber(locspd)
  316.  var_s_localt=tonumber(localt)
  317.  var_s_locacc=tonumber(locacc)
  318.  var_s_locnacc=tonumber(locnacc)
  319.  memf=wm_tag("{tmemf}")
  320.  cpufreq=wm_tag("{tcpufreq}")
  321.  var_s_memf=tostring(memf)
  322.  var_s_cpufreq=tostring(cpufreq)
  323.  ssid=wm_tag("{twssid}")
  324.  wififreq=wm_tag("{twififreq}")
  325.  var_s_wifi_ssid=tostring(ssid)
  326.  var_s_wifi_band=tostring(wififreq)
  327.  netts=wm_tag("{tnetts}")
  328.  var_s_net_type=tostring(netts)
  329.  smsname=wm_tag("{tsmsrn}")
  330.  smsnum=wm_tag("{tsmsrf}")
  331.  smstime=wm_tag("{tsmsrt}")
  332.  smsdate=wm_tag("{tsmsrd}")
  333.  smsbody=wm_tag("{tsmsfixt}")
  334.  callername=wm_tag("{tcname}")
  335.  callernum=wm_tag("{tcnum}")
  336.  callertime=wm_tag("{tctime}")
  337.  callerdate=wm_tag("{tcdate}")
  338.  callname=wm_tag("{tconame}")
  339.  callnum=wm_tag("{tconum}")
  340.  calltime=wm_tag("{tcotime}")
  341.  calldate=wm_tag("{tcodate}")
  342.  incall=wm_tag("{tincall}")
  343.  var_s_sms_name=tostring(smsname)
  344.  var_s_sms_num=tostring(smsnum)
  345.  var_s_sms_date=tostring(smsdate)
  346.  var_s_sms_time=tostring(smstime)
  347.  var_s_sms_body=tostring(smsbody)
  348.  var_s_caller_name=tostring(callername)
  349.  var_s_caller_num=tostring(callernum)
  350.  var_s_caller_date=tostring(callerdate)
  351.  var_s_caller_time=tostring(callertime)
  352.  var_s_call_name=tostring(callname)
  353.  var_s_call_num=tostring(callnum)
  354.  var_s_call_date=tostring(calldate)
  355.  var_s_call_time=tostring(calltime)
  356.  var_s_incall=tonumber(incall)
  357.  trun=("{ttrun}")
  358.  var_s_trun=tostring(trun)
  359. end
  360. -- Tasker variables to update more than once a second
  361. function tasker_msec()
  362.   var_ms_baro_raw=wm_tag('{tpressure}')
  363.   var_ms_light_raw=wm_tag('{tlight}')
  364.   var_ms_mag_raw=wm_tag('{tmfield}')
  365.   var_ms_gravx_raw=wm_tag('{tgravity1}')
  366.   var_ms_gravy_raw=wm_tag('{tgravity2}')
  367.   var_ms_baro=tonumber(var_ms_baro_raw)
  368.   var_ms_light=tonumber(var_ms_light_raw)
  369.   var_ms_mag=tonumber(var_ms_mag_raw)
  370.   var_ms_gravx=tonumber(var_ms_gravx_raw)
  371.   var_ms_gravy=tonumber(var_ms_gravy_raw)
  372. end
  373. -- #### Sudden pressure detection
  374. var_s_pressure_a = var_ms_baro
  375. var_s_pressure_b = var_ms_baro
  376. var_pressure_range = 1
  377. var_pressure_warning = 0
  378. function setpressure()
  379.  var_s_pressure_a = var_ms_baro
  380.  var_s_pressure_b = var_ms_baro
  381.  var_pressure_range = 1
  382. end
  383. function checkpressure()
  384.  if var_s_pressure_a ~= var_s_pressure_b then
  385.   if var_s_pressure_a >= (var_s_pressure_b + var_pressure_range) then
  386.     var_pressure_warning = 1
  387.     wm_vibrate(100,2)
  388.   elseif var_s_pressure_a <= (var_s_pressure_b - var_pressure_range) then
  389.     var_pressure_warning = -1
  390.     wm_vibrate(50,2)
  391.   else
  392.     var_pressure_warning = 0
  393.   end
  394.  end
  395. end
  396. -- #### New SMS
  397. tasker_sec()
  398. var_sms_basetime = var_s_sms_time
  399.  
  400. var_newsms = 0
  401. function newsms()
  402.  if var_sms_basetime == var_s_sms_time then
  403.   var_newsms = 0
  404.    else
  405.   var_newsms = 1
  406.  end
  407. end
  408.  
  409. -- ################
  410. -- Map Functionality
  411. -- ################
  412. var_zoom = 17
  413. var_scale = 40
  414.  
  415. function mapzoom(z)
  416.  if z == 0 then
  417.   if var_zoom > zoommin then
  418.    var_zoom = var_zoom - 1
  419.   end
  420.  elseif z == 1 then
  421.   if var_zoom < zoommax then
  422.    var_zoom = var_zoom + 1
  423.   end
  424.  end
  425. end
  426. function mapscale(c)
  427.  if c == 0 then
  428.   if var_scale > scalemin then
  429.    var_scale = var_scale - 10
  430.   end
  431.  elseif c == 1 then
  432.   if var_scale < scalemax then
  433.    var_scale = var_scale + 10
  434.   end
  435.  end
  436. end
  437.  
  438. var_mapmode=0
  439. var_s_poi_lat=0
  440. var_s_poi_lon=0
  441. var_s_lat={alat}
  442. var_s_lon={alon}
  443. var_poi=0
  444. var_s_diff=0
  445. var_s_diff_lat=0
  446. var_s_diff_lon=0
  447. var_s_speed={}
  448. var_s_speed[1]=-1
  449. var_s_speed[2]=-1
  450. var_s_stepstook=-1
  451. var_persecond=0.36666*5
  452. var_s_seed=0
  453.  
  454. function getrange()
  455.  if tonumber({alon}) > tonumber(var_s_poi_lon) then
  456.   var_s_diff_lon={alon}-var_s_poi_lon
  457.    else
  458.   var_s_diff_lon=var_s_poi_lon-{alon}
  459.  end
  460.  if tonumber({alat}) > tonumber(var_s_poi_lat) then
  461.   var_s_diff_lat={alat}-var_s_poi_lat
  462.    else
  463.   var_s_diff_lat=var_s_poi_lat-{alat}
  464.  end
  465.  if tonumber(var_s_diff_lon)>tonumber(var_s_diff_lat) then
  466.   var_s_diff=var_s_diff_lon-var_s_diff_lat
  467.    else
  468.   var_s_diff=var_s_diff_lat-var_s_diff_lon
  469.  end
  470. end
  471.  
  472. function addpoi()
  473.  var_s_poi_lat={alat}
  474.  var_s_poi_lon={alon}
  475.  var_poi=1
  476.   wm_schedule { action='run_function', run_function=getrange }
  477. end
  478. function clearpoi()
  479.  var_s_poi_lat=0
  480.  var_s_poi_lon=0
  481.  var_poi=0
  482.   wm_schedule { action='run_function', run_function=getrange }
  483. end
  484.  
  485. if {alat} == '' then
  486.  var_s_gps_lat=0
  487.  var_s_gps_lon=0
  488.  tweens.lon=var_s_gps_lon
  489.  tweens.lat=var_s_gps_lat
  490.   else
  491.  var_s_gps_lat={alat}
  492.  var_s_gps_lon={alon}
  493.  tweens.lon=var_s_gps_lon
  494.  tweens.lat=var_s_gps_lat
  495. end
  496. var_poi_lat=0
  497. var_poi_lon=0
  498. var_map_ss=5
  499. var_mapss=0
  500. var_poiset=0
  501.  
  502. function setpoi()
  503.  var_poi_lat={alat}
  504.  var_poi_lon={alon}
  505.  var_poiset=1
  506.  addpoi()
  507. end
  508.  
  509. function resetpoi()
  510.  var_poi_lat=0
  511.  var_poi_lon=0
  512.  var_poiset=0
  513.  clearpoi()
  514. end
  515.  
  516. function mapmode()
  517.  if var_mapmode==0 then
  518.   var_mapmode=1 else
  519.   var_mapmode=0
  520.  end
  521. end
  522.  
  523. function setmapspeed()
  524.  if var_mapss==0 then
  525.   if tonumber(var_s_gps_lon) > tonumber(var_poi_lon) then
  526.    var_diff_lon=var_s_gps_lon-var_poi_lon
  527.     else
  528.    var_diff_lon=var_poi_lon-var_s_gps_lon
  529.   end
  530.   if tonumber(var_s_gps_lat) > tonumber(var_poi_lat) then
  531.    var_diff_lat=var_s_gps_lat-var_poi_lat
  532.     else
  533.    var_diff_lat=var_poi_lat-var_s_gps_lat
  534.   end
  535.  var_diff=var_diff_lat+var_diff_lon
  536.   if tonumber(var_diff)<0.5 and tonumber(var_diff)>0.1 then
  537.    var_map_ss=var_diff*100
  538.    var_mapss=1
  539.     else
  540.    var_map_ss=3
  541.    var_mapss=1
  542.   end
  543.    else
  544.   var_map_ss=3
  545.   var_mapss=0
  546.  end
  547. end
  548.  
  549. function map_gpstopoi()
  550.  if var_diff < 5.0 and var_diff ~= 0 and var_diff > 0.33 then
  551.   wm_schedule {
  552. { action='tween', tween='lon', from=var_s_gps_lon, to=var_s_poi_lon, duration=var_map_ss, easing=linear }
  553. }
  554.   wm_schedule {
  555. { action='tween', tween='lat', from=var_s_gps_lat, to=var_s_poi_lat, duration=var_map_ss, easing=linear } }
  556.   wm_schedule { action='run_function', run_function=mapmode }
  557.    else
  558.   tweens.lon=var_s_poi_lon
  559.   tweens.lat=var_s_poi_lat
  560.    wm_schedule { action='run_function', run_function=mapmode }
  561.  end
  562. end
  563.  
  564. function map_poitogps()
  565.  if var_diff < 5 and var_diff ~= 0 and var_diff > 0.33 then
  566.   wm_schedule {
  567. { action='tween', tween='lon', from=var_s_poi_lon, to=var_s_gps_lon, duration=var_map_ss, easing=linear }
  568. }
  569.   wm_schedule {
  570. { action='tween', tween='lat', from=var_s_poi_lat, to=var_s_gps_lat, duration=var_map_ss, easing=linear },
  571. { action='run_function', run_function=mapmode },
  572. }
  573.    else
  574.   tweens.lon=var_s_gps_lon
  575.   tweens.lat=var_s_gps_lat
  576.    wm_schedule { action='run_function', run_function=mapmode }
  577.  end
  578. end
  579.  
  580. function guessspeed()
  581.  if {ds}%10==5 then
  582.   var_s_stepstook=tonumber((var_s_speed[1]-var_s_speed[2])..'.'..var_s_seed)
  583.    elseif {ds}%10==0 then
  584.   var_s_stepstook=tonumber((var_s_speed[2]-var_s_speed[1])..'.'..var_s_seed)
  585.  end
  586.  if tonumber(var_s_stepstook) < 1 then
  587.   var_s_seed=0
  588.    else
  589.   var_s_seed=math.random(0,9)
  590.  end
  591. end
  592.  
  593. function do_speed()
  594.  if {abright} then
  595.   if {ds}%10==5 then
  596.    var_s_speed[1]={ssc}
  597.    var_time_a={ds}
  598.   elseif {ds}%10==0 then
  599.    var_s_speed[2]={ssc} end
  600.    var_time_a={ds}
  601. elseif not {abright} then
  602.   var_persecond=0.36666*5
  603.   if {ds}%10==5 then
  604.    var_s_speed[1]={ssc}
  605.    var_time_a={ds}
  606.   elseif {ds}%10==0 then
  607.    var_s_speed[2]={ssc} end
  608.    var_time_a={ds}
  609. end
  610. wm_schedule { action='run_function', run_function=guessspeed }
  611. end
  612.  
  613. function update_loc()
  614.  if {alat} == '' then
  615.   var_s_gps_lat=0
  616.   var_s_gps_lon=0
  617.   tweens.lon=var_s_gps_lon
  618.   tweens.lat=var_s_gps_lat
  619.    else
  620.   var_s_gps_lat={alat}
  621.   var_s_gps_lon={alon}
  622.   tweens.lon=var_s_gps_lon
  623.   tweens.lat=var_s_gps_lat
  624.  end
  625. var_poi_lat=0
  626. var_poi_lon=0
  627. var_map_ss=5
  628. var_mapss=0
  629. var_poiset=0
  630. end
  631.  
  632. function mapseconds()
  633.    if var_mapmode==0 then
  634.    var_s_gps_lat={alat}
  635.    var_s_gps_lon={alon}
  636.    tweens.lon=var_s_gps_lon
  637.    tweens.lat=var_s_gps_lat
  638.   else
  639.    var_s_lat={alat}
  640.    var_s_lon={alon}
  641.      if tonumber({alon}) > tonumber(var_s_poi_lon) then
  642.      var_s_diff_lon={alon}-var_s_poi_lon
  643.     else
  644.      var_s_diff_lon=var_s_poi_lon-{alon}
  645.      end
  646.    if tonumber({alat}) > tonumber(var_s_poi_lat) then
  647.    var_s_diff_lat={alat}-var_s_poi_lat
  648.   else
  649.    var_s_diff_lat=var_s_poi_lat-{alat}
  650.   end
  651.    if tonumber(var_s_diff_lon)>tonumber(var_s_diff_lat) then
  652.    var_s_diff=var_s_diff_lon-var_s_diff_lat
  653.   else
  654.    var_s_diff=var_s_diff_lat-var_s_diff_lon
  655.   end
  656.  end
  657. wm_schedule { action='run_function', run_function=setmapspeed }
  658. wm_schedule { action='run_function', run_function=getrange }
  659. wm_schedule { action='run_function', run_function=do_speed }
  660. -- wm_schedule { action='run_function', run_function=update_loc }
  661. end
  662.  
  663. function on_second(h,m,s)
  664.  bpm_map()
  665.  mapseconds()
  666.  tasker_sec()
  667.   if s%20 == 0 then
  668.    checktasker(0)
  669.    checktasker(1)
  670.   end
  671.  if s%5 == 0 then
  672.   var_s_pressure_a = var_ms_baro
  673.  elseif s%5 == 2 then
  674.   var_s_pressure_b = var_ms_baro
  675.  end
  676.  checkpressure()
  677. end
  678.  
  679.  
  680.  
  681. function on_millisecond(dt)
  682.  if var_screen == 8 and var_hasTasker == 1 then
  683.   tasker_msec()
  684.  end
  685. end
  686.  
  687. function on_minute()
  688.  var_s_gps_lat={alat}
  689.  var_s_gps_lon={alon}
  690.   wm_schedule { action='run_function', run_function=setmapspeed }
  691.  newsms()
  692. end
  693.  
  694. function on_display_bright()
  695.  newsms()
  696.  var_s_gps_lat={alat}
  697.  var_s_gps_lon={alon}
  698.  tweens.lon=var_s_gps_lon
  699.  tweens.lat=var_s_gps_lat
  700.   wm_schedule { action='run_function', run_function=setmapspeed }
  701. end
  702.  
  703. setmapspeed()
  704. getrange()
  705. wmtg_tags()
  706. tasker_sec()
  707. tasker_msec()
  708. checktasker(0)
  709. newsms()
Add Comment
Please, Sign In to add comment