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

0 Members and 1 Guest are viewing this topic.

Father Dryymas

  • Supreme Member
  • *****
  • Posts: 4116
  • 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+300 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • 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

"If
  CanExecute [Var [Health] = [Health:]] [True]
Then
  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.
Else
  // Player HP has not changed since the last time this was executed."

"If
  CanExecute [CaveIn [x,y,z]] [True]
Then
  // 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."

"If
  CanExecute [CopyBlock [x,y,z] [x,y,z]] [True]
Then
  // 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