本文整理汇总了C#中LuaEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LuaEventArgs类的具体用法?C# LuaEventArgs怎么用?C# LuaEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LuaEventArgs类属于命名空间,在下文中一共展示了LuaEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: HandleCombatLog
private static void HandleCombatLog(object sender, LuaEventArgs args)
{
var e = new CombatLogEventArgs(args.EventName, args.FireTimeStamp, args.Args);
//Logger.WriteDebug("[CombatLog] " + e.Event + " - " + e.SourceName + " - " + e.SpellName);
switch (e.Event)
{
case "SPELL_AURA_APPLIED":
case "SPELL_CAST_SUCCESS":
if (e.SourceGuid != StyxWoW.Me.Guid)
{
return;
}
// Update the last spell we cast. So certain classes can 'switch' their logic around.
Spell.LastSpellCast = e.SpellName;
//Logger.WriteDebug("Successfully cast " + Spell.LastSpellCast);
// Force a wait for all summoned minions. This prevents double-casting it.
if (SingularRoutine.MyClass == WoWClass.Warlock && e.SpellName.StartsWith("Summon "))
{
StyxWoW.SleepForLagDuration();
}
break;
case "SPELL_MISSED":
if (e.Args[14].ToString() == "EVADE")
{
Logger.Write("Mob is evading. Blacklisting it!");
Blacklist.Add(e.DestGuid, TimeSpan.FromMinutes(30));
if (StyxWoW.Me.CurrentTargetGuid == e.DestGuid)
{
StyxWoW.Me.ClearTarget();
}
BotPoi.Clear("Blacklisting evading mob");
StyxWoW.SleepForLagDuration();
}
break;
}
}
开发者ID:killingzor,项目名称:pqrotation-profiles,代码行数:40,代码来源:EventHandlers.cs
示例17: GuildInvite
private void GuildInvite(object sender, LuaEventArgs e)
{
// Our Var's
string GuildName;
int GuildLevel;
GuildName = e.Args[1].ToString();
GuildLevel = Convert.ToInt32(e.Args[2]);
if (GuildLevel >= LevelToJoin)
{
Write("Accepting - Guild Name: {0} Guild Level: {1}", GuildName, GuildLevel);
Lua.DoString("AcceptGuild()");
}
else
{
Write("Declining - Guild Name: {0} Guild Level: {1}", GuildName, GuildLevel);
Lua.DoString("DeclineGuild()");
}
Lua.DoString("StaticPopup_Hide(\"GUILD_INVITE_REQUEST\")");
}
开发者ID:rhoninsk,项目名称:novas-addons,代码行数:22,代码来源:GuildAccept.cs
示例18: LootOpened
internal static void LootOpened(object sender, LuaEventArgs args)
{
GarrisonButler.Log("[Loot] Opened");
var currenPoi = BotPoi.Current.AsObject as WoWGameObject;
if (currenPoi != null && currenPoi.IsValid)
{
var lootHash = currenPoi.Guid.GetHashCode();
if (LootHash != lootHash)
{
GarrisonButler.Log("[Loot] Looting {0}.", currenPoi.Name);
LootCount = 0;
LootHash = lootHash;
}
else
{
GarrisonButler.Diagnostic("[Loot] Looting frame of {0} opened for the {1} time.", currenPoi.Name, LootCount);
LootCount++;
}
if (LootCount > MaxLootCount)
{
GarrisonButler.Warning("[Loot] Tried to loot {0}, {1} times => blacklisting.", currenPoi.Name, LootCount);
Objects.Blacklist.Add(currenPoi);
}
}
//var lootFrame = LootFrame.Instance;
//if (lootFrame != null)
//{
// for (int i = 0; i < lootFrame.LootItems; i++)
// {
// GarrisonButler.Diagnostic("[Loot] Found LootName {0}.", lootFrame.LootInfo(i).LootName);
// GarrisonButler.Diagnostic("[Loot] Found LootIcon {0}.", lootFrame.LootInfo(i).LootIcon);
// GarrisonButler.Diagnostic("[Loot] Found LootQuantity {0}.", lootFrame.LootInfo(i).LootQuantity);
// GarrisonButler.Diagnostic("[Loot] Found LootRarity {0}.", lootFrame.LootInfo(i).LootRarity);
// GarrisonButler.Diagnostic("[Loot] Found Locked {0}.", lootFrame.LootInfo(i).Locked);
// }
//}
LootIsOpen = true;
}
开发者ID:aash,项目名称:GarrisonButler,代码行数:39,代码来源:LuaEvents.cs
示例19: ACHIEVEMENT_EARNED
// ACHIEVEMENT Event - Complete 08/08/2012 - CoDeRs (IMO)
public void ACHIEVEMENT_EARNED(object sender, LuaEventArgs args)
{
try
{
List<string> achievementInfo = Lua.GetReturnValues("return GetAchievementInfo(" + args.Args[0].ToString() + ")");
try
{
string sCommandCheck = SQLConnector.SendJSON("[{\"TAB\":\"TABAchievements\"},{\"nToonId\":\"" + WatchMyToon.nToonId + "\"},{\"nAchievLfd\":\"NULL\"},{\"szAchievId\":\"" + achievementInfo[0] + "\"},{\"szAchievName\":\"" + achievementInfo[1] + "\"}]", "{\"Query\":\"Insert\"}", "{\"Limit\":\"0\"}");
Logging.Write(LogLevel.Verbose, Colors.Orange, "[WatchMyToon] - Achievement Update Report: " + sCommandCheck);
}
catch (Exception ex)
{
Logging.Write(LogLevel.Normal, Colors.Red, "[WatchMyToon] - ACHIEVEMENT_EARNED SQL Failed!");
Logging.Write(LogLevel.Diagnostic, Colors.Red, "[WatchMyToon] - " + ex);
}
}
catch (Exception ex)
{
Logging.Write(LogLevel.Normal, Colors.Red, "[WatchMyToon] - ACHIEVEMENT_EARNED LUA Failed!");
Logging.Write(LogLevel.Diagnostic, Colors.Red, "[WatchMyToon] - " + ex);
}
}
开发者ID:CoDeRs0880,项目名称:WatchMyToon_Plugin,代码行数:24,代码来源:Functions_LuaEvents.cs
示例20: CombatLogEventHander
public static void CombatLogEventHander(object sender, LuaEventArgs args)
{
foreach (object arg in args.Args)
{
if (arg is String)
{
var s = (string)arg;
//if (s.Contains("Crab")) Utils.Log("CRAB-EH!",Color.Red);
if (s.Contains("EVADE"))
{
if (Me.GotTarget)
{
Logging.Write("My target is Evade bugged, blacking " + CT.Name,Color.Red);
Target.BlackList(3600);
Lua.DoString("StopAttack() PetStopAttack() PetFollow()");
StyxWoW.Me.ClearTarget();
}
}
}
}
}
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:23,代码来源:EventHandlers.cs
注:本文中的LuaEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论