Welcome to PenUltima Online. Click to login or register.


ApplyConstraint( objlist, configfile, propertyname, minvalue )
Name Type
objlist array of objtype numbers
configfile config file reference
propertyname string
minvalue integer
Each element's objtype in "objlist" is looked up in the config file referenced by "configfile". if the object's value for "propertyname" is less than "minvalue", its objtype is included in the returned array.
Notes: Example: gets all the bowcraft items you can make given the amount of logs selected.
//Returns all the objtypes in the "BowcraftCarving" entry in menus.cfg:
var objtypes := GetMenuObjTypes( "BowcraftCarving" );
//Returns a subset of the objtypes in the bowcraft item crafting config file that require
//less "material" than the value of targetted_logs.amount.
objtypes := ApplyConstraint(objtypes,bowcraftconfigfile,"material",targetted_logs.amount);
//the return value is in a convienent form to use AddMenuItem()
return objtypes;
Return values
An Array of Object Types that pass the constraint.
none (instead returns an Uninitialized Object on failure)