ScriptUO
Scripting Resources & Utilities => Stealth Client => Stealth Snippets\Library => Topic started by: slyone on November 03, 2013, 07:59:49 PM
-
I haven't seen many Python script snippets using Stealth so I figured I'd post a simple example. Hopefully this helps other people who are getting into Stealth and want to use Python.
Below is a snippet that opens your character's backpack and then opens all of the backpacks within your characters backpack. Copy and paste the code into a text file with the .py extension. Then load it up in Stealth and run it.
import stealth
stealth.AddToSystemJournal("Begin")
#Open Backpack
backpackID = stealth.Backpack()
stealth.UseObject(backpackID)
stealth.Wait(1000)
#Find all backpacks within your backpack
backpackType = 0x0E75
allColors = 0xFFFF
# Search character backpack for backpacks of all colors, don't search recursively
stealth.FindTypeEx(backpackType, allColors, backpackID, False)
#Loop over all backpacks found and open them
result = stealth.GetFindedList()
stealth.AddToSystemJournal("Backpacks found:\t%d" %(stealth.FindCount()))
for bpID in result:
stealth.UseObject(bpID)
stealth.Wait(1000)
stealth.AddToSystemJournal("All Done")
I'm using Python 2.7 but this snippet should work in either Python 2.x or Python 3.x.
-
A new knowledge for me the best.