Exemple #1
0
 public static void OnTick(object sender, ElapsedEventArgs e)
 {
     if (Data.bot == true)
     {
         LoopControl.WalkScript();
     }
 }
Exemple #2
0
 static void repeat_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (i < count)
     {
         LoopControl.WalkScript();
     }
 }
Exemple #3
0
 public static void LoadTrainScript()
 {
     if (Data.bot)
     {
         if (Data.walkscriptpath != null | Data.walkscriptpath != "")
         {
             if (File.Exists(Data.walkscriptpath))
             {
                 try
                 {
                     LoopControl.read.Close();
                 }
                 catch { }
                 LoopControl.read  = new StreamReader(Data.walkscriptpath);
                 LoopControl.count = File.ReadAllLines(Data.walkscriptpath).Length;
                 LoopControl.WalkScript();
             }
             else
             {
                 Data.bot  = false;
                 Data.loop = false;
                 Globals.MainWindow.Content(Globals.MainWindow.startbot, "Start Bot");
                 Globals.MainWindow.UpdateLogs("Cannot Find WalkScript!");
             }
         }
         else
         {
             Data.bot  = false;
             Data.loop = false;
             Globals.MainWindow.Content(Globals.MainWindow.startbot, "Start Bot");
             Globals.MainWindow.UpdateLogs("Cannot Find WalkScript!");
         }
     }
 }
Exemple #4
0
 public static void NPCDeselect(Packet packet)
 {
     if (packet.ReadUInt8() == 1)
     {
         if (Data.loopaction == "storage" || Data.loopaction == "blacksmith" || Data.loopaction == "stable" || Data.loopaction == "accessory" || Data.loopaction == "potion")
         {
             Training.currentlyselected = 0;
             LoopControl.WalkScript();
         }
     }
 }
        public static void MergeItems()
        {
            List <string> mergetypewaiting = new List <string>();
            List <byte>   mergeslotwaiting = new List <byte>();

            Data.loopaction = "merge";
            for (int i = 0; i < Data.inventoryid.Count; i++)
            {
                System.Threading.Thread.Sleep(5);
                if (!Data.inventorytype[i].StartsWith("ITEM_CH") && !Data.inventorytype[i].StartsWith("ITEM_EU") && Data.inventoryslot[i] >= 13)
                {
                    if (Data.inventorycount[i] < Items_Info.items_maxlist[Items_Info.itemstypelist.IndexOf(Data.inventorytype[i])])
                    {
                        if (mergetypewaiting.IndexOf(Data.inventorytype[i]) != -1)
                        {
                            //There are another not merged same type item
                            //Merge IT
                            Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_INVENTORYMOVEMENT);
                            NewPacket.WriteUInt8(0);
                            NewPacket.WriteUInt8(Data.inventoryslot[i]);
                            NewPacket.WriteUInt8(mergeslotwaiting[mergetypewaiting.IndexOf(Data.inventorytype[i])]);
                            NewPacket.WriteUInt8((byte)Data.inventorycount[i]); // Count
                            NewPacket.WriteUInt8(0);
                            Proxy.ag_remote_security.Send(NewPacket);
                            break;
                        }
                        else
                        {
                            mergetypewaiting.Add(Data.inventorytype[i]);
                            mergeslotwaiting.Add(Data.inventoryslot[i]);
                        }
                    }
                }
                if (i + 1 >= Data.inventoryid.Count && Data.loop == true)
                {
                    LoopControl.WalkScript();
                }
            }
        }
Exemple #6
0
        public static void Start()
        {
            if (Data.bot)
            {
                type = Location.FindTown();
                switch (type)
                {
                case null:
                    Data.loopend = 0;
                    Data.loop    = false;
                    Data.bot     = false;
                    Globals.MainWindow.UpdateLogs("Train coordinates are not correct! Please set coordinates before training.");
                    Globals.MainWindow.Content(Globals.MainWindow.startbot, "Start Bot");
                    break;

                case "train":
                    if (Data.char_horseid == 0)
                    {
                        Data.loopend = 0;
                        Data.loop    = false;
                        Data.bot     = true;
                        PickupControl.there_is_pickable = true;
                        Buffas.buff_waiting             = true;

                        Globals.MainWindow.UpdateLogs("Start Botting!");
                        Globals.MainWindow.Content(Globals.MainWindow.startbot, "Stop Bot");

                        if (Globals.MainWindow.Checked(Globals.MainWindow.autoparty) == true)
                        {
                            Party.CreateParty();
                        }

                        LogicControl.Manager();
                    }
                    else
                    {
                        Data.loopaction = "dismounthorse";
                        Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_KILLHORSE);
                        NewPacket.WriteUInt32(Data.char_horseid);
                        Proxy.ag_remote_security.Send(NewPacket);
                    }
                    break;

                case "ch":
                    if (Globals.MainWindow.Checked(Globals.MainWindow.loop_off) == true)
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        if (Data.char_horseid == 0)
                        {
                            Data.loopaction = "mounthorse";
                            BotAction.MountHorse();
                        }
                        else
                        {
                            Data.loopend = 1;
                            StartLooping.LoadTrainScript();
                        }
                    }
                    else
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        LoopControl.read  = new StreamReader(@"Data/Scripts/ch_town.txt");
                        LoopControl.count = File.ReadAllLines(@"Data/Scripts/ch_town.txt").Length;
                        Data.loopend      = 0;
                        Data.loop         = false;
                        LoopControl.WalkScript();
                    }
                    break;

                case "wc":
                    if (Globals.MainWindow.Checked(Globals.MainWindow.loop_off) == true)
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        if (Data.char_horseid == 0)
                        {
                            Data.loopaction = "mounthorse";
                            BotAction.MountHorse();
                        }
                        else
                        {
                            Data.loopend = 1;
                            StartLooping.LoadTrainScript();
                        }
                    }
                    else
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        LoopControl.read  = new StreamReader(@"Data/Scripts/wc_town.txt");
                        LoopControl.count = File.ReadAllLines(@"Data/Scripts/wc_town.txt").Length;
                        Data.loopend      = 0;
                        Data.loop         = false;
                        LoopControl.WalkScript();
                    }
                    break;

                case "kt":
                    if (Globals.MainWindow.Checked(Globals.MainWindow.loop_off) == true)
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        if (Data.char_horseid == 0)
                        {
                            Data.loopaction = "mounthorse";
                            BotAction.MountHorse();
                        }
                        else
                        {
                            Data.loopend = 1;
                            StartLooping.LoadTrainScript();
                        }
                    }
                    else
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        LoopControl.read  = new StreamReader(@"Data/Scripts/kt_town.txt");
                        LoopControl.count = File.ReadAllLines(@"Data/Scripts/kt_town.txt").Length;
                        Data.loopend      = 0;
                        Data.loop         = false;
                        LoopControl.WalkScript();
                    }
                    break;

                case "ca":
                    if (Globals.MainWindow.Checked(Globals.MainWindow.loop_off) == true)
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        if (Data.char_horseid == 0)
                        {
                            Data.loopaction = "mounthorse";
                            BotAction.MountHorse();
                        }
                        else
                        {
                            Data.loopend = 1;
                            StartLooping.LoadTrainScript();
                        }
                    }
                    else
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        LoopControl.read  = new StreamReader(@"Data/Scripts/ca_town.txt");
                        LoopControl.count = File.ReadAllLines(@"Data/Scripts/ca_town.txt").Length;
                        Data.loopend      = 0;
                        Data.loop         = false;
                        LoopControl.WalkScript();
                    }
                    break;

                case "eu":
                    if (Globals.MainWindow.Checked(Globals.MainWindow.loop_off) == true)
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        if (Data.char_horseid == 0)
                        {
                            Data.loopaction = "mounthorse";
                            BotAction.MountHorse();
                        }
                        else
                        {
                            Data.loopend = 1;
                            StartLooping.LoadTrainScript();
                        }
                    }
                    else
                    {
                        try
                        {
                            LoopControl.read.Close();
                        }
                        catch { }
                        LoopControl.read  = new StreamReader(@"Data/Scripts/eu_town.txt");
                        LoopControl.count = File.ReadAllLines(@"Data/Scripts/eu_town.txt").Length;
                        Data.loopend      = 0;
                        Data.loop         = false;
                        LoopControl.WalkScript();
                    }
                    break;
                }
            }
        }