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!

UO specific C# programming

randale

Sorceror
UO specific C# programming

I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.

I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
 

Jeff

Lord
randale said:
I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.
You would need a good c# book for the basics( Orielly's Learning C# ) then once you have the basics you can browse the docs that come with RunUO for the methods for each class. Also you can browse the scripts in the release section to see how things were done. I can just about gaurentee that anything you need to do has been done at least once somewhere.

randale said:
I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
as far as I know it would just check to see if the item still existed then if it didnt , find a new one. You do realize Scripting and Razor do not have anything in common :)
 

Courageous

Wanderer
All of the UO specific knowledge, of all the developers, comes from hunkering down and actually reading the code. Truly, I'm not kidding. The code is somewhat lacking in comments. This means you'll actually have to read for content. It's to the point where it serves a purpose, in a way: only people who are really willing to try very hard to understand the internals ever actually learn them. This prequalifes the limited number of individuals the core devs will likely interact with.

C//
 

randale

Sorceror
Sorious said:
You would need a good c# book for the basics( Orielly's Learning C# ) then once you have the basics you can browse the docs that come with RunUO for the methods for each class. Also you can browse the scripts in the release section to see how things were done. I can just about gaurentee that anything you need to do has been done at least once somewhere.

as far as I know it would just check to see if the item still existed then if it didnt , find a new one. You do realize Scripting and Razor do not have anything in common :)

Well, but you can edit razor to modify it, can't you?
 

mordero

Knight
randale said:
I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.

I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.

A razor macro could easily handle something like this. To make sure that I dont have to mess with double clickling new tools, my make last macro looks something like this

Double click the tool (by type)
wait for gump
click make last gump button
wait for gump
right click gump (close it)
wait 1 second

and then loop it, this will make sure that most of the time if your tool runs out of uses, then it will just find a new one. To make it a bit faster, right click on the wait for gumps and edit them to 5 or 10, that way it wont wait for the default 5 minutes if it cant find one.

And like Sorious said, Razor and RunUO scripting have nothing to do with eachother, so if you really wanted to write something of your own, you could write a program that uses Razor's API or use the Ultima SDK.
 

daat99

Moderator
Staff member
randale said:
I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.

I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
Let me ask you something.
If you were the guy that teach a baby how to walk, would you teach him how to walk on a specific floor or would you teach him how to walk in general?
For example:
Would you teach him how to walk on a black colored floor and than teach him how to walk on white colored floor and then or red colored floor.... etc?
Or would you simply teach him how to walk in general and he'll be able to walk in all the floors?

Personaly I support the "teach him how to walk in general" method myself.

What you asked us to do is to teach you "how to walk in a RunUO floor" instead of teaching you "how to walk".
Just so you understand the comparison better: walking ==> c#.
You can learn c# and know RunUO or you can learn RunUO and won't know anything at all.

RunUO related example:
You can learn how to change items hue or you can learn how to change object property.
If you learn how to change the hue than you don't know how to change the itemid and you need to learn it as well.
On the other hand if you learn how to change object property than you already know that item is an object and hue is a property as well as weight, itemid and tons of other properties items have.
And if you learn how to change an objects property than you also know how to change players guild, kill count, young status....
Player is an object as well and it have tons of properties.

I suggest that you start to read this c# book because it makes no sense to me to learn how to walk on specific floor each time instead of learning how to walk on every type of floor.
 

astrocreep2k

Wanderer
I couldn’t agree more. And here is another issue with code hackers (as I like to call them). Someone who does not truly understand the development platform, might find it very easy to modify things to there liking. The problem with this is:

A. They may break something without realizing it, since they do not fully understand how it relates to other things within the code. And in some cases the bugs can not be identified right away.

B. Without the ability to see the project as a whole, they create patched, non standardized code. If this gets into the code base, and allot of people contribute in this manner, it can make for some really ugly code and eventual design flaws.

Don't get me wrong. At one time I was a hacker, and I believe this process helped me learn what I know today. But I have seen a few other open source projects that quickly inherited major stability and scalability issues once more people became involved.

I guess all I am trying to say in this rant is, if you plan to contribute, learn the language, and make sure you understand the basics of how everything works. Simply changing values and adding snippets of code is not always the solution.

</EORANT>
 

Greystar

Wanderer
astrocreep2k said:
I couldn’t agree more. And here is another issue with code hackers (as I like to call them). Someone who does not truly understand the development platform, might find it very easy to modify things to there liking. The problem with this is:

A. They may break something without realizing it, since they do not fully understand how it relates to other things within the code. And in some cases the bugs can not be identified right away.

B. Without the ability to see the project as a whole, they create patched, non standardized code. If this gets into the code base, and allot of people contribute in this manner, it can make for some really ugly code and eventual design flaws.

Don't get me wrong. At one time I was a hacker, and I believe this process helped me learn what I know today. But I have seen a few other open source projects that quickly inherited major stability and scalability issues once more people became involved.

I guess all I am trying to say in this rant is, if you plan to contribute, learn the language, and make sure you understand the basics of how everything works. Simply changing values and adding snippets of code is not always the solution.

</EORANT>


your point B sounds like what happened with alot of MUDs
 

Sep102

Page
Zippy said:
Razor is 64 .cs files totaling 32,445 lines and 25 .c/.cpp/h files totaling 6,415 lines.

Written using only C/C++ or C++/CLI (or possibly Managed C++)? Just a bit curious.
 

Jeff

Lord
Zippy said:
Razor is 64 .cs files totaling 32,445 lines and 25 .c/.cpp/h files totaling 6,415 lines.
I know, but still my point stands :) it was written in c# mainly and not just C++
 

Sep102

Page
Zippy said:
Only C/C++. I hate managed C++.
I agree with you, Managed C++ was a joke. Thankfully it's been displaced by C++/CLI which doesn't seem too bad, at the very least, I could imagine much worse. If you haven't checked it out yet, I would recommend at least looking at it, they've changed a good deal of their original design from what I've heard and seen.
 

Sparkin

Sorceror
Nice Daat... I read that well and so wanna learn to walk...
Im still Crawling and loving your work and the work of others that have helped our shard run so nice...

Keep up the good works :)

Sparkin
 
Top