Bug Fixes:
The Z Modifier Is Fixed
Command Now Forces All Locations
Command Now Colors Items You Are Working With
Now Moves Items Then Locks Them Down
Just make a file called "d.src" in your pkg/commands/gm directory, copy and paste the code below in it. Remember to compile. >_<
How To Use:
1. Type .d in game with a command level of GM or greater.
2. Position the gump in a convenient place and create the items you want to manipulate.
3. Click the green arrow to take control of an item. You can take control of multiple items at once. If you are controlling an item it will be marked and the items color will temporarily change.
4. Now use the manipulation buttons. It will manipulate all items that are marked. At anytime to un-mark an item, just click the red arrow. This will un-select all items. Do this when you are finished. The command will automatically restore the hue to 0 and lock the item down.
5. Note: Click the "Delete" button will delete all selected items. Item manipulation is within a 25 block range of the player.
Code: Select all
use uo;
use os;
program textcmd_d( who )
SendSysMessage( who, "Gump Active.", color := 65 );
var GFLayout := {
"page 0",
"resizepic 100 100 2620 150 150",
"checkertrans 100 100 150 150",
"button 200 105 4501 4501 1 0 100", //top right button
"button 195 195 4503 4503 1 0 200", //bottom right button
"button 105 195 4505 4505 1 0 300", //bottom left button
"button 105 105 4507 4507 1 0 400", //top left corner
"button 155 125 4500 4500 1 0 500", //alt up
"button 155 175 4504 4504 1 0 600", //alt down
"button 110 165 5531 5532 1 0 700", //delete
"button 255 105 5538 5539 1 0 800", //uncontrol
"button 255 135 5541 5542 1 0 900" //control
};
var GFData := {
};
var gump := SendDialogGump( who, GFLayout, GFData );
while( gump )
var buttoncheck;
foreach button in ( gump.keys )
buttoncheck := button;
endforeach
case( buttoncheck )
900:
control_things(who);
break;
800:
uncontrol_things(who);
break;
700:
delete_item( who );
break;
600:
alt_down( who );
break;
500:
alt_up(who);
break;
400:
top_left(who);
break;
300:
bottom_left( who );
break;
200:
bottom_right(who);
break;
100:
top_right( who );
break;
default:
gump := SendDialogGump( who, GFLayout, GFData );
break;
endcase
gump := SendDialogGump( who, GFLayout, GFData );
endwhile
SendSysMessage( who, "Gump Deactivated", color := 65 );
endprogram
function control_things( who )
var target_item := Target( who );
SetObjProperty( target_item, "#Marked", 1 );
target_item.color := 1152;
SendSysMessage( who, "Item Control On", color := 65 );
SleepMS( 100 );
endfunction
function uncontrol_things( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
EraseObjProperty( thing, "#Marked" );
SendSysMessage( who, "No Control 25 Block Radius", color := 65 );
thing.color := 0;
endif
endforeach
endfunction
function delete_item( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
DestroyItem(thing);
SendSysMessage( who, "Deleted: " + thing.name, color := 65 );
endif
endforeach
endfunction
function top_right( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
moveitem(thing);
MoveObjectToLocation( thing, thing.x, thing.y-1, thing.z , who.realm, MOVEOBJECT_FORCELOCATION );
stopitem(thing);
SendSysMessage( who, "Coords Y: " + thing.y, color := 65 );
endif
endforeach
endfunction
function alt_down( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
moveitem(thing);
MoveObjectToLocation( thing, thing.x, thing.y, thing.z-1, who.realm, MOVEOBJECT_FORCELOCATION );
stopitem(thing);
SendSysMessage( who, "Coords Z: " + thing.z, color := 65 );
endif
endforeach
endfunction
function alt_up( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
moveitem(thing);
MoveObjectToLocation( thing, thing.x, thing.y, thing.z+1, who.realm, MOVEOBJECT_FORCELOCATION );
stopitem(thing);
SendSysMessage( who, "Coords Z: " + thing.z, color := 65 );
endif
endforeach
endfunction
function top_left( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
moveitem(thing);
MoveObjectToLocation( thing, thing.x-1, thing.y, thing.z, who.realm, MOVEOBJECT_FORCELOCATION );
stopitem(thing);
SendSysMessage( who, "Coords X: " + thing.x, color := 65 );
endif
endforeach
endfunction
function bottom_left( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
moveitem(thing);
MoveObjectToLocation( thing, thing.x, thing.y+1, thing.z , who.realm, MOVEOBJECT_FORCELOCATION );
stopitem(thing);
SendSysMessage( who, "Coords Y: " + thing.y, color := 65 );
endif
endforeach
endfunction
function bottom_right( who )
foreach thing in ( ListItemsNearLocation(who.x, who.y, who.z, 25, who.realm) )
if( GetObjProperty( thing, "#Marked" ) == 1 )
moveitem(thing);
MoveObjectToLocation( thing, thing.x+1, thing.y, thing.z , who.realm, MOVEOBJECT_FORCELOCATION );
stopitem(thing);
SendSysMessage( who, "Coords X: " + thing.x, color := 65 );
endif
endforeach
endfunction
function moveitem( thing )
thing.movable := 1;
endfunction
function stopitem( thing )
thing.movable := 0;
endfunction