Here are some:
Code:
// resize script by Dora Gustafson, Studio Dora 2010
// Free for anybody to read, copy, modify, compile, use, rip apart, trample on and flush
// The script is open source and free. As so it is not supported in any way
// NOTE: only for SL server v1.38 and later
// Place in prim or linkset in order to resize
// Must run in root prim
// resizer v1.0 No check or precautions against dimensions out of limits
// resizer v1.1 Test if new dimensions are within limts [0.01;10.0]m If not, resize is cancelled
// resizer v1.2 Added kill script button
// resizer v1.3 Added llListenRemove() for low lag
// resizer v1.4 Added Current relative size display
// resizer v1.5 Added rounding for size display
// resizer v1.6 Reversible resize increments
// resizer v1.7 changed to accept 64m max prim size, limits [0.01;64.0]m
integer dialogChanal;
list USER_MENU = [ "Size@Rez", "Size@Buy", "Kill Script", "-1.96..%", "-4.76..%", "-9.09..%", "+2%", "+5%", "+10%" ];
string uDialogP = "•Resize\n•Set to Size at Rez\n•Set to Size at Buy";
float fabsizeX;
float rezsizeX;
vector rs;
float listenTimeout=1800.0; // seconds
integer listenHandle;
open_dialog( vector vr )
{
string s="Size is "+(string)(llRound(100.0*vr.x/fabsizeX))+" %\n";
llDialog( llGetOwner(), s+uDialogP, USER_MENU, dialogChanal);
llSetTimerEvent(listenTimeout);
}
integer dimTest( vector vr )
{
return !( vr.x<0.01 || vr.y<0.01 || vr.z<0.01 || vr.x>64.0 || vr.y>64.0 || vr.z>64.0 );
}
primloop( float scal )
{
integer primindx;
integer validDim=TRUE;
list primP;
if (llGetNumberOfPrims()<2) validDim = validDim && dimTest( scal*llGetScale());
else
for ( primindx = 1; primindx <= llGetNumberOfPrims(); primindx++ )
{
primP = llGetLinkPrimitiveParams( primindx, [PRIM_SIZE]);
validDim = validDim && dimTest( scal*llList2Vector( primP, 0 ));
}
if ( validDim )
{
if (llGetNumberOfPrims()<2) llSetScale( scal*llGetScale()); // not linked prim
else
for ( primindx = 1; primindx <= llGetNumberOfPrims(); primindx++ )
{
primP = llGetLinkPrimitiveParams( primindx, [PRIM_SIZE, PRIM_POSITION]);
vector primScale = scal*llList2Vector( primP, 0 );
vector primPos = scal*(llList2Vector( primP, 1 )-llGetPos());
if ( primindx == 1 ) llSetLinkPrimitiveParamsFast( primindx, [PRIM_SIZE, primScale]);
else llSetLinkPrimitiveParamsFast( primindx, [PRIM_SIZE, primScale, PRIM_POSITION, primPos/llGetRootRotation()]);
}
}
else llOwnerSay("No resize! Out of limit sizes are not accepted");
}
default
{
state_entry()
{
rs = llGetScale();
fabsizeX = rs.x;
rezsizeX = fabsizeX;
llOwnerSay("Size at buy is set to Current size");
}
on_rez( integer p)
{
rs = llGetScale();
rezsizeX = rs.x;
}
touch_end(integer n)
{
if (llDetectedKey(0) == llGetOwner())
{
dialogChanal = (integer)llFrand( 8388608.0 ) + 0x80000000;
llListenRemove(listenHandle);
listenHandle = llListen( dialogChanal, "", llGetOwner(), "");
open_dialog(llGetScale());
}
}
listen(integer cannel, string name, key id, string message)
{
if ( message == "Kill Script" ) llRemoveInventory( llGetScriptName());
else
{
rs = llGetScale();
if ( message == "+2%" ) primloop( 1.02);
else if ( message == "+5%" ) primloop( 1.05);
else if ( message == "+10%" ) primloop( 1.1);
else if ( message == "-1.96..%" ) primloop( 1.0/1.02);
else if ( message == "-4.76..%" ) primloop( 1.0/1.05);
else if ( message == "-9.09..%" ) primloop( 1.0/1.1);
else if ( message == "Size@Rez" ) primloop( rezsizeX/rs.x);
else if ( message == "Size@Buy" ) primloop( fabsizeX/rs.x);
open_dialog(llGetScale());
}
}
timer()
{
llListenRemove(listenHandle);
llSetTimerEvent(0.0);
}
}
Tested, and it seems to work.
And another one:
Code:
///////////////////////////////////////////////////////////////////////////////
// Resizer
// by Emma Nowhere
//
// Last modified: 6/1/2010
//
// How to use with menu:
// 1. Install this script in the root prim of a linked set of prims (aka "linkset")
// 2. Type /1resizer to show the menu
// 3. Hit the appropriate buttons to scale up or down the linkset
// 4. Hit the "Finish" button to remove the script and finalize prim sizes
//
// Optionally, enter the percentage directly via chat by typing /1resizer x%
// where x is the percentage of the original size you want to resize to.
//
// If using in a product with no other scripts, change START_ON_TOUCH below to TRUE
// so user can initiate resizing by just touching the object.
integer START_ON_TOUCH = FALSE;
// Display status messages in chat window (to owner only)
integer SAY_STATUS = TRUE;
// Channel to listen for commands on
integer CHAT_CHANNEL = 1;
// SL constraints
float MIN_SIZE = .01;
float MAX_SIZE = 10;
float MAX_DISTANCE = 10;
float MIN_SCALE = .1;
integer MENU_CHANNEL = -1001;
list backupPrims = [];
integer backupStored = FALSE;
float scale = 1.0;
init_menu_channel() {
MENU_CHANNEL = ((integer)("0x" + llGetSubString((string)llGetKey(), -8, -1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
}
say_status(string msg) {
if (SAY_STATUS) llOwnerSay(msg);
}
backup() {
if (!backupStored) {
say_status("Backing up prim positions and sizes.");
backupPrims = [];
integer p = llGetNumberOfPrims();
integer i = 0;
vector root_pos = <0, 0, 0>;
for (i = 1; i <= p; i++)
{
list params = llGetLinkPrimitiveParams(i, [PRIM_POSITION, PRIM_SIZE]);
vector pos = llList2Vector(params, 0);
vector size = llList2Vector(params, 1);
if (i == 1)
{
root_pos = pos;
}
else {
pos = pos - root_pos;
}
backupPrims = backupPrims + pos + size;
}
backupStored = TRUE;
say_status("Prim positions and sizes backed up.");
}
}
float min(float a, float b) {
if (a < b) return a;
return b;
}
float max(float a, float b) {
if (a > b) return a;
return b;
}
float constrainMinMax(float value, float min, float max) {
value = max(value, min);
value = min(value, max);
return value;
}
vector constrainSize(vector size) {
size.x = constrainMinMax(size.x, MIN_SIZE, MAX_SIZE);
size.y = constrainMinMax(size.y, MIN_SIZE, MAX_SIZE);
size.z = constrainMinMax(size.z, MIN_SIZE, MAX_SIZE);
return size;
}
vector constrainDistance(vector delta) {
delta.x = min(delta.x, MAX_DISTANCE);
delta.y = min(delta.y, MAX_DISTANCE);
delta.z = min(delta.z, MAX_DISTANCE);
return delta;
}
process(integer restore) {
backup();
if (restore) {
say_status("Restoring previously backed up positions and sizes.");
scale = 1;
}
else {
say_status("Resizing prims to " + (string)llRound(scale * 100) + "% of original size.");
}
integer p = llGetNumberOfPrims();
integer i = 0;
for (i = 1; i <= p; i++)
{
vector pos = llList2Vector(backupPrims, (i - 1) * 2);
vector size = llList2Vector(backupPrims, ((i - 1) * 2) + 1);
if (!restore) size = constrainSize(size * scale);
if (i == 1) {
llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size]);
}
else {
if (!restore) pos = constrainDistance(pos * scale);
llSetLinkPrimitiveParamsFast(i, [PRIM_POSITION, pos, PRIM_SIZE, size]);
}
}
if (restore) {
say_status("Previously backed up prim positions and sizes restored.");
}
else {
say_status("Prims resized.");
}
}
finish() {
say_status("Deleting Resizer script.");
llRemoveInventory(llGetScriptName());
}
menu() {
llDialog(llGetOwner(),
"Resizer\n\nMake a backup of your object first.\n\nPlease choose an option:\n",
["Revert", "-", "Finish", "-1%", "-5%", "-10%", "+1%", "+5%", "+10%"], MENU_CHANNEL);
}
handle_message(integer channel, string name, key id, string message)
{
if (channel == CHAT_CHANNEL) {
if (message == "resizer") {
menu();
}
else if (llSubStringIndex(message, "resizer") == 0) {
list params = llParseString2List(message, [" "], [] );
if (llGetListLength(params) == 2) {
string scale_param = llList2String(params, 1);
if (llGetSubString(scale_param, -1, -1) == "%") {
scale = (((float)llGetSubString(scale_param, 0, -2)) / 100);
scale = max(scale, MIN_SCALE);
process(FALSE);
}
}
}
}
else if (channel == MENU_CHANNEL) {
if (message == "Revert") {
process(TRUE);
menu();
}
else if (message == "Finish") {
finish();
}
else if (llGetSubString(message, -1, -1) == "%") {
scale = scale + (((float)llGetSubString(message, 0, -2)) / 100);
scale = max(scale, MIN_SCALE);
process(FALSE);
menu();
}
}
}
default
{
state_entry()
{
if (START_ON_TOUCH) {
// we only want a touch_start handler if we're going to use it
// so change state rather than just testing inside touch_start
// for START_ON_TOUCH to be true.
state start_on_touch;
}
else {
llListen(CHAT_CHANNEL, "", llGetOwner(), "");
init_menu_channel();
llListen(MENU_CHANNEL, "", llGetOwner(), "");
llOwnerSay("Resizer Ready");
llOwnerSay("Type /" + (string)CHAT_CHANNEL + "resizer for menu.");
}
}
on_rez(integer start_param) {
llOwnerSay("Resizer Installed");
llOwnerSay("Type /" + (string)CHAT_CHANNEL + "resizer for menu.");
}
listen(integer channel, string name, key id, string message)
{
handle_message(channel, name, id, message);
}
}
state start_on_touch
{
state_entry()
{
llListen(CHAT_CHANNEL, "", llGetOwner(), "");
init_menu_channel();
llListen(MENU_CHANNEL, "", llGetOwner(), "");
llOwnerSay("Resizer Ready");
llOwnerSay("Touch for resizer menu.");
}
on_rez(integer start_param) {
llOwnerSay("Resizer Installed");
llOwnerSay("Touch for resizer menu.");
}
listen(integer channel, string name, key id, string message)
{
handle_message(channel, name, id, message);
}
touch_start(integer num_detected)
{
menu();
}
}
This one gives an error on line 87 and 88. (Expression denotes a variable', where a 'method group' was expected.)
And another one:
Code:
// Linkset Resizer with Menu
// version 1.00 (25.04.2010)
// by: Brilliant Scientist
// --
// This script resizes all prims in a linkset, the process is controlled via a menu.
// The script works on arbitrary linksets and requires no configuration.
// The number of prims of the linkset it can process is limited only by the script's memory.
// The script is based on "Linkset Resizer" script by Maestro Linden.
// http://wiki.secondlife.com/wiki/Linkset_resizer
// This script still doesn't check prim linkability rules, which are described in:
// http://wiki.secondlife.com/wiki/Linkability_Rules
// Special thanks to:
// Ann Otoole
float MIN_DIMENSION=0.01; // the minimum scale of a prim allowed, in any dimension
float MAX_DIMENSION=10.0; // the maximum scale of a prim allowed, in any dimension
float max_scale;
float min_scale;
float cur_scale = 1.0;
integer handle;
integer menuChan;
float min_original_scale=10.0; // minimum x/y/z component of the scales in the linkset
float max_original_scale=0.0; // minimum x/y/z component of the scales in the linkset
list link_scales = [];
list link_positions = [];
makeMenu()
{
llListenRemove(handle);
menuChan = 50000 + (integer)llFrand(50000.00);
handle = llListen(menuChan,"",llGetOwner(),"");
//the button values can be changed i.e. you can set a value like "-1.00" or "+2.00"
//and it will work without changing anything else in the script
llDialog(llGetOwner(),"Max scale: "+(string)max_scale+"\nMin scale: "+(string)min_scale+"\n \nCurrent scale: "+
(string)cur_scale,["-0.05","-0.10","-0.25","+0.05","+0.10","+0.25","MIN SIZE","RESTORE","MAX SIZE","DELETE..."],menuChan);
}
integer scanLinkset()
{
integer link_qty = llGetNumberOfPrims();
integer link_idx;
vector link_pos;
vector link_scale;
//script made specifically for linksets, not for single prims
if (link_qty > 1)
{
//link numbering in linksets starts with 1
for (link_idx=1; link_idx <= link_qty; ++link_idx)
{
link_pos=llList2Vector(llGetLinkPrimitiveParams(link_idx, [PRIM_POS_LOCAL]),0);
link_scale=llList2Vector(llGetLinkPrimitiveParams(link_idx,[PRIM_SIZE]),0);
// determine the minimum and maximum prim scales in the linkset,
// so that rescaling doesn't fail due to prim scale limitations
if(link_scale.x<min_original_scale) min_original_scale=link_scale.x;
else if(link_scale.x>max_original_scale) max_original_scale=link_scale.x;
if(link_scale.y<min_original_scale) min_original_scale=link_scale.y;
else if(link_scale.y>max_original_scale) max_original_scale=link_scale.y;
if(link_scale.z<min_original_scale) min_original_scale=link_scale.z;
else if(link_scale.z>max_original_scale) max_original_scale=link_scale.z;
link_scales += [link_scale];
link_positions += [link_pos];
}
}
else
{
llOwnerSay("error: this script doesn't work for non-linked objects");
return FALSE;
}
max_scale = MAX_DIMENSION/max_original_scale;
min_scale = MIN_DIMENSION/min_original_scale;
return TRUE;
}
resizeObject(float scale)
{
integer link_qty = llGetNumberOfPrims();
integer link_idx;
vector new_size;
vector new_pos;
if (link_qty > 1)
{
//link numbering in linksets starts with 1
for (link_idx=1; link_idx <= link_qty; link_idx++)
{
new_size = scale * llList2Vector(link_scales, link_idx-1);
if (link_idx == 1)
{
//because we don't really want to move the root prim as it moves the whole object
llSetLinkPrimitiveParamsFast(link_idx, [PRIM_SIZE, new_size]);
}
else
{
new_pos = scale * llList2Vector(link_positions, link_idx-1);
llSetLinkPrimitiveParamsFast(link_idx, [PRIM_SIZE, new_size, PRIM_POSITION, new_pos]);
}
}
}
}
default
{
state_entry()
{
if (scanLinkset())
{
//llOwnerSay("resizer script ready");
}
else
{
llRemoveInventory(llGetScriptName());
}
}
touch_start(integer total)
{
if (llDetectedKey(0) == llGetOwner()) makeMenu();
}
listen(integer channel, string name, key id, string msg)
{
//you can never be too secure
if (id == llGetOwner())
{
if (msg == "RESTORE")
{
cur_scale = 1.0;
}
else if (msg == "MIN SIZE")
{
cur_scale = min_scale;
}
else if (msg == "MAX SIZE")
{
cur_scale = max_scale;
}
else if (msg == "DELETE...")
{
llDialog(llGetOwner(),"Are you sure you want to delete the resizer script?",
["DELETE","CANCEL"],menuChan);
return;
}
else if (msg == "DELETE")
{
llOwnerSay("deleting resizer script...");
llRemoveInventory(llGetScriptName());
}
else
{
cur_scale += (float)msg;
}
//check that the scale doesn't go beyond the bounds
if (cur_scale > max_scale) { cur_scale = max_scale; }
if (cur_scale < min_scale) { cur_scale = min_scale; }
resizeObject(cur_scale);
}
}
}
I just tested it in-world, it compiles ok, but when used, the whole linkset gets messed up. (see pic)

(Yes, the pile of prims on the left, is a resized version of the carriage on the right, lol)
And the last resizer script can be found here:
http://community.secondlife.com/t5/LSL- ... d-p/711557(I'm lazy today, too much scripts to copy from that post

)
Hope this helps,
Odd