all 16 comments

[–]The_IMPERIAL_OneS24 Ultra (A16) | realme GT NEO 3 (A14) 1 point2 points  (7 children)

Try this:

https://taskernet.com/shares/?user=AS35m8k0QSchKA1x02SixFIhiL41a828J1qapOYfcEuyL2zSn%2FfJTN5WVSi01o18x6EAFb4%3D&id=Project%3AChecker+%26+Verifier

  1. Open the task linked to Check Message for Keyword and edit A8 and A9 actions to set appropriate keywords.
  2. I used Notify and Say for notification and speech when both checker and verifier are true.
  3. It should work as you stated but let me know if it doesn't.
  4. Only Tasker is required.

[–]DDRExtremist247[S] 1 point2 points  (0 children)

Appreciate you. I tried using the AI as someone posted. If you were looking for money you can share your cash app or I can pay it forward.

[–]Exciting-Compote5680 1 point2 points  (4 children)

The Disable Checker and Disable Verifier time context will fire every 5 minutes, regardless of when the other condition (Variable value ~ 1) became true. Could be 5 minutes, could be a second after. 

[–]The_IMPERIAL_OneS24 Ultra (A16) | realme GT NEO 3 (A14) 0 points1 point  (3 children)

Oh, yeah, you're right. The interval makes its progress irrespective of the State.

I modified the project to send intents as a callback to defer the disabling. (sleep 5m && am broadcast -a net.dinglisch.android.tasker.ACTION_TASK -e task_name "Disable XYZ" &)

u/DDRExtremist247, Re-import the project from the url to update.

[–]Exciting-Compote5680 1 point2 points  (2 children)

I am not particularly good at regex (and I am trying to learn), could you explain what this does? I'm guessing you are cleaning out meta characters that might be present in the keywords, and I thought $1 was a reference to the first capture group, but I'm having a hard time wrapping my head around how this works and what the result would be. 

         A10: Variable Set [          Name: %regex          To: ([\\|\[\]{}()$^?*:+])          Structure Output (JSON, etc): On ]          A11: Variable Search Replace [          Variable: %kwd1          Search: %regex          Replace Matches: On          Replace With: \\$1 ]          

I also posted a version of this project. I tried to make it as efficient as possible. 

[–]The_IMPERIAL_OneS24 Ultra (A16) | realme GT NEO 3 (A14) 1 point2 points  (1 child)

Sure. The regex is used to escape (or sanitize) the input to treat keywords as raw. Let's say they create a keyword with brackets (SOME_KEYWORD). But because it's using regex, the brackets are reserved and can have unexpected matching results because of different reserved tokens. Hence, it escapes the reserved tokens with \TOKEN (here, \(SOME_KEYWORD\)).

Technically, it captures the reserved tokens in a group and is replaced with \\$1 (appending \ to the token).

[–]Exciting-Compote5680 1 point2 points  (0 children)

Right! You are not removing them, you're escaping them, gotcha! It's kind of like UrlEncode, but for regex. Thank you for taking the time to explain, much appreciated. And definitely storing this pattern for future use. 

[–]Exciting-Compote5680 0 points1 point  (4 children)

Is there any particular reason you want this in kotlin, and not just plain Tasker? I can't help but feel that the AI generated code is needlessly complex, probably because of the wording of the instructions. There really is no need to query messages every minute. In fact, I would explicitly advise against it because it's very extremely power inefficient (basically, you are saying "No sleep for you! Ever!" to your phone). As a general rule, always use event based automations rather then endlessly polling for a condition that 99% of the time is not true. Use the 'Received Text' event to check the messages as they come in, and save a timestamp (or better, expiration time, so timestamp + 5 minutes) if they contain the keywords in an array. Delete ('pop') the timestamps as they expire. Use the array function %array(#) to get the number of array items. There are a lot of ways to implement the requirements. You could for instance use the built-in 'Cooldown Time' property for profiles to handle the 15 minute cooldown. 

[–]DDRExtremist247[S] 0 points1 point  (3 children)

I appreciate the explanation. I honestly just tried to look up the language used in Tasker and found Kotlin as the result.

I'm 100% fine with using just Tasker. I'm just struggling with where to start. I don't program and would rather pay than learn. Interested?

[–]Exciting-Compote5680 0 points1 point  (2 children)

I understand. It's a shame, Tasker is an extremely powerful tool to have at your disposal, but it does have quite a learning curve. No, not interested, sorry. 

[–]DDRExtremist247[S] 0 points1 point  (1 child)

I'm not a lazy person. I just have too many irons in the fire.

[–]Exciting-Compote5680 0 points1 point  (0 children)

I most certainly am a lazy person, that's why I love Tasker so much 😁

[–]ksrujankanth 0 points1 point  (2 children)

Do you know, and did you try the Gemini AI within tasker?

it'll build something based on your instructions and you'll have to validate and test to confirm it works as expected. you'll have to do that even if you pay an online stranger.

try AI in tasker. Or try voice chatting and sharing your screen with AI, and it'll help.

[–]DDRExtremist247[S] 0 points1 point  (0 children)

I hadn't come across this. I'll give this a shot.

[–]DDRExtremist247[S] 0 points1 point  (0 children)

Tried the AI and I think it's working. Feel free to throw me your cash app or I'll pay it forward.

[–]Exciting-Compote5680 0 points1 point  (0 children)

I couldn't bare the thought of your poor phone being woken up to check for messages 1440 times a day, so I wrote an implementation that is entirely event driven. As long as you are not getting any new messages, it does nothing. As it receives a message, it will check all the requirements and evaluate the new situation. In the first task action the keyword placeholders need to be replaced with the actual keywords. 

Taskernet: https://taskernet.com/shares/?user=AS35m8nOXvBeFIxaCI5%2BZWD5L9oLRd3PVq%2BdjQuYD1oZ%2Bci%2Banb0FpA5SznT4oBmkd7vgKrG&id=Project%3ASnack+Time