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.


Messages - rwo001

Pages: 1 [2] 3
16
Stealth archive / Stealth 6.1.5
« on: December 08, 2013, 05:40:42 PM »
C# script cannot run after update to 6.1.5... :-X

17
Stealth archive / Re: Stealth.Script_FindType
« on: December 03, 2013, 12:01:24 AM »
sound good...looking for the update... ;D

18
Stealth archive / Re: Stealth.Script_FindType
« on: December 02, 2013, 11:17:31 PM »
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...

19
Stealth archive / Re: Stealth.Script_FindType
« on: December 02, 2013, 08:58:04 PM »
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();

20
Stealth archive / Re: Stealth.Script_FindType
« on: December 02, 2013, 04:05:54 PM »
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...

21
Stealth archive / Re: Stealth.Script_FindType
« on: December 02, 2013, 03:30:39 PM »
Yes ...careless mistake.. :P

22
Stealth archive / Re: How to use Script_GetPathArray (C#)
« on: December 02, 2013, 03:27:14 PM »
Its work. Thanks..

Sorry i don't use icq..and i think my time zone is different from you..i'm in GMT+8...
if you have skype, please add me : live:raywongsk

 ;)

23
Stealth archive / Stealth.Script_FindType
« on: December 02, 2013, 07:01:11 AM »
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.

24
Stealth archive / Re: How to use Script_GetPathArray (C#)
« on: December 01, 2013, 08:43:59 PM »
..It still have problem... :'(

// Current Position 1011,510;
TMyPoint[] _path = Stealth.Script_GetPathArray(1011, 508, false, 0);
Console.WriteLine(_path.Length);
for (uint i = 0; i < _path.Length; i++)
{
    Console.WriteLine(_path.X+","+_path.Y+","+_path.Z);
}
            
// Expected Output
2
1011,509,-70
1011,508,-70

// Real Output
2
1101,509,-3142
64515,47617,1011

25
Stealth Snippets\Library / Re: [C# Example] Events in Stealth
« on: November 30, 2013, 10:28:18 PM »
Do you use any Waits in your script? Because most events are only checked, when the script thread in stealth sleeps..

What? This isn't true at all for C#.

This is only true for Delphi.
Well you are right .. I remembered this from delphi.. Iam sorry..
So..Is it bug on ScriptDotNet or something wrong on the script?

26
Stealth archive / Re: How to use Script_GetPathArray (C#)
« on: November 30, 2013, 10:27:02 PM »
Nice to have someone testing out C# methods..  You are the first one to do it :)

These two functions :

Script_GetPathArray
and
Script_GetPathArray3D

I think they need a small fix in Stealth.exe.   I will update you ASAP
Oh..Thanks Orich.

I'm current working on convert my OpenEUO LUA code to C#.... :P

27
Stealth archive / How to use Script_GetPathArray (C#)
« on: November 30, 2013, 08:09:57 PM »
Code: [Select]
TMyPoint[] _path = Stealth.Script_GetPathArray(1011, 513, false, 0);
Console.WriteLine(_path.Length);
// Result : 0;
I can use Stealth.Script_MoveXY to move to the location but i can't get the path array..

28
Stealth Snippets\Library / Re: [C# Example] Events in Stealth
« on: November 29, 2013, 04:11:44 AM »
Ok..Thanks...

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


namespace Event
{
    class Event
    {
         
        static void OnBuff_Debuff(uint ID, ushort Attribute_ID, bool IsEnabled)
        {
            String buffStatus = (IsEnabled) ? "Turned On" : "Turned Off";
            String outputString = String.Format("Buff ID:{0} has just {1}", Attribute_ID, buffStatus);           
            Console.WriteLine(outputString);
        }

        private static void TimerCallback(Object o)
        {           
            Console.WriteLine("In TimerCallback: " + DateTime.Now);           
            GC.Collect();
        }


        static void Main(string[] args)
        {
            Console.WriteLine("Program Started");
            Stealth.OnBuff_DebuffSystemEvent += OnBuff_Debuff;
            Stealth.Script_EnableEvent(TPacketEvent.evBuff_DebuffSystem);
            Timer t = new Timer(TimerCallback, null, 0, 1000);
            Console.WriteLine("Waiting for event fire, Press any key to stop");           
            Console.ReadKey();
        }
    }
}

29
Stealth Snippets\Library / Re: [C# Example] Events in Stealth
« on: November 29, 2013, 02:53:51 AM »
i tried but still fail..

while (i< 100)
{
  Stealth.Script_Wait(1000);
  Console.WriteLine("Waiting...");
  i++;
}

30
Stealth Snippets\Library / Re: [C# Example] Events in Stealth
« on: November 28, 2013, 09:14:07 PM »
Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScriptDotNet;

namespace Event
{
    class Event
    {
        static void OnBuff_Debuff(uint ID, ushort Attribute_ID, bool IsEnabled)
        {
            String buffStatus = (IsEnabled) ? "Turned On" : "Turned Off";
            String outputString = String.Format("Buff ID:{0} has just {1}", Attribute_ID, buffStatus);

            Console.WriteLine(outputString);
        }

        static void OnTimer1()
        {
            Console.WriteLine("Timer 1 Event Fire");
        }

        static void OnTimer2()
        {
            Console.WriteLine("Timer 2 Event Fire");
        }
        static void OnSpeech(string str1,string str2, uint id)
        {
            Console.WriteLine("On Speech Event");
        }

        static void Main(string[] args)
        {
            Console.WriteLine("Program Started");
            Stealth.OnBuff_DebuffSystemEvent += OnBuff_Debuff;
            Stealth.Script_EnableEvent(TPacketEvent.evBuff_DebuffSystem);
            Stealth.OnTimer1Event += OnTimer1;
            Stealth.Script_EnableEvent(TPacketEvent.evTimer1);
            Stealth.OnTimer2Event += OnTimer2;
            Stealth.Script_EnableEvent(TPacketEvent.evTimer2);
            Stealth.OnSpeechEvent += OnSpeech;
            Console.WriteLine("Waiting for event fire, Press any key to stop");           
            Console.ReadKey();
        }
    }
}

I can fire Buff_Debuff Event but the Timer Event did not fire.....

 :-X :-X

Pages: 1 [2] 3