本文整理汇总了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();
}
}
}
}
示例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.");
}
}
}
}
示例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()");
}
示例4: HandleDungeonInvite
public static void HandleDungeonInvite(object sender, LuaEventArgs args)
{
if (AutoAcceptDungeon)
{
FTWLogger.log(Color.SandyBrown, "Accepting dungeon invite");
Lua.DoString("AcceptProposal()");
}
}
示例5: HandleDungeonDone
public static void HandleDungeonDone(object sender, LuaEventArgs args)
{
// Done with dungeon
if (AutoQueueDungeon)
{
Thread.Sleep(60000);
Lua.DoString("LeaveParty()");
}
}
示例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
{
}
}
示例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);
}
}
示例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);
}
}
示例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]**************************");
}
}
示例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])
};
}
示例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());
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}