RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

My First Semi-Useful Script...

My First Semi-Useful Script...

It's Not Much Now. But I Am WOrking On A MUCH Larger Version That Will Include An ItemID Picker And SOme Other Nifty Toys, But I Gotta Wrap My Brain Around A Few Things.... Right Now I Am Releasing This As Sort of A Prequal Of THings To Come, And Also To Get Feedback And Suggestions On Things People Would Like Wrapped Into One Thing.. It's Really Simple, But Here It Is...

I call it a deco helper.. its basically a gump that can raise and lower objects, get certain properties and change certain properties.. (first time doin' this bare with please, I just learned gumps yesterday) It is meant for 2.0 but easily can be made to work for 1.0 as well. here is a screen shot, and of course the script... biggest problem is it doesnt stay open after using the buttons.... i will fix that in the next revision... but the command is short so i fgured that would compensate... plug and play (obviously) and then just type [dh to activate the gump.

btw... any links or tips for complex gump editing would be useful.. again thanx to Beyond and A_LiN for their patience with my EXTREME newbieism.

New revision posted further down in thread... POSTED NEW REVISION WITH ITEM PICKER FURTHER DOWN IN THREAD
 

Attachments

  • DecoHelper1.JPG
    DecoHelper1.JPG
    61.4 KB · Views: 570
  • DecoHelper.cs
    4.9 KB · Views: 108

Vhaerun

Sorceror
It looks like a great tool, even for GMs. Can't wait to see what you come up with to supplement it.

Some things you might want to include would be a hue picker (using the hue picker gump?) and a flip selection. Just a thought, but right now it looks functional and quite well thought out.
 
You shouldnt be so negative on your script... just tell in the topic what it is and you'll be fine... the script looks promising and is far away what anyone would call semi-useful. :) Not mentioning how easy to edit it is.
 
sorry.. first time posting... not really sure how good at this i should be (scripting stuff i mean) i appreciate all the positive feedback, and suggestions :) i didnt realy mean to be too negative.. its just that compared to most of the things i see flosting around, it might as well be an artifact.. :p but again thanx for the marks guys.. the hue picker thing.. i like that idea. right now i am working on a script that allows you to scroll through the items (like inside uo only ingame) but much more user friendly, but the way i have it now, i didnt post it because like this one, the calls are all separate, no nifty bits to shorten the script, for as big as its getting.. well... you could probably get away with pandoras box... except i have elven stuff. i wish arya were still around :(

... oh and the i dont want to step too far into custom command because i dont wanna step on Alpha Command ToolBar... i love that script and i think the author does great work, just wish i had a decorating tool for outside :) (and easy access to item values at least.)
 

wulf monat

Sorceror
yes this script could be useful to many people

including myself i like this script from what i seen ill try it out right away and thanks for the submission keep up the good work
 
You could shorten the script by adding a private static string[] m_CommandStrings = new string[]{"0", "1", "2", "3", "[m inc y -1", "[m inc x 1", all the others strings in numeric correct order};

And then call the commands that way: Mobile from = state.Mobile; if (info.ButtonID > 3 && info.ButtonID < m_CommandStrings.Length)CommandSystem.Handle( from, String.Format( m_CommandStrings[info.ButtonID] ) );
just to give you an idea how to shorten the lines of code used.
 
@ Kamuflaro *smiles and nods* .... actually i think i get that.. i saw in one of the scripts i was looking at for help... but if i do that, where exactly do i put the string? i mean do i put it in after the OnResponse or in the gump itself, after the buttons themselves and such? i have always been horrible with order....

Code:
		public RandomGump( Mobile owner )
			: base( 0, 0 )
		{
			this.Closable=true;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;
			this.AddPage(0);
private static string[] m_CommandStrings = new string[]{"0", "1", "2", "3", "[m inc y -1", "[m inc x 1", all the others strings in numeric correct order};

}


		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
if (info.ButtonID > 3 && info.ButtonID < m_CommandStrings.Length)CommandSystem.Handle( from, String.Format( m_CommandStrings[info.ButtonID] ) );

Like this?
with some blank filling in and well... buttons..(just as an example of placement)
 
you put it inside the class. That means above public RandomGump( Mobile owner )
You could put it in any other class too, for example in the Bag class, but then you would have to make it public not private and call it like Bag.m_CommandStrings.
 
thank you so very much.. one more wuestionn... treading arent i... can i use it something like this:

private static string[] m_CommandStrings = new string[]{"[add ", "[tile "};

Mobile from = state.Mobile;
if (info.ButtonID > 3 && info.ButtonID < m_CommandStrings.Length)CommandSystem.Handle( from, String.Format( m_CommandStrings[info.ButtonID] ) );

and then add the switch method and the command event and tell it to use command something like:

("{1} itemid xxxx")

???
so it would call the same itemid in the cases but use a different command based on say a radio button? (or visa versa if i wanna put that many miles on my mouse)
 
AnomolyVincentStarbuck said:
thank you so very much.. one more wuestionn... treading arent i... can i use it something like this:

private static string[] m_CommandStrings = new string[]{"[add ", "[tile "};

Mobile from = state.Mobile;
if (info.ButtonID > 3 && info.ButtonID < m_CommandStrings.Length)CommandSystem.Handle( from, String.Format( m_CommandStrings[info.ButtonID] ) );

and then add the switch method and the command event and tell it to use command something like:

("{1} itemid xxxx")

???
so it would call the same itemid in the cases but use a different command based on say a radio button? (or visa versa if i wanna put that many miles on my mouse)
I'm not 100% sure what you want to do, but you best try. It should be possible to get a string or something else from the gump in adition to the pressed button ID. but you don't do that "{1} item" thing, but string{1}represents + " itemid xxxx" - yes you can combine strings that way.
 
:) thanx. i will give it a go a few times and post my finished results probably in the next couple of days.. again, thank you everyone for being my books :p i hope i can contribute stuff half as nifty as half of you have :)
 
New Revisions...

I will post new revisions here.

New revision
1.0b - smaller gump (not much, but i figured i'd post it since most people have told me the gump needed to be smaller.) Screenshot below
Stays open. (also not much)
next revision will have the wall picker in it. should be ready tonight or tommorrow.

1.1 - Now Includes Item picker. Only Walls Right Now, But It Includes ALL Walls ( minus the curved ones )
Note: This Script Is Written For RunUO 2.0 but can easily be converted for 1.0 (If you need help with this,
just ask.) No Need To Download The DecoHelperRevB.cs File, The New Revision Includes An Updated Version of This File. Only Left That File For People Who Didn't Want/Need The Wall picker. (but it's mighty useful :D)
 

Attachments

  • DecoHelperRevB.cs
    5.4 KB · Views: 38
  • DecoHelper [1.1].zip
    44.8 KB · Views: 54
  • DecoHelper[1.1]DecoToolNWallIndex.JPG
    DecoHelper[1.1]DecoToolNWallIndex.JPG
    132.7 KB · Views: 80
  • DecoHelper[1.1]WallIndex.JPG
    DecoHelper[1.1]WallIndex.JPG
    85.8 KB · Views: 90

A_Li_N

Knight
Interesting concept. If you have AIM or gTalk, I'd like to talk to ya bout it a bit more and maybe get ya a little more streamlined.
 
if you are still on... [email protected] msn messenger always on... would love to get streamlined, you wouldn't believe how long that took!!!! plus i realized, way to late mind you, that if i would have set the button id's to the item values and then told the thing that a string = buttonid then only did the command once, it would been ALOT easier.... same with item in gump.... but anyways, yes, please do message me, this is third or fourth day learning gumps, need more!
 
Top