function thats been removed

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
gundamwing84
Grandmaster Poster
Posts: 178
Joined: Tue Sep 08, 2009 1:57 am

function thats been removed

Post 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 )
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: function thats been removed

Post 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.
gundamwing84
Grandmaster Poster
Posts: 178
Joined: Tue Sep 08, 2009 1:57 am

Re: function thats been removed

Post by gundamwing84 »

ahh ok i see, thankyou turley :)
Post Reply