Welcome, Guest
Username: Password: Remember me

TOPIC: OnDataChange Script

OnDataChange Script 3 months 1 week ago #2034

i want to optimize on how i use OnDataChange
  1. should i combine several tasks with different tags into one script? like combining task A which dependent on tag 1 and task B which dependent on tag 2 into one script?
  2. if several tasks depend on 1 tag, should I combine it into 1 script?
  3. how to effectively use "if" command on OnDataChange Script? will putting the tag inside If command affect it?
  4. which is the best way to script a task that depends on multiple tags? like a task that only works if tag A is true and tag B is false?
thank you in advance
The administrator has disabled public write access.

OnDataChange Script 3 months 1 week ago #2035

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 658
  • Thank you received: 101
  • Karma: -113
Answers to your questions:
1. If task A depends on only tag 1 and task B depends on only tag 2 I think it's better to create to different scripts. It makes script more readable.
2. I think yes. It's better to place all these tasks in one script.
3. Yes, the putting tag inside "if" will affect on the script. If value of this tag is changed this script will be executed.
4. The best way is place this task in one script and use "if" operator to execute the conditions you want.

Best regards,
Ruslan
The administrator has disabled public write access.
Go to top