Author Topic: Stealth Python Reference  (Read 6335 times)

0 Members and 1 Guest are viewing this topic.

Offline VlekTopic starter

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Stealth Python Reference
« on: August 19, 2014, 05:41:31 PM »
0
Can I get a reference for the built-in stealth functions for python? It's in pascal on the website, but that doesn't help too much.

Here's the pascal reference I'm talking about: http://stealth.od.ua/Doc:Manual/Reference

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Stealth Python Reference
« Reply #1 on: August 20, 2014, 12:31:12 AM »
0
Can I get a reference for the built-in stealth functions for python? It's in pascal on the website, but that doesn't help too much.

Here's the pascal reference I'm talking about: http://stealth.od.ua/Doc:Manual/Reference
they are the same. Its just that codesamples are in Pascal because the major use Pascal.

Offline Boydon

  • Moderator
  • **
  • *****
  • Posts: 76
  • Activity:
    0%
  • Reputation Power: 3
  • Boydon has no influence.
  • Respect: +16
  • Referrals: 0
    • View Profile
Re: Stealth Python Reference
« Reply #2 on: August 21, 2014, 02:11:04 PM »
0
As Chrome said, they are the same and when I had the chance I also added pythos samples.

Anyway you should have a look at the pydoc module, at the hep() built-in function, at the dir() built-in function and at the inspect module.

You can also output the list in the format you like with a snippet like this:

Code: [Select]
import stealth

stealth_funcs = [stealth.__dict__.get(func) for func in dir(stealth)]

for func in stealth_funcs:
    if callable(func):
        print (func.__doc__)

If you want to contribute, you can add Python samples where missing (as example refer to FindType).
« Last Edit: August 21, 2014, 02:18:56 PM by Boydon »
Member of the Stealth development team.

Offline VlekTopic starter

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: Stealth Python Reference
« Reply #3 on: August 23, 2014, 08:02:18 AM »
0
I really don't get why they'd choose to use pascal. The basic "stuffs" that are in a UO game, like items, mobiles, gumps, etc, are all objects that inherit from the basic "thing" or item class. It makes tons more damn sense to make classes and methods for them, and python is a very decent choice for doing so. Also, why would you have two of each function for player's/other mobile's status checks? Instead, why not have an IsPoisoned that defaults to the player when a serial isn't specified?

I'm currently working on converting the stealth semi-russian functions into intelligible classes with methods (going off of runuo internals to get as close to a server-side representation as possible) that more closely resemble the functionality and wordage of the built-in steam functions since they better fit with a western understanding of the words used for function names.

Thanks Boydon, I'll give that list a try and see if I can't finish this up.

Offline Boydon

  • Moderator
  • **
  • *****
  • Posts: 76
  • Activity:
    0%
  • Reputation Power: 3
  • Boydon has no influence.
  • Respect: +16
  • Referrals: 0
    • View Profile
Re: Stealth Python Reference
« Reply #4 on: August 23, 2014, 10:09:21 AM »
0
In my mind I have something really similar and somewhere on my HD i also have a draft for this. My problem is that i never have time to work on making stealth APIs more Pythonic. :)
Member of the Stealth development team.

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Stealth Python Reference
« Reply #5 on: August 23, 2014, 10:22:08 AM »
0

Offline slyone

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Stealth Python Reference
« Reply #6 on: August 24, 2014, 10:19:36 AM »
0
I really don't get why they'd choose to use pascal. The basic "stuffs" that are in a UO game, like items, mobiles, gumps, etc, are all objects that inherit from the basic "thing" or item class. It makes tons more damn sense to make classes and methods for them, and python is a very decent choice for doing so. Also, why would you have two of each function for player's/other mobile's status checks? Instead, why not have an IsPoisoned that defaults to the player when a serial isn't specified?

I'm currently working on converting the stealth semi-russian functions into intelligible classes with methods (going off of runuo internals to get as close to a server-side representation as possible) that more closely resemble the functionality and wordage of the built-in steam functions since they better fit with a western understanding of the words used for function names.

Thanks Boydon, I'll give that list a try and see if I can't finish this up.

Orich was working on a ScriptAPI in C# a while back.  He used it in his tutorial as a wrapper for the Stealth functions.  I haven't been keeping up with the .NET dll but here is the link to his bitbucket.org page for the source. 

Being able to use Python in Stealth is awesome.  A while ago, I was working on a Python version of the Orich's ScriptAPI.cs.  I might be wrong but it sounds like you are working on something similar.

You mentioned using the Stealth Documentation Manual.  Hopefully you are also referencing the API function list.  Some of the functions have some good examples and others just have the function prototype with a short description.

Anyways, hopefully some of these references help.
Started playing back at the Second Age

Tags: