Example #1
0
        static async Task Main(string[] args)
        {
            if (args.Length >= 3)
            {
                string url              = args[0];
                string outputPath       = args[1];
                int    recordingMinutes = int.Parse(args[2]);
                int    interval         = 1;
                int    fps              = 30;
                string username         = null;
                string password         = string.Empty;
                if (args.Length >= 7)
                {
                    interval = int.Parse(args[3]);
                    fps      = int.Parse(args[4]);
                    username = args[5];
                    password = args[6];
                }

                var result = await TimeLapse.GetAsync(url, outputPath, recordingMinutes * 60, interval, fps, username, password);

                System.Console.WriteLine($"result : {result ?? "convert failed"}");
            }
            else
            {
                Console.WriteLine($"usage : <url> <output_avi_path> <Recording minute> [interval = 1] [fps = 30] [Username] [Password]");
            }
        }
 private void LateUpdate()
 {
     if (CurPreview != -1)
     {
         SetCamOnPoint(SmoothCamPoints[CurPreview]);
     }
     if (Preview != null)
     {
         SetCamOnPoint(Preview);
     }
     if (this.takeHiResShot)
     {
         CameraPoint StartCP = new CameraPoint();
         StartCP.pos    = camera.transform.position;
         StartCP.rot    = camera.transform.rotation;
         camera.enabled = false;
         float LoadBias = QualitySettings.lodBias;
         QualitySettings.lodBias = Mathf.Infinity;
         ScriptableSingleton <UIAssetManager> .Instance.uiWindowFrameGO.enabled = false;
         if (this.followPath)
         {
             this.SetCamOnPoint(this.SmoothCamPoints[this.CurScreenShotCount]);
         }
         else
         {
             if (CamPoints.Count > 0)
             {
                 this.SetCamOnPoint(this.CamPoints[0]);
             }
         }
         float StartNear = camera.nearClipPlane;
         float StartFar  = camera.farClipPlane;
         camera.nearClipPlane = 0f;
         camera.farClipPlane  = 1600f;
         RenderTexture renderTexture = new RenderTexture(this.resWidth, this.resHeight, 24);
         this.camera.targetTexture = renderTexture;
         Texture2D texture2D = new Texture2D(this.resWidth, this.resHeight, TextureFormat.RGB24, false);
         this.camera.Render();
         RenderTexture.active = renderTexture;
         texture2D.ReadPixels(new Rect(0f, 0f, (float)this.resWidth, (float)this.resHeight), 0, 0);
         SetCamOnPoint(StartCP);
         camera.enabled            = true;
         this.camera.targetTexture = null;
         RenderTexture.active      = null;
         Destroy(renderTexture);
         byte[] bytes = texture2D.EncodeToPNG();
         string text  = TimeLapse.ScreenShotName(this.resWidth, this.resHeight, this.Path, CurScreenShotCount, Name);
         File.WriteAllBytes(text, bytes);
         Debug.Log(string.Format("Took screenshot to: {0}", text));
         Destroy(texture2D);
         QualitySettings.lodBias = LoadBias;
         camera.nearClipPlane    = StartNear;
         camera.farClipPlane     = StartFar;
         this.takeHiResShot      = false;
     }
 }
Example #3
0
 private void CombineWith(TimeLapse other)
 {
     if (!OverlapsWith(other))
     {
         return;
     }
     if (other.StartTime < StartTime)
     {
         StartTime = other.StartTime;
     }
     if (other.EndTime > EndTime)
     {
         EndTime = other.EndTime;
     }
 }
Example #4
0
    static void Main(string[] args)
    {
        handler = new ConsoleEventDelegate(ConsoleEventCallback);
        SetConsoleCtrlHandler(handler, true);

        FileHandler.OpenTitanHpList();
        FileHandler.OpenTitanFile(); //reset schedule on load or pull schedule file
        FileHandler.OpenSettings();  //get settings
        if (GlobalProperties.Token == "")
        {
            Console.WriteLine("Enter in your bot's token.");
            string getToken = Console.ReadLine();
            GlobalProperties.Token = getToken;
            FileHandler.SaveSettings();
        }
        TimeLapse.StartTimer();
        MainAsync(args).ConfigureAwait(false).GetAwaiter().GetResult();
    }
Example #5
0
        // Token: 0x060001BE RID: 446 RVA: 0x0000DEC0 File Offset: 0x0000C0C0
        private void OnDraw(EventArgs args)
        {
            TimeLapse timeLapse = this.TimeLapse;

            if (timeLapse == null || !timeLapse.CanBeCasted(true))
            {
                return;
            }
            Hero9   hero = base.Owner.Hero;
            Vector2 healthBarPosition = hero.HealthBarPosition;

            if (healthBarPosition.IsZero)
            {
                return;
            }
            float time   = Game.RawGameTime;
            float health = hero.Health;
            List <KeyValuePair <float, float> > list = (from x in this.healthTime
                                                        orderby x.Key
                                                        select x).ToList <KeyValuePair <float, float> >();
            float value = list.Find((KeyValuePair <float, float> x) => x.Key + 5f > time).Value;

            if (value <= health)
            {
                return;
            }
            float   num           = value / hero.MaximumHealth;
            Vector2 healthBarSize = hero.HealthBarSize;
            Vector2 vector        = healthBarPosition + new Vector2(0f, healthBarSize.Y * 0.7f) + this.killSteal.AdditionalOverlayPosition;
            Vector2 vector2       = healthBarSize * new Vector2(num, 0.3f) + this.killSteal.AdditionalOverlayPosition;

            Drawing.DrawRect(vector, vector2, Color.DarkOliveGreen);
            Drawing.DrawRect(vector - new Vector2(1f), vector2 + new Vector2(1f), Color.Black, true);
            float value2 = list.Find((KeyValuePair <float, float> x) => x.Key + 4f > time).Value;

            if (value2 < value)
            {
                float   num2    = (value - value2) / hero.MaximumHealth;
                Vector2 vector3 = healthBarSize * new Vector2(num2, 0.3f) + this.killSteal.AdditionalOverlayPosition;
                Vector2 vector4 = healthBarPosition + new Vector2(Math.Max(vector2.X - vector3.X, 0f), healthBarSize.Y * 0.7f) + this.killSteal.AdditionalOverlayPosition;
                Drawing.DrawRect(vector4, vector3, Color.LightGreen);
                Drawing.DrawRect(vector4 - new Vector2(1f), vector3 + new Vector2(1f), Color.Black, true);
            }
        }
    void Start()
    {
        rb = GetComponent <Rigidbody>();

        TimeLapse tl = new TimeLapse();

        tl.obj          = gameObject;
        tl.nextLapse    = 0;
        tl.currentLapse = 0;
        tl.timeArray    = new List <VecRot>();

        VecRot a = new VecRot();

        a.pos = tl.obj.transform.position;
        a.rot = tl.obj.transform.rotation;
        tl.timeArray.Add(a);

        ShootTest.lapses.Add(tl);
    }
Example #7
0
 public void onEnabled()
 {
     DC      = Camera.main.gameObject.AddComponent <TimeLapse>();
     DC.Path = Path;
     Debug.Log("TimeLapse Mod Enabled");
 }
Example #8
0
 public Hero3Camera TimeLapse(out TimeLapse timeLapse)
 {
     timeLapse = base.ExtendedSettings().TimeLapse;
     return(this);
 }
Example #9
0
 public async Task <Hero3Camera> TimeLapseAsync(TimeLapse timeLapse)
 {
     return(await base.PrepareCommand <CommandCameraTimeLapse>().Select(timeLapse).ExecuteAsync() as Hero3Camera);
 }
Example #10
0
 public Hero3Camera TimeLapse(TimeLapse timeLapse, bool nonBlocking = false)
 {
     return(ExecuteMultiChoiceCommand <CommandCameraTimeLapse, TimeLapse>(timeLapse, nonBlocking));
 }
Example #11
0
 private bool OverlapsWith(TimeLapse other)
 {
     return(other != null &&
            other.StartTime <= EndTime &&
            other.EndTime >= StartTime);
 }
    void Update()
    {
        if (!recalling && Input.GetKeyUp(KeyCode.R))
        {
            recalling = true;
            nextLapse = Time.time + 5;
        }

        if (recalling)
        {
            for (int i = 0; i < lapses.Count; i++)
            {
                TimeLapse lapse = lapses[i];

                lapse.obj.GetComponent <Rigidbody>().isKinematic = true;
                lapse.obj.GetComponent <Rigidbody>().velocity    = Vector3.zero;

                lapse.obj.transform.position = Vector3.MoveTowards(lapse.obj.transform.position, lapse.timeArray[lapse.currentLapse].pos, 0.01f);
                lapse.obj.transform.rotation = Quaternion.Lerp(lapse.obj.transform.rotation, lapse.timeArray[lapse.currentLapse].rot, 0.01f);

                if (Vector3.Distance(lapse.obj.transform.position, lapse.timeArray[lapse.currentLapse].pos) < 1)
                {
                    lapse.currentLapse = lapse.currentLapse + 1;
                }

                if (lapse.currentLapse > (lapse.timeArray.Count - 1))
                {
                    lapse.nextLapse    = 0;
                    lapse.currentLapse = 0;
                    lapse.timeArray.Clear();

                    VecRot a = new VecRot();
                    a.pos = lapse.obj.transform.position;
                    a.rot = lapse.obj.transform.rotation;
                    lapse.timeArray.Add(a);

                    lapse.obj.GetComponent <Rigidbody>().isKinematic = false;
                }
            }

            if (Time.time >= nextLapse)
            {
                for (int i = 0; i < lapses.Count; i++)
                {
                    TimeLapse lapse = lapses[i];
                    lapse.nextLapse    = 0;
                    lapse.currentLapse = 0;
                    lapse.timeArray.Clear();
                    VecRot a = new VecRot();
                    a.pos = lapse.obj.transform.position;
                    a.rot = lapse.obj.transform.rotation;
                    lapse.timeArray.Add(a);

                    lapse.obj.GetComponent <Rigidbody>().isKinematic = false;
                }

                recalling = false;
            }
        }
        else
        {
            if (Input.GetKeyUp(KeyCode.Space))
            {
                GameObject t = Instantiate(ball, transform.position, transform.rotation, null);
                t.transform.LookAt(towards);

                t.GetComponent <Rigidbody>().AddForce(transform.forward * speed, ForceMode.Impulse);
            }

            Quaternion q = transform.rotation;

            if (Input.GetKey(KeyCode.A))
            {
                q.eulerAngles = new Vector3(q.x, q.eulerAngles.y - 0.1f, q.z);
            }
            else if (Input.GetKey(KeyCode.D))
            {
                q.eulerAngles = new Vector3(q.x, q.eulerAngles.y + 0.1f, q.z);
            }

            transform.rotation = q;


            if (Time.time >= nextLapse)
            {
                nextLapse = Time.time + 1;

                foreach (TimeLapse lapse in lapses)
                {
                    VecRot a = new VecRot();
                    a.pos = lapse.obj.transform.position;
                    a.rot = lapse.obj.transform.rotation;
                    lapse.timeArray.Add(a);
                    Debug.Log(lapse.obj + " Added lapse. " + lapse.timeArray.Count);
                }
            }
        }
    }