Page 1 of 1

Scripts to make multi.txt and multi.uoa files

Posted: Mon Mar 02, 2009 1:15 pm
by Tomi
Text Command to make a multi.uoa in the same format as UO Architect uses. ( Now also UOFiddler support this format for import and export )

Working with Pol097 & Pol098 at least, probably if you change the += in the script it will work with 096 aswell. And remove the realm parameters I suppose it can work with Pol095 too.

Code: Select all

use uo;
use os;
use file;

program textcmd_createmultiuoa( who, filename )

	if ( !filename )
		SendSysMessage( who, "Usage: .createmultiuoa <nameofthefile>." );
		return 0;
	endif

             filename := filename + ".uoa";
  
	SendSysMessage( who, "Target the center point." );

	var trg := TargetCoordinates( who );

	if ( !trg )
		SendSysMessage( who, "Cancelled." );
		return 0;
	endif
  
	SendSysMessage( who, "Target the upper left corner." );

	var up := TargetCoordinates( who );

	if ( !up )
		SendSysMessage( who, "Cancelled." );
		return 0;
	endif
  
	SendSysMessage( who, "Target the lower right corner." );

	var low := TargetCoordinates( who );

	if ( !low )
		SendSysMessage( who, "Cancelled." );
		return 0;
	endif
  
	var area	 := ListObjectsInBox( up.x, up.y, -128, low.x, low.y, 127, trg.realm );
	var items	 := array;
	var num		 := 0;

	foreach item in area
		if ( item.IsA( POLCLASS_ITEM ) )
			items.append( CInt( item.graphic ) + " " + CInt( item.x - trg.x ) + " " + CInt( item.y - trg.y ) + " " + CInt( item.z) + " 1" );
			num += 1;
		endif
		Sleepms( 2 );
	endforeach

	items := { "6 version", "1 template id", "-1 item version", num + " num components" } + items;
  
	var file := WriteFile( filename, items );

	if (file)
		SendSysMessage( who, "Done. " + num + " components added." );
	else
		SendSysMessage( who, "Error: " + file );
	endif

endprogram

Re: Script to make a multi.txt in UO Architect format

Posted: Sun May 03, 2009 4:23 pm
by Tomi
Text Command to make a multi.txt in the same format as Mulpatcher uses. ( Now also UOFiddler support this format for import and export )

Working with Pol097 & Pol098 at least, probably if you change the += in the script it will work with 096 aswell. And remove the realm parameters I suppose it can work with Pol095 too.

Code: Select all

use uo;
use os;
use file;

program textcmd_createmultitxt( who, filename )

	if ( !filename )
		SendSysMessage( who, "Usage: .createmultitxt <nameofthefile>." );
		return 0;
	endif

	filename := filename + ".txt";
  
	SendSysMessage( who, "Target the center point." );

	var trg := TargetCoordinates( who );

	if ( !trg )
		SendSysMessage( who, "Cancelled." );
		return 0;
	endif
  
	SendSysMessage( who, "Target the upper left corner." );

	var up := TargetCoordinates( who );

	if ( !up )
		SendSysMessage( who, "Cancelled." );
		return 0;
	endif
  
	SendSysMessage( who, "Target the lower right corner." );

	var low := TargetCoordinates( who );

	if ( !low )
		SendSysMessage( who, "Cancelled." );
		return 0;
	endif
  
	var area	 := ListObjectsInBox( up.x, up.y, -128, low.x, low.y, 127, trg.realm );
	var items	 := array;
	var num		 := 0;

	foreach item in area
		if ( item.IsA( POLCLASS_ITEM ) )
			items.append( Hex( item.graphic ) + " " + CInt( item.x - trg.x ) + " " + CInt( item.y - trg.y ) + " " + CInt( item.z) + " 1" );
			num += 1;
		endif
		Sleepms( 2 );
	endforeach
  
	var file := WriteFile( filename, items );

	if (file)
		SendSysMessage( who, "Done. " + num + " components added." );
	else
		SendSysMessage( who, "Error: " + file );
	endif

endprogram

Re: Scripts to make multi.txt and multi.uoa files

Posted: Mon Jun 02, 2014 2:42 pm
by Harley
It's awesome, Tomi! Thank u!
More such works will be great for each shard!