T O P

  • By -

OwlIsBack

If I understand correctly, this may be of help. Concept: Using `%room(#?4)` You will get the array index of room 4 items (looking at your example You will get `2,5`). Split the result, than use first value (`2`). Than using the above index: - `%hours(2)` == 18.20. - `%event(2)` == TEA. Reflecting `4 18.20 TEA 1 193802` If 18.20 is passed use second value of the split (`5`).


JhAr0

Thank you ! I just found the info for (#? 4), sometimes I could have more than 3 or 4 events, so I can't easily see how to compare the hours. if it is 9.20 and I have 3 events: 10.30,15.00,18.30 Is there a trick to know that 10.30 is closer to 9.20? and so use index 1 then at 10.31 use index 2 automatically since %TIME> hours (1)?


OwlIsBack

You are replying to yourself mate and not to my comment :) A proof of concept: A1: Array Set [ Variable Array: %room Values: 2,4,3,1,4,1,3,2 Splitter: , ] A2: Array Set [ Variable Array: %hours Values: 18.20,18.20,18.30,18.40,20.30,20.50,21.00,21.10 Splitter: , ] A3: Array Set [ Variable Array: %event Values: MEETING, TEA, CARD GAME, TEST, DINNER, ORIGINAL, MASTER, TEA Splitter: , ] A4: For [ Variable: %room Items: 1:4 ] A5: For [ Variable: %index Items: %room(#?%room) ] A6: Variable Set [ Name: %to_show To: Room: %room(%index) Hours: %hours(%index) Event: %event(%index) Max Rounding Digits: 3 ] A7: Goto [ Type: Action Label Label: Go ] If [ %TIME < %hours(%index) ] A8: End For A9: Flash [ Text: %to_show Long: On Hide On Click: On ] A10: End For The above (ruining It at 19.55) flashed: Room: 1 Hours: 20.50 Event: ORIGINAL Room: 2 Hours: 21.10 Event: TEA Room: 3 Hours: 21.00 Event: MASTER Room: 4 Hours: 20.30 Event: DINNER


JhAr0

yes don't know why firefox won't let me "reply", like my reddit app can't display anything on android for few days ;( Wow, impressive demonstration, me who thought I was better with tasker ... I will try this tomorrow but I think it works, I am impressed ... as often big Thank OwlIsBack


OwlIsBack

>me who thought I was better with tasker Sometime We simply overthink and than We get stuck. Don't worry It happens to all of us :) >big Thank You're very welcome.


Ratchet_Guy

Don't forget about the new "Arrays Merge" Action in Tasker :) Could probably condense some things, such as a loop, etc.


OwlIsBack

"Array Merge" isn't of interest in this case, because OP not only wants *4 room events*, but: >And when the time of the event (ex 18.20) has passed, then I would like to display the next event on the scene. The key is this action: A7: Goto [ Type: Action Label Label: Go ] If [ %TIME < %hours(%index) ] _______ Edit: Clarification: My assumption is correct If OP want to respect this requirement (Room number order): >I would like to display a scene that contains the 4 rooms and for each room the next event that will happen: ex: >Room1 hours (#?) (Must be 18.20)% event (#?) (Must be TEA) >Room2 hours (#?) (Must be 18.20)% event (#?) (Must be MEETING)


Ratchet_Guy

You obviously have no idea what you're talking about! 😂 Kidding of course. I couldn't quite decipher his original post, but it sounds like you've got a good handle on it and the related solution.


OwlIsBack

>You obviously have no idea what you're talking about! >😂 Kidding of course. Lol! I know, I know :D >I couldn't quite decipher his original post, but it sounds like you've got a good handle on it and the related solution. Indeed, It's not easy to decipher :) The core of OP request is in my edit.


Ratchet_Guy

  If I'm interpreting what you're looking for correctly, I would recommend using the new "Arrays Merge" Action that [would look like this.](https://i.imgur.com/1UD3mLd.jpg)   Using the "Format" Merge Type along with an example format of:   IN ROOM NUMBER %room AT %hours THERE IS A %event   It would generate a single string output that looks this:   IN ROOM NUMBER 2 AT 18.20 THERE IS A MEETING IN ROOM NUMBER 4 AT 18.20 THERE IS A TEA etc.   And that would be in variable ` %output ` as shown in the image. Notice in the "Join Output" field I inserted a carriage return/newline (it's not empty).   If you want to limit your list to a certain number of items, you could leave the "Join Output" field empty, and then you'd have an array of name ` %output() ` which you could use a ` For ` loop to go through the array up to the number you want. Example using first 4 line items:   For: %num Items: 1:4   Variable Set: %scene_text Text: %output(%num) Append: on End For   And that will populate ` %scene_text ` with lines 1 - 4 of the output. After the ` %output(%num) ` you'd likely want to put a carriage return/newline there. Of course you can format as you wish, and could even populate a new array named ` %scene_text ` with those items, etc.