Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var units = Unit.Get();
- var unit = default(Unit);
- if(units != null)
- unit = units.Where(u => u != default(Unit) && u.Name != null && u.Name.Contains("Shadow")).FirstOrDefault();
- while(unit != default(Unit))
- {
- Attack.AttackArea(TimeSpan.FromSeconds(5));
- units = Unit.Get();
- if (units != null)
- unit = units.Where(u => u != null && u.Name != null && u.Name.Contains("Shadow")).FirstOrDefault();
- else
- unit = default(Unit);
- }
- //That code calls this function, but never prints "AttackArea Timeout!"
- public static void AttackArea(TimeSpan timeout)
- {
- TimeSpan startTime = TimeSpan.FromTicks(System.Environment.TickCount);
- while (TimeSpan.FromTicks(System.Environment.TickCount).Subtract(startTime) < timeout)
- {
- if (Me.IsSkillReady(SNOPowerId.Witchdoctor_BigBadVoodoo))
- {
- Me.UsePower(SNOPowerId.Witchdoctor_BigBadVoodoo);
- Thread.Sleep(200);
- }
- if (Me.IsSkillReady(SNOPowerId.Witchdoctor_SpiritWalk))
- {
- Me.UsePower(SNOPowerId.Witchdoctor_SpiritWalk);
- Thread.Sleep(200);
- }
- if (Me.IsSkillReady(SNOPowerId.Witchdoctor_MassConfusion))
- {
- Me.UsePower(SNOPowerId.Witchdoctor_MassConfusion);
- Thread.Sleep(200);
- }
- if (Me.IsSkillReady(SNOPowerId.Witchdoctor_SummonZombieDog))
- {
- Me.UsePower(SNOPowerId.Witchdoctor_SummonZombieDog);
- Thread.Sleep(200);
- }
- if (Me.IsSkillReady(SNOPowerId.Witchdoctor_Sacrifice))
- {
- Me.UsePower(SNOPowerId.Witchdoctor_Sacrifice);
- Thread.Sleep(200);
- }
- //Draw.DrawText(10.0f, 10.0f, 0x16A, 0x16, 0xFFFFFFFF, String.Format("Attack Time: {0}", TimeSpan.FromTicks(System.Environment.TickCount).Subtract(startTime).Seconds));
- Thread.Sleep(100);
- }
- Game.Print("AttackArea Timeout!");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement