Page 1 of 1

function thats been removed

Posted: Mon Jan 23, 2012 9:12 am
by gundamwing84
ok so ive run into another function that has been removed from uo.em, from 97-99.

the function is

Code: Select all

02-07-2009 Turley:
    Removed: SystemFindObjectBySerial() flag SYSFIND_SEARCH_STORAGE_AREAS (was obsolete since years)
.

and i have 1 script error left after upgrading to 99 that uses this function, the script looks a little something like:

Code: Select all

use uo;
use os;

program FixDotOwnedItemPricing()
	var newItem := CreateItemAtLocation( 1, 1, 1, 0x7059, 1 );
	var endSerial := newItem.serial;
	var fixedItems := 0;
	var i;
	
	Set_Script_Option( SCRIPTOPT_NO_RUNAWAY, 1 );
	Set_Critical(1);
	for( i := 1073741824; i < endSerial; i := i + 1 )
		var item := SystemFindObjectBySerial( i, SYSFIND_SEARCH_OFFLINE_MOBILES + SYSFIND_SEARCH_STORAGE_AREAS );
		if( item )
			if( GetObjProperty( item, "ownerserial" ) or item.buyprice == -1 )
				item.buyprice := 0;
				fixedItems := fixedItems + 1;
			endif
		endif
		if( !(i % 100000) )
			Print( i + " of " + endSerial + " done" );
		endif
	endfor

	Print( "Fixed " + fixedItems + " items" );
endprogram
would anyone be able to tell me the function currently used instead of that? or one that could be substituted?

i realize ive been asking for alot of help lately but im trying! (i really am T-T )

Re: function thats been removed

Posted: Mon Jan 23, 2012 10:06 am
by Turley
Simply remove the flag, as mentioned in the corechanges it is obsolete. Somewhere before the latest Pol95 release the sense of it was removed. So SystemFindObjectBySerial() will always find Serials in the StorageArea.

Re: function thats been removed

Posted: Mon Jan 23, 2012 10:08 am
by gundamwing84
ahh ok i see, thankyou turley :)