当前位置: 首页>>代码示例>>C#>>正文


C# LuaEventArgs类代码示例

本文整理汇总了C#中LuaEventArgs的典型用法代码示例。如果您正苦于以下问题:C# LuaEventArgs类的具体用法?C# LuaEventArgs怎么用?C# LuaEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LuaEventArgs类属于命名空间,在下文中一共展示了LuaEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GARRISON_MISSION_COMPLETE_RESPONSE

        private static void GARRISON_MISSION_COMPLETE_RESPONSE(object sender, LuaEventArgs args)
        {
            Diagnostic("LuaEvent: GARRISON_MISSION_COMPLETE_RESPONSE ");
            // Store the success of the mission
            if (args.Args[1].ToString() == "nil")
            {
                Diagnostic("GARRISON_MISSION_COMPLETE_RESPONSE: Received a failure.");
            }
            else
            {
                if (args.Args[0] == null)
                {
                    Warning("ERROR: Arg0 null in GARRISON_MISSION_COMPLETE_RESPONSE");
                }
                else
                {
                    var success = Lua.ParseLuaValue<Boolean>(args.Args[1].ToString());

                    var mission = MissionLua.GetCompletedMissionById(args.Args[0].ToString());
                    mission.Success = success;
                    if (success)
                    {
                        CacheCompletedList.Add(mission);
                    }
                    else
                    {
                        mission.PrintCompletedMission();
                    }
                }
            }
        }
开发者ID:aash,项目名称:GarrisonButler,代码行数:31,代码来源:GarrisonButler.cs

示例2: GARRISON_MISSION_BONUS_ROLL_COMPLETE

        private static void GARRISON_MISSION_BONUS_ROLL_COMPLETE(object sender, LuaEventArgs args)
        {
            Diagnostic("LuaEvent: GARRISON_MISSION_BONUS_ROLL_COMPLETE ");
            if (args.Args[1].ToString() == "nil")
            {
                Diagnostic("GARRISON_MISSION_BONUS_ROLL_COMPLETE: Received a failure.");
            }
            else
            {
                if (args.Args[0] == null)
                {
                    Warning("ERROR: Arg0 null in GARRISON_MISSION_BONUS_ROLL_COMPLETE");
                }
                else
                {
                    var idstring = args.Args[0].ToString();

                    var mission = CacheCompletedList.FirstOrDefault(m => m.MissionId == idstring);
                    if (mission != null)
                    {
                        mission.PrintCompletedMission();
                    }
                    else
                    {
                        Log("Unknown mission completed.");
                    }
                }
            }
        }
开发者ID:aash,项目名称:GarrisonButler,代码行数:29,代码来源:GarrisonButler.cs

示例3: HandleTalentPointsChanged

        private void HandleTalentPointsChanged(object sender, LuaEventArgs args)
        {
            if (!HasLearnedMajorTree)
                SelectMajorTalentTree(_talentBuild.Specialization);

            var learned = BuildLearnedTalentDictionary();
            var wanted = GetCurrentSpecTalentPlacements();

            int numAvailable = Lua.GetReturnVal<int>("return GetUnspentTalentPoints()", 0);

            foreach (var tp in wanted)
            {
                if (numAvailable == 0)
                    continue;

                var lt = learned.FirstOrDefault(t => (t.Name == tp.Name) || (t.Index == tp.Index && t.Tab == tp.Tab));

                int numLearned = 0;

                if (lt != null)
                    numLearned = lt.Count;

                while (numAvailable != 0 && numLearned < tp.Count)
                {
                    LearnTalent(tp.Tab, tp.Index);
                    numLearned++;
                    numAvailable--;
                }
            }

            Lua.DoString("LearnPreviewTalents()");
        }
开发者ID:naacra,项目名称:wowhbbotcracked,代码行数:32,代码来源:Talented.cs

示例4: HandleDungeonInvite

 public static void HandleDungeonInvite(object sender, LuaEventArgs args)
 {
     if (AutoAcceptDungeon)
     {
         FTWLogger.log(Color.SandyBrown, "Accepting dungeon invite");
         Lua.DoString("AcceptProposal()");
     }
 }
开发者ID:psmyth1,项目名称:code-samples,代码行数:8,代码来源:DungeonWatcher.cs

示例5: HandleDungeonDone

 public static void HandleDungeonDone(object sender, LuaEventArgs args)
 {
     // Done with dungeon
     if (AutoQueueDungeon)
     {
         Thread.Sleep(60000);
         Lua.DoString("LeaveParty()");
     }
 }
开发者ID:psmyth1,项目名称:code-samples,代码行数:9,代码来源:DungeonWatcher.cs

示例6: HandlePlayerDead

        private static void HandlePlayerDead(object sender, LuaEventArgs args)
        {
            // Since we hooked this in ctor, make sure we are the selected CC
            if (RoutineManager.Current.Name != SingularRoutine.Instance.Name)
                return;

            if (StyxWoW.Me.IsAlive || StyxWoW.Me.IsGhost)
                return;

            List<string> hasSoulstone = Lua.GetReturnValues("return HasSoulstone()", "hawker.lua");
            if (hasSoulstone != null && hasSoulstone.Count > 0 && !String.IsNullOrEmpty(hasSoulstone[0]) && hasSoulstone[0].ToLower() != "nil")
            {
                if (MovementManager.IsMovementDisabled )
                {
                    Logger.Write(Color.Aquamarine, "Suppressing {0} behavior since movement disabled...", hasSoulstone[0]);
                    return;
                }

                const int RezMaxMobsNear = 0;
                const int RezWaitTime = 10;
                const int RezWaitDist = 20;
                WaitTimer waitClearArea = new WaitTimer(TimeSpan.FromSeconds(RezWaitTime ));
                waitClearArea.Reset();
                Logger.Write(Color.Aquamarine, "Waiting up to {0} seconds for clear area to use {1}...", RezWaitTime , hasSoulstone[0]);
                int countMobs;
                do
                {
                    countMobs = (from u in Unit.NearbyUnfriendlyUnits where u.Distance < RezWaitDist select u).Count();
                } while (countMobs > RezMaxMobsNear && !waitClearArea.IsFinished && !StyxWoW.Me.IsAlive && !StyxWoW.Me.IsGhost);

                if (StyxWoW.Me.IsGhost)
                {
                    Logger.Write(Color.Aquamarine, "Insignia taken or something else released the corpse");
                    return;
                }

                if (StyxWoW.Me.IsAlive)
                {
                    Logger.Write(Color.Aquamarine, "Ressurected by something other than Singular...");
                    return;
                }

                if (countMobs > RezMaxMobsNear )
                {
                    Logger.Write(Color.Aquamarine, "Still {0} enemies within {1} yds, skipping {2}", countMobs, RezWaitDist, hasSoulstone[0]);
                    return;
                }

                Lua.DoString("UseSoulstone()");
                StyxWoW.SleepForLagDuration();
            }
            else
            {

            }
        }
开发者ID:superkhung,项目名称:SingularMod3,代码行数:56,代码来源:SoulstoneManager.cs

示例7: UpdateGear

        private static void UpdateGear(object sender = null, LuaEventArgs args = null)
        {
            EquippedGear.Clear();

            for (uint i = 0; i < 18; i++)
            {
                var slotInfo = StyxWoW.Me.Inventory.GetItemBySlot(i);

                if (slotInfo != null)
                    EquippedGear.Add(slotInfo.ItemInfo.Id);
            }
        }
开发者ID:jodysaliba,项目名称:ret_cr,代码行数:12,代码来源:Inventory.cs

示例8: AuctionPageShown

 private void AuctionPageShown(object sender, LuaEventArgs args)
 {
     Lua.Events.DetachEvent("AUCTION_ITEM_LIST_UPDATE", AuctionPageShown);
     var count = Lua.GetReturnVal<int>("return GetNumAuctionItems(\"list\")", 1);
     Pages = Convert.ToInt32(Math.Ceiling((double) count/50));
     if (_searching)
     {
         _searching = false;
         var results = new PageShownArgs();
         PageShown(results);
     }
 }
开发者ID:ricardochaves,项目名称:MasterControl,代码行数:12,代码来源:SearchQuery.cs

示例9: PlayerDeadEventHandler

        public static void PlayerDeadEventHandler(object sender, LuaEventArgs args)
        {
            Utils.Log("************************* PLAY-YA DE-EDD");

            foreach (object arg in args.Args)
            {
                if (!(arg is String)) continue;
                var s = (string)arg;
                Utils.Log("*********************[PLAYED DEAD EVENT FIRED]**************************");
                Utils.Log(s);
                Utils.Log("*********************[PLAYED DEAD EVENT ENDED]**************************");

            }
        }
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:14,代码来源:CC.cs

示例10: CombatLogEvent

        public CombatLogEvent(LuaEventArgs eventArgs)
        {
            EventType = eventArgs.EventName;

            BaseArgs = new CombatLogEventBaseArgs
            {
                TimeStamp = Convert.ToInt32(eventArgs.Args[0]),
                Event = Convert.ToString(eventArgs.Args[1]),
                SourceUnitId = UnitManager.GuidToUnitId((string) eventArgs.Args[3]),
                SourceName = Convert.ToString(eventArgs.Args[4]),
                DestinationUnitId = UnitManager.GuidToUnitId((string) eventArgs.Args[7]),
                DestinationName = Convert.ToString(eventArgs.Args[8])
            };
        }
开发者ID:Lbniese,项目名称:PawsPremium,代码行数:14,代码来源:CombatLogEvent.cs

示例11: BNWhisper

        public void BNWhisper(object sender, LuaEventArgs args)
        {
            object[] Args = args.Args;
            string Message = Args[0].ToString();
            string presenceId = Args[12].ToString();
            string Author = Lua.GetReturnValues(String.Format("return BNGetFriendInfoByID({0})", presenceId))[3];

            if (File.Exists(Rarekiller.Settings.SoundfileWisper))
                new SoundPlayer(Rarekiller.Settings.SoundfileWisper).Play();
            else if (File.Exists(Rarekiller.Soundfile))
                new SoundPlayer(Rarekiller.Soundfile).Play();
            else
                Logging.Write(System.Drawing.Color.Red, "Rarekiller Part Alert: playing Soundfile failes");
            Logging.Write(System.Drawing.Color.Aqua, "Rarekiller Part Alert: You got a BN Wisper: {0}: {1} - Timestamp: {2}: {3}", Author, Message, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString());
        }
开发者ID:swypemaster,项目名称:saintsorsinners,代码行数:15,代码来源:RarekillerSecurity.cs

示例12: CombatLogHandler

 public void CombatLogHandler(object self, LuaEventArgs args)
 {
     if (CombatLogEvent.GetEvent(args) != "SPELL_CAST_SUCCESS") return;
     //Log.GUI(string.Format("0:{0}, 1:{1}, 2:{2}, 3:{3}, 4:{4}, 5:{5}, 6:{6}, 7:{7}",
     //    args.Args[0], args.Args[1], args.Args[2], args.Args[3], args.Args[4], args.Args[5], args.Args[6], args.Args[7]));
     var combatLogEvent = new SpellCastSuccess(args);
     if (combatLogEvent.SpellName != "Rake" || combatLogEvent.BaseArgs.SourceUnitId != Me.GetUnitId())
         return;
     if (MyCurrentTarget != null &&
         (MyCurrentTarget.GetUnitId() == combatLogEvent.BaseArgs.DestinationUnitId))
     {
         // Added this routine to catch instances of rake casts that the user may have initiated so that rolling
         // bleed modifiers are properly applied.
         SnapshotManager.Instance.AddRakedTarget(MyCurrentTarget, true);
     }
 }
开发者ID:Lbniese,项目名称:PawsPremium,代码行数:16,代码来源:Events.cs

示例13: HandleLootClosed

        private void HandleLootClosed(object sender, LuaEventArgs e)
        {
            try
            {

                if (!TreeRoot.IsRunning)
                    return;

                if (ObjectManager.Me.Combat || ObjectManager.Me.Dead || ObjectManager.Me.IsGhost)
                    return;

                if (Battlegrounds.IsInsideBattleground)
                    return;

                DoCheck();
            }
            catch (Exception ex)
            {
                Styx.Helpers.Logging.WriteException(ex);
            }
        }
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:21,代码来源:AutoEquip.cs

示例14: ACTIVE_TALENT_GROUP_CHANGED

 // ACTIVE_TALENT_GROUP_CHANGED Event - Complete 08/08/2012 - CoDeRs (IMO)
 public void ACTIVE_TALENT_GROUP_CHANGED(object sender, LuaEventArgs args)
 {
     try
     {
         try
         {
             string sCommandCheck = SQLConnector.SendJSON("[{\"TAB\":\"TABToons\"},{\"nToonId\":\"" + WatchMyToon.nToonId + "\"},{\"szCurrentSpec\":\"" + UnitFunctions.getSpec() + "\"}]", "{\"Query\":\"Update\"}", "{\"Limit\":\"0\"}");
             Logging.Write(LogLevel.Verbose, Colors.Orange, "[WatchMyToon] - Talent Update Report: " + sCommandCheck);
         }
         catch (Exception ex)
         {
             Logging.Write(LogLevel.Normal, Colors.Red, "[WatchMyToon] - ACTIVE_TALENT_GROUP_CHANGED SQL Failed!");
             Logging.Write(LogLevel.Diagnostic, Colors.Red, "[WatchMyToon] - " + ex);
         }
     }
     catch (Exception ex)
     {
         Logging.Write(LogLevel.Normal, Colors.Red, "[WatchMyToon] - ACTIVE_TALENT_GROUP_CHANGED LUA Failed!");
         Logging.Write(LogLevel.Diagnostic, Colors.Red, "[WatchMyToon] - " + ex);
     }
 }
开发者ID:CoDeRs0880,项目名称:WatchMyToon_Plugin,代码行数:22,代码来源:Functions_LuaEvents.cs

示例15: LuaMessage

        // Parses the current battle round from a log event as there
        // is no other way to get it from the game
        public static void LuaMessage(object sender, LuaEventArgs args)
        {
            string msg = args.Args[0].ToString();
            string regex = "";

            switch(_locale) {
                case "frFR":
                case "esES":
                case "esMX":
                case "itIT":
                case "koKR":
                case "ptBR":
                case "ruRU":
                case "zhCN":
                case "zhTW":
                    break;

                case "deDE":
                    regex = @"Runde\s(\d*)";
                    break;

                case "enGB":
                case "enUS":
                default:
                    regex = @"Round\s(\d*)";
                    break;
            }

            if(regex == "")
                return;

            Match match = Regex.Match(msg, @"Round\s(\d*)");

            if (match.Success)
            {
                string roundStr = match.Groups[1].Value;
                int round = Convert.ToInt32(roundStr);
                Battle.SetRoundFromLog(round);
            }
        }
开发者ID:toliman,项目名称:Prosto_Pets,代码行数:42,代码来源:BattleLogParser.cs


注:本文中的LuaEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。