Author Topic:  "CanExecute" script conditional  (Read 234 times)

0 Members and 1 Guest are viewing this topic.


  • Supreme Member
  • *****
  • Posts: 4334
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site 3 years on site Site art contributions/TPs in-game/Contest winners 1 year on site
    • View Profile
    • Awards
  • Xbox: dryym
"CanExecute" script conditional
« on: December 23, 2016, 01:53:43 PM »
I think it would be great if we had a conditional that simply checks if a set command can execute and make a change.

In some uses, This would just be a matter of convenience, In others, It would allow for entirely new conditions that wouldn't be possible otherwise.

Some examples include

  CanExecute [Var [Health] = [Health:]] [True]
  Var [Health] = [Health:]
  // Player HP has changed since the last time this was executed.
  // Would normally require 2 vars to be created in order to detect a change.
  // Player HP has not changed since the last time this was executed."

  CanExecute [CaveIn [x,y,z]] [True]
  // No caveins active on the map, And the coordinates are valid.
  // Determining whether or not a cavein is happening would normally require a conditional that doesn't exist."

  CanExecute [CopyBlock [x,y,z] [x,y,z]] [True]
  // Checks whether or not two blocks match each other exactly, Or of the coordinates are valid."

MC has this in the form of comparitors facing off of a command block, It effectively turns all commands into conditionals if you decide to use them that way, And I think it could be really useful to people who are more creative with scripts.

I don't know if scripts can tell whether or not the command actually changed anything, But I know that they can tell whether or not the command is valid, And if not, What went wrong. So it feels like this is half way there.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym