UOOutlands / Razor

Razor is a free tool designed to help with simple tasks while playing Ultima Online.
http://www.uor-razor.com
GNU General Public License v3.0
9 stars 6 forks source link

[BUG] Commands should never throw Script Errors for offscreen/unseen/unset serials/vars #32

Open ncskrypt opened 3 years ago

ncskrypt commented 3 years ago

Nearly all commands currently throw Script Errors when using serials/vars it can't find, due to it being...

Script Errors cause everything to abruptly stop, which is not an intended outcome. Players expect particular tasks may fail & return false, but their script continues running.

Instead, all commands involving serials/vars should...

Couple Examples Below (not an exhaustive list, too many to list...)

attack 'someMobile'

target 'someSerial'

lift 'someItem'
if dead 'myPET'
  // is dead ?
  // is offscreen / not exist ?
  // impossible to know which...
endif

if dead 'myPET' = -1
  // is offscreen / not exist
elseif dead 'myPET'
  // is onscreen and dead
else
  // is alive
endif
if findlayer 'myPET' backpack
  // has backpack (is a pack llama/horse/mule)
else
  // has no backpack ?
  // is offscreen / not exist ?
  // impossible to know which...
endif

if findlayer 'myPET' backpack as 'myPETBag'
  // has backpack (is a pack llama/horse/mule)
elseif findlayer 'myPET' backpack = -1
  // is offscreen / not exist
else
  // is onscreen, but has no backpack
endif