private void MainForm_Load(object sender, EventArgs e)
        {
            do
            {
                client = ClientChooser.ShowBox();
            } while (client == null && MessageBox.Show("Please select a Tibia client", "Notification", MessageBoxButtons.RetryCancel, MessageBoxIcon.Asterisk) == DialogResult.Retry);

            if (client == null)
            {
                Application.Exit();
                return;
            }
            else
            {
                screen = client.Screen;
                client.ContextMenu.AddContextMenu(1000, "Add as Ally", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1001, "Add as Enemy", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1002, "Show Item Id", ContextMenuType.LookContextMenu, true);
                client.ContextMenu.Click += new Tibia.Objects.ContextMenu.ContextMenuEvent(ContextMenu_Click);

                client.Icon.AddIcon(1, 20, 30, 64, 1841, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("ally", new Location(20, 84, 0), Color.LightBlue, ClientFont.NormalBorder, "Display/Hide Allies");
                client.Icon.AddIcon(2, 20, 110, 64, 9438, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("enemy", new Location(20, 164, 0), Color.Red, ClientFont.NormalBorder, "Display/Hide Enemies");

                client.Icon.Click += new Tibia.Objects.Icon.IconEvent(Icon_Click);
            }
        }
Exemple #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            ItemInfo.LoadItemsOtb();
            mapTiles     = new Dictionary <Location, OtMapTile>();
            mapCreatures = new Dictionary <Location, PacketCreature>();
            packetQueue  = new Queue <SplitPacket>();

            Reset();

            client = ClientChooser.ShowBox();

            if (client != null)
            {
                if (!useHookProxy && client.LoggedIn)
                {
                    MessageBox.Show("Using the proxy requires that the client is not logged in.");
                    Application.Exit();
                }
                else if (!useHookProxy)
                {
                    client.Exited += new EventHandler(Client_Exited);
                    client.IO.StartProxy();
                }
                Start();
            }
            else
            {
                MessageBox.Show("MapTracker requires at least one running client.");
                Application.Exit();
            }

            camLoader = new CamLoader(client, proxy, Log);
            minimap   = new MiniMap();
        }
Exemple #3
0
        private void loadClientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                var chooserOptions = new ClientChooserOptions();
                chooserOptions.Smart        = true;
                chooserOptions.ShowOTOption = false;
                chooserOptions.OfflineOnly  = true;

                var c = ClientChooser.ShowBox(chooserOptions);

                if (c != null)
                {
                    if (c.Version.OtbMajorVersion != otItems.MajorVersion || c.Version.OtbMinorVersion != otItems.MinorVersion)
                    {
                        Trace.WriteLine("[Warning] This client requires the version " + c.Version.OtbMajorVersion + "." + c.Version.OtbMinorVersion + " of items.otb.");
                    }

                    c.LoginServers = new LoginServer[] { new LoginServer("127.0.0.1", 7171) };
                    c.EnableProxy();
                    Client = c;
                    Trace.WriteLine("Client successfully loaded.");
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine("[Error] Unable to load tibia client. Details: " + ex.StackTrace.ToString());
            }
        }
 private void MainForm_Load(object sender, EventArgs e)
 {
     client = ClientChooser.ShowBox();
     if (client != null)
     {
         if (client.LoggedIn)
         {
             player = client.GetPlayer();
             uxMap.Markers.Add(new MapViewer.MapMarker(player));
         }
     }
 }
Exemple #5
0
        public Core(string clientChooserTitle, string mutexName, bool proxy, bool useWPF)
        {
            KeyboardHook.Enable();

            do
            {
                ClientChooserOptions clientChooserOptions = new ClientChooserOptions();
                clientChooserOptions.Title        = clientChooserTitle;
                clientChooserOptions.ShowOTOption = true;
                clientChooserOptions.OfflineOnly  = proxy;

                if (useWPF)
                {
                    Client = ClientChooserWPF.ShowBox(clientChooserOptions);
                }
                else
                {
                    Client = ClientChooser.ShowBox(clientChooserOptions);
                }

                if (Client != null)
                {
                    kedrahMutex = new Mutex(true, "Kedrah_" + mutexName + Client.Process.Id.ToString());

                    if (!kedrahMutex.WaitOne(0, false))
                    {
                        Client = null;
                        continue;
                    }

                    System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal;
                    Client.Process.Exited += new EventHandler(ClientClosed);

                    if (proxy)
                    {
                        Client.IO.StartProxy();
                        Proxy = Client.IO.Proxy;

                        Proxy.PlayerLogin  += new EventHandler(OnLogin);
                        Proxy.PlayerLogout += new EventHandler(OnLogout);
                    }
                    else
                    {
                        loginChecker.Execute += new Tibia.Util.Timer.TimerExecution(loginChecker_Execute);
                        loginChecker.Start();
                    }

                    Modules = new HModules(this);
                    Kedrah.Extensions.Core = this;
                }
            } while (Client == null);
        }
Exemple #6
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            Client = ClientChooser.ShowBox();
            if (Client == null || !Client.LoggedIn)

            {
                MessageBox.Show("You must have at least one client open and logged in.");
                Application.Exit();
            }
            else
            {
                Player = Client.GetPlayer();
            }
        }
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                string server = string.Empty;
                string port   = string.Empty;

                if (args.Length == 1)
                {
                    server = args[0];
                    port   = "7171";
                }
                else if (args.Length == 2)
                {
                    server = args[0];
                    port   = args[1];
                }
                else
                {
                    Application.Exit();
                }

                Client client = ClientChooser.ShowBox(new ClientChooserOptions()
                {
                    ShowOTOption = false
                });
                if (client == null)
                {
                    if (File.Exists("tibia.exe"))
                    {
                        client = Client.Open(Application.StartupPath + "\\tibia.exe");
                    }
                    else
                    {
                        client = Client.Open();
                    }
                    System.Threading.Thread.Sleep(1000);
                }
                client.Login.SetOT(server, short.Parse(port));
                return;
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MainForm());
            }
        }
Exemple #8
0
        private void Go()
        {
            Client client = ClientChooser.ShowBox(new ClientChooserOptions()
            {
                ShowOTOption = false, Smart = false
            });

            if (client == null)
            {
                client = Client.Open();
                System.Threading.Thread.Sleep(1000);
            }
            string[] split = uxServer.Text.Split(":".ToCharArray());
            client.Login.SetOT(split[0], short.Parse(split[1]));
            SaveServer(split[0], split[1], client.Version);
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            client = ClientChooser.ShowBox();

            if (client == null || !client.LoggedIn)
            {
                MessageBox.Show("You must have at least one client open and logged in to start this program.");
                Application.Exit();
            }
            else
            {
                rune            = RuneChooser.ShowBox();
                notifyIcon.Icon = new System.Drawing.Icon(GetType(), "icon.ico");
                start();
            }
        }
Exemple #10
0
 private void mBot_Load(object sender, EventArgs e)
 {
     cliente = ClientChooser.ShowBox();
     if (cliente == null || !cliente.LoggedIn)
     {
         MessageBox.Show("Você deve ter pelo menos um cliente aberto e conectado.");
         Application.Exit();
     }
     else
     {
         player            = cliente.GetPlayer();
         this.Text         = "MBot - " + player.Name + " (" + player.WorldName + ")";
         cliente.Statusbar = "MBot: Injetado com sucesso.";
         console           = new Tibia.Objects.Console(cliente);
     }
 }