Example #1
0
        public BorrowResultClass Borrow(string personId, string name)
        {
            var list    = faceServiceClient.ListPersonsInPersonGroupAsync(PersonGroup);
            int counter = 0;

            for (; counter < COUNTER_MAX; counter++)
            {
                if (list.IsCompleted)
                {
                    break;
                }
                System.Threading.Thread.Sleep(100);
            }
            if (counter >= COUNTER_MAX)
            {
                var fail = new BorrowResultClass();
                fail.Result = false;
                return(fail);
            }

            if (personId == null)
            {
                var fail = new BorrowResultClass();
                fail.Result = false;
                return(fail);
            }
            Guid personGuid    = new Guid(personId);
            bool terminateFlag = true;

            foreach (var person in list.Result)
            {
                if (person.PersonId == personGuid)
                {
                    terminateFlag = false;
                    break;
                }
            }
            if (terminateFlag)
            {
                var fail = new BorrowResultClass();
                fail.Result = false;
                return(fail);
            }

            var json = @"
{ 
 ""jsonrpc"": ""2.0"", 
 ""id"":119,
 ""method"": ""invokefunction"",
 ""params"":[
           ""0x6b5ebaf00d5627c0f9014df6fa3ff1432ce2e4a9"",
           ""Write"",
           [""" + personId + @""", """ + name + @"""]]
}
";

            using (var client = new HttpClient())
            {
                var content = new StringContent(json, Encoding.UTF8, "application/json");
                var result  = client.PostAsync(WConfig.GetInstance()["NeoPrivateNetUrl"], content);

                // Todo: Save result into Azure Storage
            }

            var ret = new BorrowResultClass
            {
                Result = true
            };

            return(ret);
        }
Example #2
0
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            Chat.Print("<font color='#07667F'>Flipper's Morgana 1.1 Loaded Successfully</font> ");
            Chat.Print("<font color='#E11610'>Please Report Any Issues in the Thread.</font> ");


            if (User.ChampionName != "Morgana")
            {
                return;
            }
            Q = new Spell.Skillshot(spellSlot: SpellSlot.Q, spellRange: 1150, skillShotType: SkillShotType.Linear,
                                    castDelay: 250, spellSpeed: 1200, spellWidth: 70)
            {
                AllowedCollisionCount = 0
            };

            W = new Spell.Skillshot(spellSlot: SpellSlot.W, spellRange: 1000, skillShotType: SkillShotType.Circular,
                                    castDelay: 250, spellSpeed: 2200, spellWidth: 200)
            {
                AllowedCollisionCount = -1
            };

            E = new Spell.Targeted(SpellSlot.E, 800);

            R            = new Spell.Active(SpellSlot.R, 600);
            R.DamageType = DamageType.Magical;

            SpellList.Add(Q);
            SpellList.Add(W);
            SpellList.Add(E);
            SpellList.Add(R);


            MorganaMenu       = MainMenu.AddMenu("Morgana", "Morgana");
            QConfig           = MorganaMenu.AddSubMenu("QConfig");
            WConfig           = MorganaMenu.AddSubMenu("WConfig");
            ComboMenu         = MorganaMenu.AddSubMenu("ComboMenu");
            HarassMenu        = MorganaMenu.AddSubMenu("HarassMenu");
            LaneClearMenu     = MorganaMenu.AddSubMenu("LaneClearMenu");
            SpellsToShield    = MorganaMenu.AddSubMenu("SpellsToShield");
            BlackShieldAllies = MorganaMenu.AddSubMenu("BlackShieldAllies");
            DrawingsMenu      = MorganaMenu.AddSubMenu("Drawings");
            AutoMenu          = MorganaMenu.AddSubMenu("AutoRConfig");



            ComboMenu.Add("Q", new CheckBox("Use Q"));
            ComboMenu.Add("W", new CheckBox("Use W"));
            ComboMenu.Add("E", new CheckBox("Use E"));
            ComboMenu.Add("R", new CheckBox("Use R"));
            ComboMenu.Add("SpamW", new CheckBox("Spam W even if target can move?"));
            HarassMenu.Add("Q", new CheckBox("Use Q"));
            HarassMenu.Add("W", new CheckBox("Use W"));
            HarassMenu.Add("SpamW", new CheckBox("Spam W even if target can move?"));
            LaneClearMenu.Add("W", new CheckBox("Use W on minions"));
            AutoMenu.Add("Rcount", new Slider("Use R If Hit Enemy ", 3, 1, 5));
            LaneClearMenu.Add("minionCount", new Slider("Use W if hit minions ", 3, 1, 5));

            foreach (var Spell in SpellList)
            {
                DrawingsMenu.Add(Spell.Slot.ToString(), new CheckBox("Draw " + Spell.Slot));
            }

            foreach (AIHeroClient client in EntityManager.Heroes.Enemies)
            {
                QConfig.Add(client.ChampionName, new CheckBox("Q Enabled on" + client.ChampionName));
                WConfig.Add(client.ChampionName, new CheckBox("W Enabled on" + client.ChampionName));
                foreach (SpellInfo info in SpellDatabase.SpellList)
                {
                    if (info.ChampionName == client.ChampionName)
                    {
                        EnemyProjectileInformation.Add(info);
                    }
                }
            }

            foreach (AIHeroClient client in EntityManager.Heroes.Allies)
            {
                BlackShieldAllies.Add(client.ChampionName, new CheckBox("Shield" + client.ChampionName));
            }

            foreach (SpellInfo spell in EnemyProjectileInformation)
            {
                Console.WriteLine(spell.SpellName);
                SpellsToShield.Add(spell.MissileName, new CheckBox("Shield" + spell.MissileName));
            }

            Game.OnTick                  += Game_OnTick;
            Game.OnUpdate                += GameOnUpdate;
            Drawing.OnDraw               += Drawing_OnDraw;
            GameObject.OnCreate          += OnCreate;
            GameObject.OnDelete          += OnDelete;
            Obj_AI_Base.OnUpdatePosition += OnUpdate;
        }