Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - slyone

Pages: [1] 2
1
Stealth archive / Why is profiles.dat a binary file?
« on: October 20, 2014, 06:40:05 PM »
I did a hexdump of profiles.dat and see a bunch of nulls in addition to the name of each of my profiles as well as a couple of the settings I chose for the profile.

Why is profiles.dat a binary file?

2
Stealth archive / Stealth Documentation
« on: October 04, 2014, 11:07:20 AM »
Over the years, the EasyUO wiki has been a valuable resource.

Stealth has similar wiki with a function list, usage descriptions, and tutorials.

Here are a few of the links:
Stealth Documentation by Category
Stealth Alphabetical Function Listing

The wiki is editable by any user when logged into the site.

There is also a Russian version of the references which I think is mostly synchronized with the English version:
Stealth Documentation by Category [Russian]
Stealth Alphabetical Function Listing [Russian]

As discussed in Vlek's post about the Stealth Python Reference, much of the documentation refers to the Pascal usage.  In some cases in the wiki, both the Pascal and Python versions of functions are shown.


3
Stealth archive / Question about Python tile functions
« on: January 19, 2014, 07:35:07 PM »
I read a couple posts about getting started with Stealth and they talked about writing a mining script as a start.  I set out to try and write a simple mining script using Python.  I found a couple examples in the Stealth forum which gave me something to start with.  But when I started testing my script, I noticed that all of my calls to functions referencing tile info were returning empty.  Then I took a look at Boydon's Python wrapper and saw the in the comments at the top:

Code: [Select]
# TO DO LIST:
# Tile wrapping is not complete yet. DO NOT USE THEM!

I take it that this comment goes for not only the wrapper but also the embedded Python in the Script.dll.  Anyone know if this is true?  If the tile functions are still in development then I'd definitely be interested in helping in any way I can.

Thanks,
S

4
My project builds fine and the first print statement prints "Begin" to the console but then an exception is thrown when I call:
Code: [Select]
Console.WriteLine("Hex value from ScriptDotNet:  {0:X}", Stealth.Script_GetSelfID());
The exception I get shows the following:
Quote
An unhandled exception of type 'System.TypeInitializationException' occurred in csSteathScripts.exe

Additional information: The type initializer for 'ScriptDotNet.Stealth' threw an exception.

I'm using VS2012 with .NET 4.5 and the latest ScriptDotNet.dll.

Is it something I am doing wrong? Has anyone else encountered this problem?

My Program.cs is below:

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ScriptDotNet;
using ScriptAPI;

namespace csSteathScripts
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Begin");
            Console.WriteLine("Hex value from ScriptDotNet:  {0:X}", Stealth.Script_GetSelfID());
            Console.WriteLine("Hex value from ScriptAPI:  {0:X}", Self.ID);
            Console.WriteLine("All done");
        }
    }
}



5
Stealth archive / How do you get a target cursor in Stealth?
« on: November 08, 2013, 07:34:13 PM »
In my easyuo scripts I like to use the cursor to get the ID of an item I plan to use.  An example of the code I usually use is:
Code: [Select]
set #TARGCURS 1
target ;wait 3s for target cursor to appear
; loop until the player targets an item
while #TARGCURS = 1
    wait 0
; save the id into %myvar
set %myvar #LTARGETID

How would you write similar code in Stealth?

6
Stealth archive / Clarification of TUIWindowType
« on: November 05, 2013, 06:48:10 PM »
What does wtCharProfile refer to?  I've provided some context below.

I see that there is an enum for TUIWindowType.  An example of where TUIWindowType is used is in the Container class in ScriptAPI.cs:

Code: [Select]
#region Container
public class Container : Item
{
    ...

    public void Close()
    {
         Stealth.Script_CloseClientUIWindow(TUIWindowType.wtContainer, _id);
    }
}
#endregion

The TUIWindowType includes
Code: [Select]
wtCharProfile, wtContainer, wtPaperdoll, wtStatus
wtContainer is used in the example above.

wtPaperdoll and wtStatus are pretty self explanatory.  I could close my paperdoll and my status bar by doing the following:

Code: [Select]
Stealth.Script_CloseClientUIWindow(TUIWindowType.wtPaperdoll, Stealth.Script_GetSelfID());
Stealth.Script_CloseClientUIWindow(TUIWindowType.wtStatus, Stealth.Script_GetSelfID());

So what does wtCharProfile refer to?

Thanks,
S

7
Stealth Snippets\Library / [V6.1.3, Python] Script Snippet
« 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.

Code: [Select]
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.


8
One of my co-workers showed me this website today. 

http://www.informationisbeautiful.net/visualizations/million-lines-of-code/

It's a visualization comparing the number of lines of code of various software projects.  My software engineering classes taught me not to use lines of code as a metric for software development but I thought the visualization was pretty interesting all the same.  Someone had to be misquoted for the last entry for 500 million lines of code.

9
Stealth archive / Documentation on FindTypesArrayEx?
« on: October 24, 2013, 06:29:04 PM »
I've been working through each of the functions in Orich's ScriptAPI.cs and am interested in the following FindItems() method:

Code: [Select]
        /// <summary>
        /// Searches for items of Types[], in Containers[], and of Colors[]
        /// </summary>
        /// <param name="Types">Array of Item Types to search for</param>
        /// <param name="Containers">Array of Containers to search in [new uint[] = {0x00000000};] for Ground</param>
        /// <param name="Colors">Array of Colors to search for [new ushort[] = { 0xFFFF };] for all colors</param>
        /// <param name="Recursive">[Optional] Search Sub-Containers Recursively [Default: False]</param>
        /// <returns>List of Items Found</returns>
        public static List<Item> FindItems(ushort[] Types, uint[] Containers, ushort[] Colors, bool Recursive = false)
        {
            Stealth.Script_FindTypesArrayEx(Types, Colors, Containers, Recursive);
            uint[] findlist = Stealth.Script_GetFindList();
            List<Item> AllList = new List<Item>();
            foreach (uint item in findlist)
                AllList.Add(new Item(item));
            return AllList;
        }

I'm not the most fluent in C# so if my questions/observations are wrong please correct me.

I see three FindItems methods in the Find class.
1)
Code: [Select]
public static Item FindItem(ushort Type, uint Container = 0x00000000, bool Recursive = false, ushort Color = 0xFFFF)  Purpose:  Return the last item found of the type specified.

2)
Code: [Select]
public static List<Item> FindItems(ushort Type, uint Container = 0x00000000, bool Recursive = false, ushort Color = 0xFFFF)  Purpose:  Returns the list of Item instances returned by GetFindedList().

3)
Code: [Select]
public static List<Item> FindItems(ushort[] Types, uint[] Containers, ushort[] Colors, bool Recursive = false)  Purpose: 
Quote
Searches for items of Types[], in Containers[], and of Colors[] - From Orich's Summary comment.

I think my understanding of the first two FindItems methods is solid but I can't find more documentation on the third.  From Orich's code in ScriptAPI.cs, a call is made to the function:
Code: [Select]
Stealth.Script_FindTypesArrayEx(Types, Colors, Containers, Recursive);
I can't find this function listed in the Stealth Doc:Api.

The first two methods have default values for Container, Color, and Recursive while the third handles Lists which, I guess, don't lend themselves to the default parameters of 0x0000, and 0xFFFF.  I found a suggestion on StackOverflow for passing an empty array as a default value.

Does anyone have anymore details on the Stealth.Script_FindTypesArrayEx() function?

When calling the Stealth.Script_FindTypesArrayEx() function, do I need to set the Container parameter to a list with the first entry as 0x0000 to search the ground and set the Color parameter to a list with the first entry of 0xFFFF to search all colors?

Thanks for the help, this code is awesome!

-S


NOTE:  I dowloaded ScriptAPI.cs from Orich's C# Tutorial.  If there is a more up to date version of it posted somewhere else please let me know.

10
First, thanks to Orich for putting the time in to make the awesome tutorials.

I thought it might be helpful to post some reference information concerning Visual Studio since Orich uses VS2012 in his tutorial.  Note:  I've mostly used Visual Studio Express editions for C++ projects in the past.  My first introduction to C# was from Orich's tutorial. 


Multiple Versions of Microsoft Visual Studio
Microsoft's Recommendation
I have run into issues in the past with compatibility of multiple Microsoft Visual Studio installations on my computer.  To avoid compatibility issues, I recommend following Microsoft's advice: 

Quote
We recommend that you install Visual Studio versions in the order in which they were released. For example, install Visual Studio 2010 before you install Visual Studio 2012. -http://msdn.microsoft.com/en-us/library/ms246609.aspx

.NET Compatibility
When I downloaded Orich's sample oRune code, I noticed that his solution was saved in VS2012.  Then I went back and read his post more closely and sure enough he lists the code as

oRune Project   oRune BitBucket Project    Full VS2012 Source Code

I tried to open the oRune solution file and it seemed like my computer just sat there and did nothing.  So I tried opening VS2010 and opening the solution file from the file->open menu and I was prompted that it was an incompatible file version.  Well I wasn't going to let Visual Studio stop me from getting started.  Visual Studio Solution and Project files are just text files so I opened the solution file up in Notepad++ and changed the version number from
Code: [Select]
Microsoft Visual Studio Solution File, Format Version 12.00to
Code: [Select]
Microsoft Visual Studio Solution File, Format Version 11.00This change tricks Visual Studio into thinking the solution file is a different version.  v11 corresponds to VS2010 while v12 corresponds to VS2012.

After that change, I was able to open the solution with VS2010.  Then I got a message stating that I did not have the .NET Framework 4.5 installed.  Again I double checked Orich's post but this time his post for the .NET dll.  Sure enough it requires .NET 4.5. 

Built on .NET 4.5 (Requires 4.5)

So I set out to figure out how to get .NET 4.5 installed.

I looked into downloading VS2012 and saw that it installs .NET Framework 4.5.  As a result of a couple Google searches on .NET framework compatilibity and VS2010 and VS2012, I found a good StackOverflow post discussing that very topic.  Basically, my understanding is that VS2010 can be compatible upgrading to .NET Framework 4.5 if you install VS2010 service pack 1.  I checked "Windows Update" for VS2010 SP1 and was able to update.  I also searched around and found a download for VS2012 Express edition along with its update.

After installing VS2012 with .NET Framework 4.5, I was able work through Orich's tutorial and get it working on my computer.

In summary:
1)  Installing multiple versions of Visual Studio on your computer can create compatibility issues.  These issues can be avoided if you follow the advice from Microsoft and install Visual Studio versions in the order of their release. 
2)  If you have VS2010 already and install VS2012, the .NET Framework 4.0 will be replaced by .NET Framework 4.5 and you will need to install VS2010 SP1 to make sure VS2010 can still see the .NET Framework 4.0.

Below are some helpful links to Visual Studio downloads:
2013 Express
2012 Express
2012 Express Update
2010 Express
2008 Express (C++)

For the Moderators:  If you think this post is in the wrong board please move it as you see fit.

11
Stealth archive / When you give Stealth a try...
« on: March 09, 2012, 04:25:56 PM »
First, thanks to Crome for all the information on Stealth!

I gave this a try over the weekend.  I read through Crome's info here,http://www.scriptuo.com/index.php?topic=9203.0 first.   I also checked out the links to the translated Stealth website that Crome referenced.

The client worked fine but when I went to log in with UO assist, I got the "Trouble communicating with UO" message.  I found out that the login.cfg file had been modified.  There were a couple files that were modified in my UO program folder.  So I replaced the modified files with the ones from my laptop and problem solved.  I don't think I read anywhere about Stealth changing the login.cfg file so make sure you keep a backup copy.


12
Script Debug / Problems creating a dynamic variable
« on: February 18, 2012, 06:41:27 AM »
I'm trying to create a variable name dynamically.  The test code I am using is below:

Code: [Select]
set %var1 10
set %var2 string

set % , %var1 , %var2 XXXXX

display % , %var1 , %var2
halt

I want the variable to be "%10string" and to have a value of XXXXX.  But when I use the display command it shows the string %10string rather than the value XXXXX. 

Can anyone help?

13
Crafting / Bulk Order Bribery
« on: February 13, 2012, 05:59:56 PM »
With the help of MeWon's Smith BOD Sorter-er, all of my BODs are sorted.  I'm always in need of powder of fort so I decided to try and upgrade the POF 20 bods to POF 90 bods.  I wrote this to automate the bribery process.  I made a menu and wrote up some instructions.  

You all at ScriptUO have really saved me tons of clicks, hopefully this will help save you some also!  Thanks!!

Updated to Version 1.1:  See the code snippet below for a list of updates.  I implemented the Upgrade Loop and hopefully fixed a couple bugs.  Let me know what you think.  Thanks!

Version 1.0 GUI

Uploaded with ImageShack.us

Version 1.1 GUI

Uploaded with ImageShack.us

Code: [Select]
;==========================================================
; Script Name: Bulk Order Bribery
; Author: slyone
; Version: 1.1
; Public Release: 02/13/2011
; Revision Date: 5-23-2012
; Purpose:  Upgrade BODs via bribery
; Instructions: -Fill up a BOD book with BODs you wish to
;                upgrade, this is the 'Full Book'
;               -Get another BOD book to put the upgraded
;                BODS into, this is the 'Empty Book'
;               -Have money in your bank
;               -Stand within two tiles of an NPC you can
;                bribe
;               -Bribe away
;==========================================================
; Version 1.1 Updates: -Modified logic with waiting for
;                       gumps
;                      -Hopefully fixed bug where the
;                       script closed your backpack
;                      -Added Upgrade Loop button that will
;                       loop bribery until bod book is
;                       empty or until vendor can no longer
;                       be bribed
;==========================================================
; Unresolved Issues: -BOD ghosting
;                    -Getting message "You must wait to
;                     perform another action."  when the
;                     script tries to drop a bod on the
;                     vendor
;==========================================================

14
There used to be a file you could delete in your UO folder to get rid of the startup video/image.  I think it has since changed.  Does anyone have a way to skip the startup image?


15
Crafting / Runebook Copier
« on: January 01, 2012, 06:39:01 PM »
I wrote and tested this over my holiday week.  I have been using it the past few days and it has worked great for me.

The setup is pretty easy.  The script doesn't automatically know the names you want for your runes so you'll have to hard code the names in the "SetRuneNames" sub-routine.  I commented out an example I used for my Tram Cities rune names.  Additionally, set the "%numRunes" variable to the number of runes in the book you want copied.

If you don't care what the runes are named then just set the rune names to #FALSE.  After you have hard coded the rune names, start up the script.  Use the menu to set your "runebook to copy" and your "empty runebooks" then press the start button!

The script will pause if you run out of runes.  If this happens, go buy more runes and return to the location where the script paused.  Then start it up again and it should continue where it left off.

I can't thank TM enough for the travel and casting subs.  They are awesome!  Thank you TM!  Thanks also to C2 for the menu tutorial!

Enjoy and reply with any comments.

Code: [Select]
;=================================================================
; Script Name: Runebook Copier
; Author: slyone
; Version: 1.0
; Public Release: 01/01/2012
; Purpose:  Make multiple copies of a runebook...
; Instructions: -Fill your pack full of runes and empty runebooks
;               -Get a runebook you want to copy.
;               -Hardcode the names of the runes in the
;                SetRuneNames sub-routine
;
; Acknowledgements: - Thanks TM for the Travel and Casting Subs!
;                   - Thanks C2 for the menu tutorial!
;=================================================================

Pages: [1] 2