Author Topic: [Release] Stealth Python wrapper [UPDATED 2014-08-21]  (Read 20329 times)

0 Members and 1 Guest are viewing this topic.

Offline Vlek

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-03]
« Reply #15 on: August 06, 2014, 07:51:38 PM »
0
Link is broken.  :'(

Offline BoydonTopic starter

  • Moderator
  • **
  • *****
  • Posts: 76
  • Activity:
    0%
  • Reputation Power: 3
  • Boydon has no influence.
  • Respect: +16
  • Referrals: 0
    • View Profile
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-03]
« Reply #16 on: August 08, 2014, 04:54:52 PM »
0
Try again. :)
Member of the Stealth development team.

Offline Vlek

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-03]
« Reply #17 on: August 19, 2014, 06:44:08 PM »
0
I was reading through the wrapper, and you have an event persistence class that looks very, very intriguing. Is it possible to get a tut on how to use it? I am thinking about using something like that to do statistical data analysis.

Is it possible to use it to receive data such as damage (who damages who, the amount, etc), healing (same as damage), players showing up, players leaving, hiding, recall, etc, etc?

Offline BoydonTopic starter

  • Moderator
  • **
  • *****
  • Posts: 76
  • Activity:
    0%
  • Reputation Power: 3
  • Boydon has no influence.
  • Respect: +16
  • Referrals: 0
    • View Profile
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-03]
« Reply #18 on: August 21, 2014, 01:31:43 PM »
0
Wrapper is updated.

@Vlek
What exactly do you want to know? I am not sure if you want to know how to use it (see below) or why it has been done in that way (as you probably guess there is a reason behind ;)).
Anyway feel free to use my code as you like. :D

Here is a snippet that shows you how to use it (beware that it is untested! :P):

Code: [Select]
#!python2
from __future__ import print_function
import os
import sys
from py_stealth import *

#this only works if you freeze with cx_freeze
exe_name = os.path.basename(sys.executable)
print(exe_name)

StartStealthSocketInstance(exe_name)

def OnSpeech(text, senderName, senderID):
    AddToSystemJournal('[{}] {} has just said: {}'.format(senderID, senderName, text))

AddToSystemJournal('test')
SetEventProc('evSpeech', OnSpeech)
SetEventProc('evUnicodeSpeech', OnSpeech)

#20 seconds
for x in range(0, 401):
    Wait(50)

CorrectDisconnection()

To have a list of events and parameters, have a look here.
Member of the Stealth development team.

Offline Vlek

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-21]
« Reply #19 on: August 23, 2014, 08:04:53 AM »
0
Oooo, perfect. That's exactly what I was looking for. I was thinking I'd have to make my own event handler, but hopefully I can make a semi-veneer that'll make this easily callable for my statistical analysis module I'm trying to make. Thanks, man.

Offline Vlek

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-21]
« Reply #20 on: November 24, 2015, 09:36:06 AM »
0
I know it has been over a year, but I never was able to use the wrapper. I'm having significant, weird issues with stealth not liking my scripts that are entirely legal python code.

I understand I have to use something like cx_freeze to put these into executables, but, when I do that, I was getting a silent error that the script.dll wasn't included. I tried adding it into the archive file that gets generated with the executable in cx_freeze, but then it doesn't error out at all. It just runs the program forever in the background if I try to use it or run it through stealth.

I mean, I froze literally this for crying out loud:
Code: [Select]
import py_stealth as stealth
stealth.UOSay('Hello world!')

And it was playing forever without having put anything in game.

I guess what I'm asking is, can I get a brief tutorial on how to properly create an executable using this thing? I think that's where I'm messing up.

Offline Vlek

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: [Release] Stealth Python wrapper [UPDATED 2014-08-21]
« Reply #21 on: November 24, 2015, 02:34:28 PM »
0
Sorry! I figured it out on my own.

One thing though, it looks like your

On line 2259,
Code: [Select]
def FindTypeArrayEx(ObjTypes, Colors, Containers, InSub):
should be:
Code: [Select]
def FindTypesArrayEx(ObjTypes, Colors, Containers, InSub):

Tags: