Author Topic: Corpse Looting Help  (Read 7333 times)

0 Members and 1 Guest are viewing this topic.

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Corpse Looting Help
« on: March 28, 2015, 08:11:08 AM »
0
I'm really close to getting this program done but I've been stuck on getting the loot routine for a couple days now...

Does GetTooltip work correctly?  It either hangs the program or I get back a very odd-looking string of different names of items with odd characters.

Example: ""ded gorget7?\0\0\0studded sleeves8?\0\0\0studded leggings9?\0\0\r\0studded tunic:?\0\0\0studded leggings;?\0\0\r\0studded tunic<?\0\0\0studded sleeves=?\0\0\0studded gloves>?\0\0\0studded sleeves??\0\0\0studded le""



I looked at Crome696's SpeedLooter for example, GetCliloc no longer exists in ScriptDotNet2, so I'm assuming it was replaced by GetClilocByID.

GetCliocByID(item.ID) returns ""

Maybe I'm not doing something right?

Code: [Select]
Container lootContainer = new Container(corpse.ID);
lootContainer.Open();

List<Item> foundList = lootContainer.Inventory();

foreach (Item item in foundList)
{
if (lootTypes.Contains(item.Type))
{
response("Item found in list: " + item.Type);

string toolTip = Stealth.Default.GetTooltip(item.ID);

response("tooltip: " + toolTip);


//string itemProperties = Stealth.Default.GetClilocByID(item.ID);
//string toolTip = item.Tooltip;

//response("tooltip: " + item.Tooltip);
/*response("tooltip: " + item.Tooltip);
response("Properties: " + itemProperties);*/
}
}
« Last Edit: March 28, 2015, 08:24:14 AM by sibble »

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: Corpse Looting Help
« Reply #1 on: March 28, 2015, 09:33:10 AM »
0
I would go another turn. That looter is quiete antique.

You can get a TClilocRec Object by Stealth.Default.GetClilocRec().

The TClilocRec struct contains an array of TClilocItemRec wich has following Attributes :
ClilocID : uint , Params : Array of String.

Now you should know, any non custom input is solved by a localisation of data. This means within the cliloc.enu file is a Dictionary with the ClilocID as Key and the Text as value.
With uofiddler you can read out those values pretty easy.

Sample :

1060434 lower reagent cost ~1_val~%

~1_val~% indicates its an Integer Value and since its the only Parameter you can look into the Params[0] and convert them to integer.


So you could write a simple Property Attribute(like runuo) and allow an Update, wich set the predefined Properties like Attributes.LowerReagentCost to a value.

Later on you could do like if Attributes.LowerReagentCost >= 10 ....

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Corpse Looting Help
« Reply #2 on: March 28, 2015, 09:55:07 AM »
0
Does that translate through to .NET, Crome?  The dictionary/array information packed in Delphi didn't translate to anything but strings from the perspective of the .NET interface.  Granted I haven't tried any of the newer interface, but that was just about where I gave up on my own Stealth/.NET work.
Please read the ScriptUO site RULES
Come play RIFT with me!

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: Corpse Looting Help
« Reply #3 on: March 28, 2015, 11:03:14 AM »
0

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: Corpse Looting Help
« Reply #4 on: March 28, 2015, 11:58:09 AM »
0
I was unable to add Script.dll as a reference in Vistual Studio, not sure if I'm using it correctly?

Everything was done using ScriptDotNet2.dll and some helpers from ScriptAPI.cs

To give you an idea of where I'm at and what I'm doing, this is what my program looks like on Code Map (so far):



EDIT: So far everything works (except where I'm up to with looting) and it's REALLY fast, actually, I had to slow it down cause the speed at which it was running routines was just not needed.  That's a good thing though cause when it does stuff like evaluating loot it'll pretty much be instant (I'm expecting.)
« Last Edit: March 28, 2015, 01:00:07 PM by sibble »

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: Corpse Looting Help
« Reply #5 on: March 28, 2015, 12:00:30 PM »
0
I'm making a friend (cause I have none *sad face*) to follow me around and do combat with me, heal me, loot, etc.  and he'll be modular so anyone can add their own routine.  Eventually planning on making an app to handle multiple "friends," a web app to check on routine status and/or invoke routine methods (switching tasks) and possibly a mobile app (for fun.)

The code/structure of this program is pretty messy at the moment as I wanted to just see how far I could get with what was available to me.  So far I'm really happy :)  Will probably go back and re-structure my code when I'm done.

There are such monsters that exist in UO (official) that will drop more loot depending on how many people get looting rights.  I'm simply trying to get as many "friends" as possible to get loot rights.

I was contemplating on PVP routines but I really don't think that's what UO needs right now lol.  My buddy did challenge me to make a "friend" that could beat him in a mage duel.  Challenge was accepted.

EDIT: Also, each routine is ran in a separate thread (so my friend can heal me and evaluate loot at the same time.)  I'm planning on adding a job scheduler when I have multiple friends so that they can request jobs and not overlap each other.
« Last Edit: March 28, 2015, 12:11:59 PM by sibble »

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: Corpse Looting Help
« Reply #6 on: March 28, 2015, 01:03:16 PM »
0

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: Corpse Looting Help
« Reply #7 on: March 28, 2015, 02:02:23 PM »
0
Codemap: http://blogs.msdn.com/b/mvpawardprogram/archive/2013/11/08/code-maps-in-visual-studio-2013.aspx

When using Visual Studio, right click your project in the solution explorer and click "Show on Code Map"

Tags: