Author Topic: Stealth.Script_FindType  (Read 5614 times)

0 Members and 1 Guest are viewing this topic.

Offline rwo001Topic starter

  • Jr. Member
  • **
  • Posts: 45
  • Activity:
    0%
  • Reputation Power: 1
  • rwo001 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Stealth.Script_FindType
« on: December 02, 2013, 07:01:11 AM »
0
Code: [Select]
Stealth.Script_SetFindDistance(2);
Stealth.Script_FindType(0xffff, 0x0000);
List<uint> _findlist = new List<uint>(Stealth.Script_GetFindList());
foreach (uint i in _findlist) { Console.WriteLine("{0:X}",i); }
Console.WriteLine("Total:{0}",_findlist.Count);
Console.ReadLine();

i found the result is different from i see in StealthUO as attached.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
FindType.png

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.Script_FindType
« Reply #1 on: December 02, 2013, 08:40:02 AM »
0
Can you keep sure, that no item on ground were moved? and Also the range isnt different to your view on World?


Offline Orich

  • Jr. Member
  • **
  • Posts: 77
  • Activity:
    0%
  • Reputation Power: 3
  • Orich has no influence.
  • Respect: +12
  • Referrals: 1
    • View Profile
Re: Stealth.Script_FindType
« Reply #2 on: December 02, 2013, 10:56:06 AM »
0
Notice the Z axis of the missing item is Z = -43

Chances are the vertical find distance threshold is too low to cover that item.  This is the distance between Self.Z and Item.Z

Stealth.Script_SetFindVeritcal(50); should cover it.
Member of the Stealth development team.
Author of Stealth .NET DLL

Offline rwo001Topic starter

  • Jr. Member
  • **
  • Posts: 45
  • Activity:
    0%
  • Reputation Power: 1
  • rwo001 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Stealth.Script_FindType
« Reply #3 on: December 02, 2013, 03:30:39 PM »
0
Yes ...careless mistake.. :P

Offline rwo001Topic starter

  • Jr. Member
  • **
  • Posts: 45
  • Activity:
    0%
  • Reputation Power: 1
  • rwo001 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Stealth.Script_FindType
« Reply #4 on: December 02, 2013, 04:05:54 PM »
0
Another question on Finding

Is anyway to find NPC faster?
Code: [Select]
                Stealth.Script_SetFindDistance(50);
                Stealth.Script_SetFindVertical(255);
                Stealth.Script_FindType(0xffff, 0x0);
                List<uint> _findlist = new List<uint>(Stealth.Script_GetFindList());               
                List<uint> _creature = new List<uint>();
                Console.WriteLine(DateTime.Now);               
                foreach (uint i in _findlist)
                {
                    // The problem seems in here..
                    if ( Stealth.Script_GetNotoriety(i) > 0 ){
                        _creature.Add(i);
                    }
                }
                Console.WriteLine(DateTime.Now);                 
                Console.WriteLine("Total NPC:{0}", _creature.Count);
                Console.WriteLine("Total FindItem:{0}", _findlist.Count);

It use 2 seconds to filter the result...

Offline rwo001Topic starter

  • Jr. Member
  • **
  • Posts: 45
  • Activity:
    0%
  • Reputation Power: 1
  • rwo001 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Stealth.Script_FindType
« Reply #5 on: December 02, 2013, 08:58:04 PM »
0
I found the function Stealth.Script_FindNotoriety().
But it seems only return uint and will not update Stealth.Script_GetFindList();

Code: [Select]
Stealth.Script_SetFindDistance(255);
Stealth.Script_SetFindVertical(255);

List<uint> _creature = new List<uint>();
for (byte i = 1; i <= 7; i++)
{
    Stealth.Script_FindNotoriety(0xffff, i);
    Console.WriteLine("Notoriety : {0} , Found : {1} , Found List : {2} ", i, Stealth.Script_GetFindCount(), Stealth.Script_GetFindList().Length);
}

Another problem...Cannot Use FindNotoriety to find Player Vendor
Code: [Select]
            uint _id = 0x01E42449;
            Console.WriteLine("Player Vendoer Notoriety : {0}", Stealth.Script_GetNotoriety(_id));
            Stealth.Script_FindNotoriety(Stealth.Script_GetType(_id), Stealth.Script_GetNotoriety(_id));
            Console.WriteLine("Find Notoriety Count : {0}", Stealth.Script_GetFindCount());

            _id = Stealth.Script_GetSelfID();
            Console.WriteLine("Self Notoriety : {0}", Stealth.Script_GetNotoriety(_id));
            Stealth.Script_FindNotoriety(Stealth.Script_GetType(_id), Stealth.Script_GetNotoriety(_id));
            Console.WriteLine("Find Notoriety Count : {0}", Stealth.Script_GetFindCount());
            Console.ReadLine();
« Last Edit: December 02, 2013, 09:22:05 PM by rwo001 »

Offline Orich

  • Jr. Member
  • **
  • Posts: 77
  • Activity:
    0%
  • Reputation Power: 3
  • Orich has no influence.
  • Respect: +12
  • Referrals: 1
    • View Profile
Re: Stealth.Script_FindType
« Reply #6 on: December 02, 2013, 10:38:25 PM »
0
Stealth.Script_IsNPC() would be easier to discern what is an NPC.


If you want speed, you will need to collect a list of valid types to search for.  I would suggest looking for old EasyUO scripts with the NPC types you are looking for, then converting them in Stealth or programatically via. Script_EUO2StealthType()


Hope that helps.
« Last Edit: December 02, 2013, 10:41:01 PM by Orich »
Member of the Stealth development team.
Author of Stealth .NET DLL

Offline rwo001Topic starter

  • Jr. Member
  • **
  • Posts: 45
  • Activity:
    0%
  • Reputation Power: 1
  • rwo001 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Stealth.Script_FindType
« Reply #7 on: December 02, 2013, 11:17:31 PM »
0
m...the main purpose of my function is used to find all creature in certain range.
in my openeuo script, i use it for auto attack all finditem with findrep 1,2,7..

Also, i found that if i use any Stealth.Script_GetXXXX [e.g. Stealth.Script_GetX(_id) ] in the loop..it consumes lots of time...It will not happen when I use Pascal script...

Offline Orich

  • Jr. Member
  • **
  • Posts: 77
  • Activity:
    0%
  • Reputation Power: 3
  • Orich has no influence.
  • Respect: +12
  • Referrals: 1
    • View Profile
Re: Stealth.Script_FindType
« Reply #8 on: December 02, 2013, 11:54:01 PM »
0
m...the main purpose of my function is used to find all creature in certain range.
in my openeuo script, i use it for auto attack all finditem with findrep 1,2,7..

Also, i found that if i use any Stealth.Script_GetXXXX [e.g. Stealth.Script_GetX(_id) ] in the loop..it consumes lots of time...It will not happen when I use Pascal script...


This is a problem with Stealth.exe ... Big changes in next release, and the performance issue will be fixed :)
Member of the Stealth development team.
Author of Stealth .NET DLL

Offline rwo001Topic starter

  • Jr. Member
  • **
  • Posts: 45
  • Activity:
    0%
  • Reputation Power: 1
  • rwo001 has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Stealth.Script_FindType
« Reply #9 on: December 03, 2013, 12:01:24 AM »
0
sound good...looking for the update... ;D

Tags: