예제 #1
0
 public override void Run()
 {
     if (ObjectManager.FreeBagSlots > 3)
     {
         StockadesContainer.done = false;
         Calls.DoString("ResetInstances();");
         StockadesContainer.doOncePerRun = true;
         Ingame.Tele(StockadesContainer.posZoneIn1, 60, true);
         Ingame.setCoords(StockadesContainer.posZoneIn2);
         while (StockadesContainer.isOutside && ObjectManager.FreeBagSlots > 3 && !Ingame.IsDc())
         {
             Thread.CurrentThread.Join(10);
         }
     }
     else
     {
         if (ObjectManager.isGhost)
         {
             Ingame.Tele(spiritHealerPos, 5, false);
             spiritHealer = ObjectManager.GetUnitByName("Spirit Healer");
             if (spiritHealer.baseAdd != 0)
             {
                 Calls.OnRightClickUnit(spiritHealer.baseAdd, 0);
                 Thread.CurrentThread.Join(250);
                 while (ObjectManager.isGhost && !Ingame.IsDc())
                 {
                     Calls.OnRightClickUnit(spiritHealer.baseAdd, 0);
                     Thread.CurrentThread.Join(500);
                     Calls.DoString("AcceptXPLoss();");
                     Thread.CurrentThread.Join(500);
                 }
             }
         }
         else
         {
             Ingame.Tele(StockadesContainer.posVendor, 60, false);
             vendor = ObjectManager.GetUnitByName(StockadesContainer.nameVendor);
             if (vendor.baseAdd != 0)
             {
                 Calls.OnRightClickUnit(vendor.baseAdd, 1);
                 if (Ingame.IsVendorFrameOpen())
                 {
                     Ingame.SellAll();
                 }
             }
         }
     }
 }
예제 #2
0
 internal static string process(string content)
 {
     lock (locker)
     {
         try
         {
             if (content == "coords")
             {
                 if (ObjectManager.isDeath || ObjectManager.isGhost || !returnCoords || Ingame.IsDc())
                 {
                     return("0|0|0");
                 }
                 else
                 {
                     Objects.UnitObject tmp = ObjectManager.PlayerObject;
                     return(tmp.Pos.x + "|" + tmp.Pos.y + "|" + tmp.Pos.z);
                 }
             }
             else
             {
                 string[] cont   = content.Split('|');
                 int      tmpNum = Convert.ToInt32(cont[0]);
                 guid = Convert.ToUInt64(cont[1]);
                 if (guid == ObjectManager.party1Guid)
                 {
                     if (num1 < tmpNum)
                     {
                         num1 = tmpNum;
                         if (cont[2] == "wait")
                         {
                             party1Ready = false;
                         }
                         else if (cont[2] == "resume")
                         {
                             party1Ready = true;
                         }
                         File.AppendAllText(@".\\socketLog.txt", DateTime.Now.ToString("HH:mm:ss") + " | Listener: Setting party 1 to " + cont[2] + Environment.NewLine);
                         return(cont[2]);
                     }
                 }
                 else if (guid == ObjectManager.party2Guid)
                 {
                     if (num2 < tmpNum)
                     {
                         num2 = tmpNum;
                         if (cont[2] == "wait")
                         {
                             party2Ready = false;
                         }
                         else if (cont[2] == "resume")
                         {
                             party2Ready = true;
                         }
                         File.AppendAllText(@".\\socketLog.txt", DateTime.Now.ToString("HH:mm:ss") + " | Listener: Setting party 2 to " + cont[2] + Environment.NewLine);
                         return(cont[2]);
                     }
                 }
                 else if (guid == ObjectManager.party3Guid)
                 {
                     if (num3 < tmpNum)
                     {
                         num3 = tmpNum;
                         if (cont[2] == "wait")
                         {
                             party3Ready = false;
                         }
                         else if (cont[2] == "resume")
                         {
                             party3Ready = true;
                         }
                         File.AppendAllText(@".\\socketLog.txt", DateTime.Now.ToString("HH:mm:ss") + " | Listener: Setting party 3 to " + cont[2] + Environment.NewLine);
                         return(cont[2]);
                     }
                 }
                 else if (guid == ObjectManager.party4Guid)
                 {
                     if (num4 < tmpNum)
                     {
                         num4 = tmpNum;
                         if (cont[2] == "wait")
                         {
                             party4Ready = false;
                         }
                         else if (cont[2] == "resume")
                         {
                             party4Ready = true;
                         }
                         File.AppendAllText(@".\\socketLog.txt", DateTime.Now.ToString("HH:mm:ss") + " | Listener: Setting party 4 to " + cont[2] + Environment.NewLine);
                         return(cont[2]);
                     }
                 }
             }
         }
         catch (Exception e)
         {
             File.AppendAllText(@".\\socketLog.txt", DateTime.Now.ToString("HH:mm:ss") + " | Listener Exception: " + e.ToString() + Environment.NewLine);
         }
         return("invalid");
     }
 }
예제 #3
0
        public override void Run()
        {
            if (!StockadesContainer.done && !ObjectManager.isDeath)
            {
                if (StockadesContainer.doOncePerRun)
                {
                    waitTollerance = 0;
                    Calls.DoString("ResetInstances()");
                }
                Thread.Sleep(250);
                List <Objects.GameObject> chestList = ObjectManager.GetGameObjectsByName("Large Solid Chest");
                int i = 0;
                while (i < chestList.Count)
                {
                    if (Ingame.IsDc())
                    {
                        return;
                    }
                    if (ObjectManager.FreeBagSlots >= 3)
                    {
                        if (chestList[i].baseAdd != 0)
                        {
                            if (chestList[i].Pos.differenceToPlayer() > 2)
                            {
                                Objects.Location tmpPos = new Objects.Location();
                                tmpPos.x = chestList[i].Pos.x;
                                tmpPos.y = chestList[i].Pos.y;
                                tmpPos.z = chestList[i].Pos.z - 4;
                                Ingame.Tele(tmpPos, 60, false);
                                waitTollerance = 0;
                            }
                            else
                            {
                                try
                                {
                                    int tmp = Environment.TickCount;
                                    Calls.OnRightClickObject(chestList[i].baseAdd, 1);
                                    Thread.CurrentThread.Join(1000);
                                    while (ObjectManager.PlayerObject.IsCasting != 0 && Environment.TickCount - tmp <= 8000)
                                    {
                                        Thread.CurrentThread.Join(10);
                                    }
                                    tmp = Environment.TickCount;
                                    while (Calls.IsLooting() == 1 && Environment.TickCount - tmp <= 1000)
                                    {
                                        Thread.CurrentThread.Join(10);
                                    }
                                    Console.WriteLine("WAITING");
                                    i++;
                                }
                                catch
                                {
                                    break;
                                }
                            }
                        }
                        else
                        {
                            waitTollerance += 1;
                            if (waitTollerance == 3)
                            {
                                StockadesContainer.done = true;
                                i = int.MaxValue;
                                break;
                            }
                        }
                    }
                    else
                    {
                        StockadesContainer.done = true;
                        i = int.MaxValue;
                        break;
                    }
                }
                StockadesContainer.done = true;
            }

            if (!ObjectManager.isDeath)
            {
                Ingame.KillPlayer();
                while (StockadesContainer.isInside && !Ingame.IsDc())
                {
                    Thread.CurrentThread.Join(10);
                }
            }
            else
            {
                Calls.DoString("RepopMe();");
            }
        }
예제 #4
0
        public override void Run()
        {
            if (firstBool)
            {
                tmpTimer = new cTimer(10000);
                while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0)
                {
                    Thread.CurrentThread.Join(100);
                }

                Ingame.BackToLogin();
                tmpTimer = new cTimer(10000);
                while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0)
                {
                    Thread.CurrentThread.Join(100);
                }
                firstBool = false;
                failTrys  = 0;
            }

            if (Ingame.IsDc())
            {
                if (ObjectManager.LoginState == "login")
                {
                    Calls.DoString("DefaultServerLogin('" + Data.AccName + "', '" + Data.AccPw + "');");

                    tmpTimer = new cTimer(600000);
                    while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0 && ObjectManager.LoginState == "login")
                    {
                        Thread.CurrentThread.Join(100);
                    }
                    failTrys = failTrys + 1;

                    if (failTrys >= 2)
                    {
                        firstBool = true;
                    }
                }

                if (ObjectManager.LoginState == "charselect")
                {
                    Calls.DoString("EnterWorld();");
                    EnterWorldTimer.Reset();
                    while (!EnterWorldTimer.IsReady() && ObjectManager.playerPtr == 0)
                    {
                        Thread.CurrentThread.Join(100);
                    }
                }
                gotDc = true;
            }
            else
            {
                if (ObjectManager.playerPtr != 0)
                {
                    Thread.CurrentThread.Join(3000);
                    Calls.SetMovementFlags(0);
                    gotDc     = false;
                    firstBool = true;
                    ObjectManager.ExecuteOnce = true;
                    ChatReader.ClearChat      = true;
                }
            }
        }