[Mod] Digilines [digilines]

User avatar
rubenwardy
Moderator
Posts: 6289
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Digilines [minetest-mod-digilines]

by rubenwardy » Post

You can't make a terminal using minetest without the ability to send key presses, terminals aren't just typing commands.

User avatar
benrob0329
Member
Posts: 1337
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: [Mod] Digilines [minetest-mod-digilines]

by benrob0329 » Post

you could use the keyboard from the digilines-stuff modpack, and only send one letter.
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA

im-poke
Member
Posts: 1084
Joined: Sat Apr 18, 2015 15:50
IRC: poke
In-game: poke
Location: Somewhere in the Universe, on a weird planet called Earth/

Re: [Mod] Digilines [minetest-mod-digilines]

by im-poke » Post

Noho. I mean: You must rightclick on the tv to see what happens in the studio.
ARE YOU A NYAN CAT?????
--ABJ

im-poke
Member
Posts: 1084
Joined: Sat Apr 18, 2015 15:50
IRC: poke
In-game: poke
Location: Somewhere in the Universe, on a weird planet called Earth/

Re: [Mod] Digilines [minetest-mod-digilines]

by im-poke » Post

And the camera can have eyes by letting the minetest engine think that a player is stuck in there, and send the view of the cam to the formspec/gui of the TV's that are connected. And well, if not possible, i want radio. (explained later)
ARE YOU A NYAN CAT?????
--ABJ

im-poke
Member
Posts: 1084
Joined: Sat Apr 18, 2015 15:50
IRC: poke
In-game: poke
Location: Somewhere in the Universe, on a weird planet called Earth/

Re: [Mod] Digilines [minetest-mod-digilines]

by im-poke » Post

And: What is wrong with a GUI / formspec?
ARE YOU A NYAN CAT?????
--ABJ

sofar
Developer
Posts: 2132
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Digilines [minetest-mod-digilines]

by sofar » Post

I've proposed a change to make digilines a mod instead of a modpack. Testers needed, would appreciate someone testing it.

https://github.com/minetest-mods/digilines/pull/32

Byakuren
Member
Posts: 816
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Digilines [minetest-mod-digilines]

by Byakuren » Post

Is the name of internal.lua meant to imply that the functions defined within should not be used by modders?

EDIT: Nevermind. Can I find the API for creating your own digiline hardware documented anywhere? Specifically I am looking for node_def.digiline.receptor, the rules parameter of receptor_send, and the msg parameter (what values are allowed). I would also like to know whether sent messages are automatically delayed until the next tick (to prevent infinite loops) or if that must be done manually by receiving or sending nodes.
Every time a mod API is left undocumented, a koala dies.

User avatar
ulla
Member
Posts: 109
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

Re: [Mod] Digilines [minetest-mod-digilines]

by ulla » Post

Hello, I need a little help, I created a LCD bigger than that of DIGILINE mod, twice as high, I used a mesh, I can write about it, the problem is that even having set the right collision_box and selection_box, I can not write in the upper part. I tried to increase the height of the text, but instead of being displayed in the upper part of the mesh, the sentence is cut, you can help me understand how to do? thanks in advance
(PS: I simply modified lcd.lua original)Image
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

User avatar
rubenwardy
Moderator
Posts: 6289
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Digilines [minetest-mod-digilines]

by rubenwardy » Post

Please may you rename the topic to:

[Mod] Digilines [digilines]

minetest-mod-digilines is not the correct name

Brackston
New member
Posts: 3
Joined: Wed Apr 12, 2017 18:09
GitHub: Brackstons
IRC: Brackston
In-game: Brackston

Re: [Mod] Digilines [minetest-mod-digilines]

by Brackston » Post

Tic Tac Toe "fix" post moved to
viewtopic.php?f=9&t=5113&p=283827

User avatar
TalkLounge
Member
Posts: 314
Joined: Sun Mar 26, 2017 12:42
GitHub: TalkLounge
In-game: TalkLounge
Location: Germany

Re: [Mod] Digilines [minetest-mod-digilines]

by TalkLounge » Post

Some errors crashes my server(0.4.15) the hole time:

Code: Select all

2017-12-27 15:05:31: WARNING[Server]: ServerEnv: Trying to store id = 2770 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:33: WARNING[Server]: ServerEnv: Trying to store id = 2775 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:33: WARNING[Server]: ServerEnv: Trying to store id = 2774 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:34: ERROR[Server]: Server::ProcessData(): Canceling: No player for peer_id=3 disconnecting peer!
2017-12-27 15:05:35: WARNING[Server]: ServerEnv: Trying to store id = 2779 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:35: WARNING[Server]: ServerEnv: Trying to store id = 2778 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:37: WARNING[Server]: ServerEnv: Trying to store id = 2783 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:37: WARNING[Server]: ServerEnv: Trying to store id = 2782 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2787 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2786 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2785 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2784 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2791 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2791 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2791 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2790 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2790 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2790 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2789 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2789 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2789 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2788 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2788 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2788 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:43: WARNING[Server]: ServerEnv: Trying to store id = 2793 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:43: WARNING[Server]: ServerEnv: Trying to store id = 2792 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
If I teleport to this position theres only stone and dirt.
Subgames Server: Sky World Subgames German Survival Server: Wildes Land 2 E-Mail: talklounge@yahoo.de

User avatar
joe7575
Member
Posts: 492
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Digilines [digilines]

by joe7575 » Post

Blocks in this case are real blocks (16x16x16 nodes).
You have to teleport to 10320,0,-9760.
I had similar errors on my server. In my case it was a problem with Pedestals. After replacing them, it was ok.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

Ismoor
New member
Posts: 3
Joined: Sat Nov 18, 2017 20:42

Re: [Mod] Digilines [digilines]

by Ismoor » Post

I connected a luacontroller with digilines to a LCD, a RTC and a lightsensor and used the following to test the LCD:

Code: Select all

digiline_send("LCD", "Hello, World!")
But I get the following error in the editor:

Code: Select all

(load):1: attempt to call global 'digiline_send' (a nil value)
What's wrong?

*EDIT:*
I pulled mesecons from the github master branch, which seems to have problems with my configuration.
With the 2017.03.05 Release package all is well, so problem solved.

User avatar
sparky
Member
Posts: 142
Joined: Sun Oct 05, 2014 00:54
GitHub: Elkien3
IRC: ircSparky
In-game: sparky
Location: USA
Contact:

Re: [Mod] Digilines [digilines]

by sparky » Post

Would it be possible to make it so you can digiline_send on a specific pin?
(I mean, without redoing a lot of code)
This would be useful if you wanted to make multiple computers in different houses connected, but only want the shared digiline to send messages from one computer to the other, not things that only matter to the individual computer. such as setting an LCD screen's text or sending "GET" to an RTC.

User avatar
prof
New member
Posts: 9
Joined: Sun Dec 02, 2018 02:01
GitHub: prof
IRC: prof
In-game: prof

Re: [Mod] Digilines [digilines]

by prof » Post

One thing I'd like to see is turning on "conductive" property for ordinary blocks. In other words one could build circuits into the walls of any ordinary object without it coming annoyingly visible (or requiring extra wire space.

One might suggest a Recipe of any standard block mixed with a conductive wire resulting in a conductive block which doesn't look any different (than perhaps some identifying green dot added to each face).

without requiring extra space or without having to mess up the looks of ordinary objects that one could build thin and mostly hidden circuits into any project. E.G. I've been building aircraft and if the exterior walls also conducted then I could easily fit lighting circuits into a small diameter hull. There are many other examples where using a block which didn't look different from the rest of the walls (except my green dot) would aide in the clean look of the object. Plus make it easier to contact the receiving block (such as a light block).

--prof.

thetoolman
New member
Posts: 6
Joined: Sat Nov 24, 2018 18:45
GitHub: tealethetoolman
IRC: thetoolman

Re: [Mod] Digilines [digilines]

by thetoolman » Post

** EDIT: I found that someone has already fixed this and that there is a pull request waiting. can someone please handle the pull request? thanks**

hey all!

I've found a bit of an issue with inventory.lua and the way it reports items in chests to digilines.

i came up with 16 tests and got these results and I'm planning on working the code to fix this. To do these tests, I hooked up a digiline chest to a digiline to a lua controller that justs print(event.msg). theres actually 2 chests, a filter injector, and a pipe.

also, substituting default:dirt in my response strings for ITEM

Tests and results:
1. Insert single item in empty chest
put ITEM
put ITEM 1
uput ITEM
2. insert stack of items in empty chest
put ITEM 99
put ITEM 1
uput ITEM 99
3. insert single item into non-empty chest
put ITEM
put ITEM
put ITEM 1
uput ITEM
4. insert stack of items in non-empty chest
put ITEM 99
put ITEM 99
put ITEM 99
put ITEM 1
uput ITEM 99
5. take stack of items from chest so that it is not empty
utake item 99
6. take stack of items from chest so that it is empty
utake ITEM 99
empty
utake ITEM
7. take single item so that chest is not empty.
8. take single item so that chest is empty.
empty
utake ITEM
9. use single item injector to leave empty chest
10. use single item injector to leave chest not empty
utake item
11. use stack injector to leave empty chest
empty
utake item 99
12. use stack injector to leave chest not empty
utake item 99
13. use stack injector to put item into an empty chest
put item 99
14. use stack injector to put item into a non empty chest
15. use single item injector to put item into empty chest
put item
16. use single injector to put item into a non-empty chest
put item 99


so it looks like i need to do a few tests still (14,9,7) but we can all clearly see here that there is a problem. I first noticed this a few months back when i was trying to make a mass storage device that kept track of the quantities in the chests, but my counts were always off. here we can see why.

Also, I found that in the mesecons_luacontroller/init.lua, you can add the string function split to the environment for the lua controller. this makes it so that you can grab these values and work with them. example

uput default:dirt 99
action=event.msg.split(" ")[1]
item=event.msg.split(" ")[2]
quantity=event.msg.split(" ")[3]

so question for these changes i will try to make to this inventory.lua digilines reporting functionality, is anyone actually using this broken of an item and if so, how are you using it? workarounds like a digiline detector tube (which will multicount on a full chest btw)?

User avatar
Miniontoby
Member
Posts: 438
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Digilines [digilines]

by Miniontoby » Post

Can you check the status of the led marque?
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

neoh4x0r
Member
Posts: 82
Joined: Wed Aug 29, 2018 20:16
GitHub: neoh4x0r

Re: [Mod] Digilines [digilines]

by neoh4x0r » Post

EDIT: Opended issue in github: https://github.com/minetest-mods/mesecons/issues/467
Ismoor wrote:I connected a luacontroller with digilines to a LCD, a RTC and a lightsensor and used the following to test the LCD:

Code: Select all

digiline_send("LCD", "Hello, World!")
But I get the following error in the editor:

Code: Select all

(load):1: attempt to call global 'digiline_send' (a nil value)
What's wrong?

*EDIT:*
I pulled mesecons from the github master branch, which seems to have problems with my configuration.
With the 2017.03.05 Release package all is well, so problem solved.


I had the same problem a couple of days ago (digilines is installed)...
-------------------
In mesecons/mesecons_luacontroller/init.lua (https://github.com/minetest-mods/meseco ... t.lua#L396)

Code: Select all

 local function get_digiline_send(pos, itbl, send_warning)
  if not minetest.global_exists("digilines") then return end
  [...]
-------------------
And in digilines/init.lua (https://github.com/minetest-mods/digili ... nit.lua#L2)

Code: Select all

 digilines = {}
 [...]
-------------------


The ultimate fix to get it working again (which assumes that digilines is installed and enabled)
was to comment-out the check to minetest.global_exists("digilines") in the luacontroller.

The reason why the 2017.03.05 release works (and is broken in commit [Limit and optimize digiline_send (#379)] https://github.com/minetest-mods/meseco ... e79745090e)
is because the 2017 version does not use global_exists and instead uses

Code: Select all

if not digiline then return end
But that has issues where if digilines wasn't installed the luacontroller would throw errors about 'digiline' being a nil value -- that is why
the change was made in 2b096f0, global_exists will return a boolean (false if nil, true if exists).


PS: I should probably open a new issue for mesecons_luacontroller in the github project: https://github.com/minetest-mods/mesecons/issues
And report this problem.

User avatar
DS-minetest
Member
Posts: 1144
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: DS-minetest
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Digilines [digilines]

by DS-minetest » Post

Miniontoby wrote:Can you check the status of the led marque?
Ask here: viewtopic.php?t=20651
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

User avatar
Miniontoby
Member
Posts: 438
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Digilines [digilines]

by Miniontoby » Post

I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work

If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing

Here is the code

Code: Select all

-- time to screen script
if event.channel == "t" then
if event.msg == "1" then
digiline_send("1","allon")
elseif event.msg == "2" then
digiline_send("2","allon")
elseif event.msg == "3" then
digiline_send("3","allon")
elseif event.msg == "4" then
digiline_send("4","allon")
elseif event.msg == "5" then
digiline_send("5","allon")
elseif event.msg == "6" then
digiline_send("6","allon")
elseif event.msg == "7" then
digiline_send("7","allon")
elseif event.msg == "8" then
digiline_send("8","allon")
elseif event.msg == "9" then
digiline_send("9","allon")
elseif event.msg == "10" then
digiline_send("10","allon")
elseif event.msg == "11" then
digiline_send("11","allon")
elseif event.msg == "12" then
digiline_send("12","allon")
elseif event.msg == "13" then
digiline_send("1","allon")
elseif event.msg == "14" then
digiline_send("2","allon")
elseif event.msg == "15" then
digiline_send("3","allon")
elseif event.msg == "16" then
digiline_send("4","allon")
elseif event.msg == "17" then
digiline_send("5","allon")
elseif event.msg == "18" then
digiline_send("6","allon")
elseif event.msg == "19" then
digiline_send("7","allon")
elseif event.msg == "20" then
digiline_send("8","allon")
elseif event.msg == "21" then
digiline_send("9","allon")
elseif event.msg == "22" then
digiline_send("10","allon")
elseif event.msg == "23" then
digiline_send("11","allon")
elseif event.msg == "24" then
digiline_send("12","allon")
end
end


-- Clock (RTC) output to hour and minute script
if event.channel == "clock" then 
time = event.msg * 24 
hour = math.floor(time) 
time = (time % 1) * 60 
minute = math.floor(time) 
digiline_send("hour", hour) 
digiline_send("t", hour) 
digiline_send("minute", minute) 
end
Please help me
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

neoh4x0r
Member
Posts: 82
Joined: Wed Aug 29, 2018 20:16
GitHub: neoh4x0r

Re: [Mod] Digilines [digilines]

by neoh4x0r » Post

Miniontoby wrote:I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work

If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing

Here is the code

Code: Select all

-- time to screen script
if event.channel == "t" then
if event.msg == "1" then
digiline_send("1","allon")
elseif event.msg == "2" then
digiline_send("2","allon")
elseif event.msg == "3" then
digiline_send("3","allon")
elseif event.msg == "4" then
digiline_send("4","allon")
elseif event.msg == "5" then
digiline_send("5","allon")
elseif event.msg == "6" then
digiline_send("6","allon")
elseif event.msg == "7" then
digiline_send("7","allon")
elseif event.msg == "8" then
digiline_send("8","allon")
elseif event.msg == "9" then
digiline_send("9","allon")
elseif event.msg == "10" then
digiline_send("10","allon")
elseif event.msg == "11" then
digiline_send("11","allon")
elseif event.msg == "12" then
digiline_send("12","allon")
elseif event.msg == "13" then
digiline_send("1","allon")
elseif event.msg == "14" then
digiline_send("2","allon")
elseif event.msg == "15" then
digiline_send("3","allon")
elseif event.msg == "16" then
digiline_send("4","allon")
elseif event.msg == "17" then
digiline_send("5","allon")
elseif event.msg == "18" then
digiline_send("6","allon")
elseif event.msg == "19" then
digiline_send("7","allon")
elseif event.msg == "20" then
digiline_send("8","allon")
elseif event.msg == "21" then
digiline_send("9","allon")
elseif event.msg == "22" then
digiline_send("10","allon")
elseif event.msg == "23" then
digiline_send("11","allon")
elseif event.msg == "24" then
digiline_send("12","allon")
end
end


-- Clock (RTC) output to hour and minute script
if event.channel == "clock" then 
time = event.msg * 24 
hour = math.floor(time) 
time = (time % 1) * 60 
minute = math.floor(time) 
digiline_send("hour", hour) 
digiline_send("t", hour) 
digiline_send("minute", minute) 
end
Please help me
You can probably reduce that code into a simplified form as follows (which should also help with the controller burning:

NOTE: every call to digiline_send results in the script being re-executed and can cause either an infinite loop or cause the controller's script to be executed too many times -- both of which result in the controller burning up to protect server performance and resources .

The only solution is to make sure that digline_send isn't being called, too, often.
For instance you don't need to send and event on channel "t" in response to an incoming event on the "clock" channel -- just use the clock channel to set everything up (this is done in the below example).


PS: you can read-up on the luacontroller's documentation here: http://mesecons.net/luacontroller/

Make sure to read these parts:
  • Chapter VI: Memory
  • Chapter VII: Overheating

Code: Select all

-- time to screen script

local HOUR_CHANNEL = "hour"
local MINUTE_CHANNEL = "minute"

local ALLON = "allon"

local function init_mem()
 if mem.hour == nil then mem.hour=0 end
 if mem.minute == nil then mem.minute=0 end
end

local function send_hour()
 -- the channel for this is the hour "1", "2", etc
 digiline_send(tostring(mem.hour),ALLON)
 -- this just sends the hour
 digiline_send(HOUR_CHANNEL,tostring(mem.hour)
end

local function send_minute()
 digiline_send(MINUTE_CHANNEL,tostring(mem.minute))
end

-- initialize memory varibles (they will be created and remain until controller is burned or dug)
init_mem()


if event.type == "digiline"
 if event.channel ~= "clock" then
  return -- no need to continue executing this script, on the wrong channel
 end
 if event.channel == "clock" then
-- Clock (RTC) output to hour and minute script

   local old_hour = mem.hour
   local old_minute = mem.minute

   local new_time = tonumber(event.msg) * 24
   -- hour is 0 to 11 (1 to 12)
   mem.hour = (math.floor(new_time)  % 12) + 1
   -- minute is the remainder * 60
   mem.minute = math.floor((new_time % 1) * 60 ) 

 -- only need to call digiline_send once to set the value, as it will remain on the end-point device until it is changed again.

   if old_hour ~= hour then
    send_hour() -- send only if hour has changed
   end

   if old_minute ~= minute then
    send_minute() -- send only if minute has changed
   end
 
 end
end

User avatar
ulla
Member
Posts: 109
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

Re: [Mod] Digilines [digilines]

by ulla » Post

Code: Select all

-- time to screen script

local HOUR_CHANNEL = "hour"
local MINUTE_CHANNEL = "minute"

local ALLON = "allon"

local function init_mem()
 if mem.hour == nil then mem.hour=0 end
 if mem.minute == nil then mem.minute=0 end
end

local function send_hour()
 -- the channel for this is the hour "1", "2", etc
 digiline_send(tostring(mem.hour),ALLON)
 -- this just sends the hour
 digiline_send(HOUR_CHANNEL,tostring(mem.hour))
end

local function send_minute()
 digiline_send(MINUTE_CHANNEL,tostring(mem.minute))
end

-- initialize memory varibles (they will be created and remain until controller is burned or dug)
init_mem()


if event.type == "digiline" then
 if event.channel ~= "clock" then
  return -- no need to continue executing this script, on the wrong channel
 end
 if event.channel == "clock" then
-- Clock (RTC) output to hour and minute script

   local old_hour = mem.hour
   local old_minute = mem.minute

   local new_time = tonumber(event.msg) * 24
   -- hour is 0 to 11 (1 to 12)
   mem.hour = (math.floor(new_time)  % 12) + 1
   -- minute is the remainder * 60
   mem.minute = math.floor((new_time % 1) * 60 )

 -- only need to call digiline_send once to set the value, as it will remain on the end-point device until it is changed again.

   if old_hour ~= hour then
    send_hour() -- send only if hour has changed
   end

   if old_minute ~= minute then
    send_minute() -- send only if minute has changed
    end
    end
    end
fixed
line 18 added )
and line 29 added then
:-P
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

User avatar
ulla
Member
Posts: 109
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

Re: [Mod] Digilines [digilines]

by ulla » Post

Miniontoby wrote:I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work

If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing

Here is the code

Code: Select all

-- time to screen script
if event.channel == "t" then
if event.msg == "1" then
digiline_send("allon", "clear")
digiline_send("allon","1")
elseif event.msg == "2" then
digiline_send("allon", "clear")
digiline_send("allon","2")
elseif event.msg == "3" then
digiline_send("allon", "clear")
digiline_send("allon","3")
elseif ............
Please help me
need add clear cmd
but is better in this mode
  • __1 __put

    Code: Select all

    if event.type == "on" then
      digiline_send("clock", "GET")
    end
    in luacontroller and connect one blinky_plant
    __2__ connect rtc and assign "clock" how channel
    __3__ connect rtc whit one other lua controller and put this :

    Code: Select all

    if event.channel == "clock" then
      time = event.msg * 24
      hour = math.floor(time)
      tenhour, hour = math.floor(hour / 10), hour % 10
      time = (time % 1) * 60
      minute = math.floor(time)
      tenminute, minute = math.floor(minute / 10), minute % 10
    digiline_send("lop", tenhour)
    digiline_send("pol", hour)
    digiline_send("olp", tenminute)
    digiline_send("plo", minute)
    end
    __4__connect the luacontroller whit 4 led or 4 lcd and assign channel lop pol olp plo and work
    if use 4 led connect from last to first if you place them near
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

User avatar
Miniontoby
Member
Posts: 438
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Digilines [digilines]

by Miniontoby » Post

ulla wrote:
Miniontoby wrote:I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work

If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing

Here is the code

Code: Select all

-- time to screen script
if event.channel == "t" then
if event.msg == "1" then
digiline_send("allon", "clear")
digiline_send("allon","1")
elseif event.msg == "2" then
digiline_send("allon", "clear")
digiline_send("allon","2")
elseif event.msg == "3" then
digiline_send("allon", "clear")
digiline_send("allon","3")
elseif ............
Please help me
need add clear cmd
but is better in this mode
  • __1 __put

    Code: Select all

    if event.type == "on" then
      digiline_send("clock", "GET")
    end
    in luacontroller and connect one blinky_plant
    __2__ connect rtc and assign "clock" how channel
    __3__ connect rtc whit one other lua controller and put this :

    Code: Select all

    if event.channel == "clock" then
      time = event.msg * 24
      hour = math.floor(time)
      tenhour, hour = math.floor(hour / 10), hour % 10
      time = (time % 1) * 60
      minute = math.floor(time)
      tenminute, minute = math.floor(minute / 10), minute % 10
    digiline_send("lop", tenhour)
    digiline_send("pol", hour)
    digiline_send("olp", tenminute)
    digiline_send("plo", minute)
    end
    __4__connect the luacontroller whit 4 led or 4 lcd and assign channel lop pol olp plo and work
    if use 4 led connect from last to first if you place them near
__1__ The blinky-plant overheat the lua-controller
__2__ I did
__3__ I can try

But that I don't want

and p.s. "whit" needs to be "with"
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

nate_4000
New member
Posts: 1
Joined: Wed Aug 26, 2020 15:46
In-game: nate_4000

Re: [Mod] Digilines [digilines]

by nate_4000 » Post

Back in the first and second pages, you guys were asking for a crafting recipe. So here it is:

Digimese ore

Mese:M
Stone:S
Digiline:D

DSD
SMS
DSD

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests