markdwags / Razor

Razor is a free tool designed to help with simple tasks while playing Ultima Online.
https://www.razorce.com
GNU General Public License v3.0
139 stars 97 forks source link

Consider implementing a "find" script expression for specific objects [FEATURE] #150

Closed Kadoba closed 2 years ago

Kadoba commented 3 years ago

The expressions findbuff and findtype are both implemented but there doesn't seem to be one to check for the existence of a specific known item or entity. Having such an expression named "find" would be consistent with the naming scheme for lift and lifttype.

As for an example, let's say you have a reagent bag with an organizer assigned to it. Obviously you can easily lose this. You could use a macro to trigger the organizer but if the bag can't be found the script requests you assign a new one first.

// Fires organizer 4. If it can't be found then it asks the player to assign a new one.
if not find 'regbag'
   setvar 'regbag'
   organizer 4 'set'
   waitfortarget
   target 'regbag'
endif
organizer 4
markdwags commented 3 years ago

Just to clarify, find would be doing a check if your variable (in this case regbag) could be found?

Kadoba commented 3 years ago

Yes or any serial

markdwags commented 2 years ago

Closing this request for now. If it gains more interest we can look at it again.