Ejemplo n.º 1
0
 public void Start()
 {
     if (GetIP != "0.0.0.0")
     {
         try
         {
             channel = new TcpChannel();
             ChannelServices.RegisterChannel(channel, false);
             string URI = "Tcp://" + this.GetIP + ":6600/MyCaptureScreenServer";
             obj = (ScreenCapture.ScreenCapture)Activator.GetObject(typeof(ScreenCapture.ScreenCapture), URI);
             byte[] buff = obj.UCGetDesktopBitmapBytes();
             if (alowString == 1)
             {
                 Config = obj.GetConfig(); getSize = obj.GetDesktopBitmapSize();
             }
             byte[]       tmp = ScreenCapture.QuickLZ.decompress(buff);
             MemoryStream ms  = new MemoryStream(tmp);
             pteScreenCapture.Image = Image.FromStream(ms);
             ChannelServices.UnregisterChannel(channel);
             runtime.Enabled = true;
         }
         catch
         {
             ResetPicture();
         }
     }
     else
     {
         runtime.Enabled = false;
         runtime.Dispose();
     }
     //Stop(); }
 }
Ejemplo n.º 2
0
        // Public method to get A screen rectangle as ASCII text where screen is cleaned before
        // recognition
        public static Image GetDesktopImage(int OCRSDK_ScrAx, int OCRSDK_ScrAy, int OCRSDK_ScrBx, int OCRSDK_ScrBy)
        {
            ScreenCapture.ScreenCapture sc = new ScreenCapture.ScreenCapture();
            // capture entire screen, and save it to a file
            Image img = sc.CaptureScreen();

            return(img);
        }
Ejemplo n.º 3
0
        void Start()
        {
            string URI = "Tcp://" + IP + ":6601/MyCaptureScreenServer";

            obj     = new ScreenCapture.ScreenCapture();
            channel = new TcpChannel();
            ChannelServices.RegisterChannel(channel, false);
            obj = (ScreenCapture.ScreenCapture)Activator.GetObject(typeof(ScreenCapture.ScreenCapture), URI);

            Runtime.Enabled = true;
        }
Ejemplo n.º 4
0
 public static void startListen()
 {
     StopListen();
     try
     {
         Channel = new TcpChannel(6601);
         ChannelServices.RegisterChannel(Channel, false);
         myScreen  = new ScreenCapture.ScreenCapture();
         objServer = RemotingServices.Marshal(myScreen, "MyCaptureScreenServer");
     }
     catch { }
 }
Ejemplo n.º 5
0
        private void frmRemoting_Load(object sender, EventArgs e)
        {
            //devMain.StopListen();
            try
            {
                URI  = "Tcp://" + this.IP + ":6600/MyCaptureScreenServer";
                chan = new TcpChannel();

                ChannelServices.RegisterChannel(chan, false);

                obj            = (ScreenCapture.ScreenCapture)Activator.GetObject(typeof(ScreenCapture.ScreenCapture), URI);
                conect         = true;
                timer1.Enabled = true;
            }
            catch { }
            // Start();
        }
Ejemplo n.º 6
0
 public static void StopListen()
 {
     try
     {
         if (objServer != null)
         {
             RemotingServices.Unmarshal(objServer);
         }
         if (myScreen != null)
         {
             RemotingServices.Disconnect(myScreen);
         }
         if (Channel != null)
         {
             ChannelServices.UnregisterChannel(Channel);
         }
         myScreen  = null;
         Channel   = null;
         objServer = null;
     }
     catch { }
 }
Ejemplo n.º 7
0
        //---------------------------------------------------------------------------------------------

        public ActionInfo NavstevnikHandle(out VisitorInfo visitor)
        {
            ActionInfo result = new ActionInfo();

            visitor = this.Visitors.LastVisitor;
            if (visitor != null && visitor.Character.Exist && visitor.Character.Distance < 10 && !UO.Dead)
            {
                VisitInfo visit = visitor.LastVisit;
                if (visit != null)
                {
                    if (!visit.Snaped)
                    {
                        visitor.Character.Click();
                        Game.Wait(250);
                        ScreenCapture.ScreenCapture capture = new ScreenCapture.ScreenCapture();
                        capture.snap((visitor.Name + String.Empty).Replace(" ", "_") + visit.VisitTime.ToString("yyyyMMdd_HHmmssfff"));
                        visit.Snaped = true;
                    }

                    if ((visitor.Character.Model == 0x0190 || visitor.Character.Model == 0x0191) && (visitor.Character.Notoriety == Notoriety.Murderer || visitor.Character.Notoriety == Notoriety.Criminal || visitor.Character.Notoriety == Notoriety.Enemy))//Toto male/ female
                    //hlasky dle deni doby atd.
                    {
                        if (!World.Player.Hidden)
                        {
                            if (visitor.KillCount > 0)
                            {
                                if (visit.Pruchod == 0)
                                {
                                    UO.Say("Jsi zpět krutý vrahu!");
                                    Game.Wait(3500);
                                    UO.Say("Přišel jsi opět zabít svou nebohou oběť, budiž... ");
                                    Game.Wait(500);
                                }
                                else if (visit.Pruchod == 1)
                                {
                                    UO.Say("Můj nebohý úděl je již po " + (visitor.KillCount + 1) + " skonat tvou rukou..");
                                    Game.Wait(6000);
                                    UO.Say("Nechť jsou k tobě bozi miloství ... za zlo které pácháš ...");
                                }
                            }
                            else if (visitor.Visits.Count > 1)
                            {
                                if (visit.Pruchod == 0)
                                {
                                    UO.Say("Zdravím tě můj největší ze zbojníků!!!");
                                    Game.Wait(3500);
                                    UO.Say("Jsem potěšen, že tvá velikost mě poctila svou návševou!!!");
                                    Game.Wait(500);
                                }
                                else if (visit.Pruchod == 1)
                                {
                                    UO.Say("Všem jsem již vylíčil tvojí hrůznost a velikost v boji!!!");
                                    Game.Wait(6000);
                                    UO.Say("Pouze ta slova, je naplňují hrůzou");
                                    Game.Wait(500);
                                }
                                else if (visit.Pruchod == 2)
                                {
                                    UO.Say("Věčná sláva tobě můj pane " + visitor.Name + "!!");
                                    //TODO
                                }
                            }
                            else
                            {
                                if (visit.Pruchod == 0)
                                {
                                    UO.Say("Aaaááááááá loupežník!!!");
                                    Game.Wait(3500);
                                    UO.Say("Vzdávam se *odhazuje sekyru*");
                                    Game.Wait(500);
                                    //Nastroj.DropHere();
                                }
                                else if (visit.Pruchod == 1)
                                {
                                    UO.Say("Prosím o slitovaní óóó všemocný nejrůznější vladce zdejších lesů..");
                                    Game.Wait(6000);
                                    UO.Say("Ušetři můj bídný nicotný život... můsím celý den stravit v lese... ");
                                    Game.Wait(6000);
                                    UO.Say("abych užvil/a svou rodinu...");
                                }
                                else if (visit.Pruchod == 2)
                                {
                                    UO.Say("Pokud mě ušetříš, budu šiřit slova o tvé hrůze a nepřemožitelnosti...");
                                    Game.Wait(6000);
                                    UO.Say("Óóó nejhruznější z nejhruznějších !!!");
                                    Game.Wait(2000);
                                }
                                else if (visit.Pruchod == 3)
                                {
                                    UO.Say("Věčná sláva tobě největší " + visitor.Name + "!!");
                                    //TODO
                                }
                            }

                            visit.Pruchod++;
                        }
                        else
                        {
                            Game.Wait();
                            UO.Print("Cekam v HIDU");
                        }
                        Game.Wait(3500);
                        result.Result = ActionResult.Continue;
                    }
                }
            }

            return(result);
        }