@@ -219,13 +219,19 @@ local getinterrupt = function(pos)
219
219
return interrupt
220
220
end
221
221
222
- local getdigiline_send = function (pos )
223
- local digiline_send = function (channel , msg )
224
- if digiline then
225
- digiline :receptor_send (pos , digiline .rules .default , channel , msg )
226
- end
222
+ local handle_timer = function (pos , elapsed )
223
+ local err = lc_update (pos , {type = " timer" })
224
+ if err then print (err ) end
225
+ return false
226
+ end
227
+
228
+ local gettimer = function (pos )
229
+ local timer = function (time )
230
+ if type (time ) ~= " number" then return end
231
+ local nodetimer = minetest .get_node_timer (pos )
232
+ nodetimer :start (time )
227
233
end
228
- return digiline_send
234
+ return timer
229
235
end
230
236
231
237
local create_environment = function (pos , mem , event )
@@ -239,7 +245,11 @@ local create_environment = function(pos, mem, event)
239
245
pin = merge_portstates (vports , rports ),
240
246
port = vports ,
241
247
interrupt = getinterrupt (pos ),
242
- digiline_send = getdigiline_send (pos ),
248
+ timer = gettimer (pos ),
249
+ digiline_msgs = {},
250
+ digiline_send = function (channel , msg )
251
+ table.insert (lc_digiline_msgs , {[" channel" ]= channel , [" msg" ]= msg })
252
+ end ,
243
253
mem = mem ,
244
254
tostring = tostring ,
245
255
tonumber = tonumber ,
@@ -527,6 +537,7 @@ minetest.register_node(nodename, {
527
537
if err then print (err ) end
528
538
reset_meta (pos , fields .code , err )
529
539
end ,
540
+ on_timer = handle_timer ,
530
541
sounds = default .node_sound_stone_defaults (),
531
542
mesecons = mesecons ,
532
543
digiline = digiline ,
0 commit comments