Beispiel #1
0
 public Lumber(UO uO, string bankStoneID, string bankChestID, Rectangle bounds, Vector3 home, Vector3 forest, string ressStone = "OLUSJMD")
 {
     _timer = System.Diagnostics.Stopwatch.StartNew();
     this.UOD = uO;
     _curBounding = bounds;
     _bankChestID = bankChestID;
     _bankStoneID = bankStoneID;
     _home = home;
     _forest = forest;
     _ressStoneID = ressStone;
     //_curBounding = ;
     Vector3.impassables.Add(new Vector3(3588, 2407));
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            var UO = new uoNet.UO();

            if (!UO.Open(1))
            {
                Logger.I("UO.dll Unable to Connect to Game"); return;
            }                                                                     // Attempts to open UO.DLL and connect to client.
            Logger.I("uoNet Activated, Connected with CharName: " + UO.CharName); // All client variables can be accessed in this manner UO.VarName
            if (string.IsNullOrWhiteSpace(UO.CharName))
            {
                return;
            }
            Lumber script;

            //UO.SmartMove(new Vector3(550, 1009));
            if (UO.CharName.Equals("Gregor"))
            {
                script = new Lumber(UO, "HCUSJMD", "QBNFKMD", new Rectangle(420, 850, 200, 200), new Vector3(541, 993), new Vector3(550, 952), "ELUSJMD");
            }
            // moonglow gregor script = new Lumber(UO, "JCUSJMD", "QBNFKMD", new Rectangle(4384, 1132, 175, 140), new Vector3(4445, 1154), new Vector3(4441, 1184));
            else if (UO.CharName.Equals("Ansem"))
            {
                script = new Lumber(UO, "HCUSJMD", "OZQFKMD", new Rectangle(493, 975, 225, 225), new Vector3(541, 993), new Vector3(553, 1018), "ELUSJMD");
            }
            else if (UO.CharName.Equals("Maximoose"))
            {
                script = new Lumber(UO, null, "KTNEKMD", new Rectangle(1555, 2337, 225, 225), new Vector3(1609, 2435), new Vector3(1609, 2436));
            }
            else if (UO.CharName.Equals("Scully"))
            {
                script = new Lumber(UO, null, "KTNEKMD", new Rectangle(1555, 2437, 225, 225), new Vector3(1609, 2435), new Vector3(1609, 2436));
            }
            else
            {
                script = new Lumber(UO, "FCUSJMD", "DCUXJMD", new Rectangle(3322, 2344, 400, 400), new Vector3(3682, 2526), new Vector3(3682, 2526));
            }
            //var script = new Lumber(UO);
            script.Loop();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var UO = new uoNet.UO();

            if (!UO.Open(1)) { Logger.I("UO.dll Unable to Connect to Game"); return; } // Attempts to open UO.DLL and connect to client.
            Logger.I("uoNet Activated, Connected with CharName: " + UO.CharName); // All client variables can be accessed in this manner UO.VarName
            if (string.IsNullOrWhiteSpace(UO.CharName))
                return;
            Lumber script;
            //UO.SmartMove(new Vector3(550, 1009));
            if (UO.CharName.Equals("Gregor"))
                script = new Lumber(UO, "HCUSJMD", "QBNFKMD", new Rectangle(420, 850, 200, 200), new Vector3(541, 993), new Vector3(550, 952), "ELUSJMD");
            // moonglow gregor script = new Lumber(UO, "JCUSJMD", "QBNFKMD", new Rectangle(4384, 1132, 175, 140), new Vector3(4445, 1154), new Vector3(4441, 1184));
            else if (UO.CharName.Equals("Ansem"))
                script = new Lumber(UO, "HCUSJMD", "OZQFKMD", new Rectangle(493, 975, 225, 225), new Vector3(541, 993), new Vector3(553, 1018), "ELUSJMD");
            else if (UO.CharName.Equals("Maximoose"))
                script = new Lumber(UO, null, "KTNEKMD", new Rectangle(1760, 1237, 225, 225), new Vector3(1720, 1314), new Vector3(1770, 1329));
            else if (UO.CharName.Equals("Scully"))
                script = new Lumber(UO, null, "KTNEKMD", new Rectangle(1560, 1237, 225, 225), new Vector3(1720, 1314), new Vector3(1711, 1327));
            else
                script = new Lumber(UO, "FCUSJMD", "DCUXJMD", new Rectangle(3322, 2344, 400, 400), new Vector3(3682,2526), new Vector3(3682, 2526));
            //var script = new Lumber(UO);
            script.Loop();
        }
Beispiel #4
0
Datei: LJ.cs Projekt: Crwth/UOnet
 public void Start(Form1 form1, uoNet.UO UO)
 {
     this.form1 = form1;
     this.UO = UO;
     ScriptThread = new Thread(new ThreadStart(MainLoop));
     ScriptThread.Start();
 }
Beispiel #5
0
Datei: LJ.cs Projekt: Crwth/UOnet
 public Tree(int x, int y, int Z, int GraphicID, uoNet.UO UO)
 {
     // TODO: Complete member initialization
     this.X = (ushort)x;
     this.Y = (ushort)y;
     this.Z = (byte)Z;
     this.GraphicID = (short)GraphicID;
     this.UO = UO;
 }
Beispiel #6
0
        private static List<Vector3> FindPath(UO t, Vector3 start, Vector3 dest, int accuracy = 0)
        {
            /*Bitmap bmp = new Bitmap(6128, 4096);
             for (int x = 1000; x < 1750; x++)
             {
                 for (int y = 1555; y < 2444; y++)
                 {
                     var tile = new Vector3(x, y);
                     bmp.SetPixel(x, y, tile.IsPassable() ? Color.Green : Color.Red);
                 }
             }*/

            //Bitmap bmp = new Bitmap(6128, 4096);
            //todo weight less for diagonal
            // check diagonal move allowed.
            //var closedSet = new Vector3[6128,4096];
            var ClosedSet = new List<Vector3>();
            var OpenSet = new List<Vector3>();
            OpenSet.Add(start);

            Vector3 curNode = null;
            int cnt = 0;
            while (OpenSet.Count > 0 )
            {

                curNode = OpenSet.First();
                OpenSet.RemoveAt(0);
                ClosedSet.Add(curNode);
              //  bmp.SetPixel(curNode.X, curNode.Y, Color.Blue);
                if (curNode.Equals(dest))
                    break;
                var neighbours = GetNeighbours(curNode,dest);
                foreach(var n in neighbours)
                {

                    if (accuracy > 0)
                        if (n.Equals(dest))
                        {
                            OpenSet.Clear();
                            break;
                        }
                    //  closedSet[n.X, n.Y] == null
                    if (!n.IsPassable())
                        continue;
                    if (OpenSet.IndexOf(n) != -1)
                    {
                        var existing = OpenSet[OpenSet.IndexOf(n)];
                        if(existing.V > n.V)
                        {
                            OpenSet.Remove(existing);
                        }
                    }
                    if (ClosedSet.IndexOf(n) != -1)
                    {
                        var existing = ClosedSet[ClosedSet.IndexOf(n)];
                        if (existing.V > n.V)
                        {
                            ClosedSet.Remove(existing);
                        }
                    }

                    if (!ClosedSet.Contains(n) && !OpenSet.Contains(n) && n.IsPassable())
                    {
                        OpenSet.Add(n);
                    }
                }
                OpenSet.Sort();
                //closedSet[curNode.X, curNode.Y] = curNode;

                // if (ClosedSet.Count > 50000)
                //    return null;
                cnt++;
                //if (OpenSet.Count > 1000)
                //    OpenSet.RemoveRange(500, 1000);
                //bmp.Save("test.png", ImageFormat.Png);
                if (cnt > 15000)
                {
                //    bmp.Save("test.png", ImageFormat.Png);
                    return null;
                }

            }

            var resultPath = new List<Vector3>();
            //curnode is Start
            //Bitmap bmp = new Bitmap(4096, 4096);
            while (curNode != null)
            {
              //  bmp.SetPixel(curNode.X, curNode.Y, Color.GhostWhite);
                resultPath.Add(new Vector3(curNode.X, curNode.Y));
                curNode = curNode.P;
            }
               // bmp.Save("test.png", ImageFormat.Png);
            //bmp.Save("path.png", ImageFormat.Png);
            resultPath.Reverse();
            return resultPath;
        }
Beispiel #7
0
 public static int DistFromPlayer(UO uO, FoundItem mob)
 {
     return(Get2DDistance(uO.CharPosX, uO.CharPosY, mob.X, mob.Y));
 }
Beispiel #8
0
 public RailMiner(UO uO)
 {
     this.UOD = uO;
 }