So i have this code:
Initially the code runs once as expected.Code:static void Main(string[] args) { Console.Title = "Dungeon Defenders Mana Hack"; SetUp(); } static void SetUp() { Process[] processes; processes = Process.GetProcessesByName("DunDefGame"); if (processes.Length > 0) { Write(processes); } else { Console.WriteLine("Could Not Find Game Process, Please Launch Dungeon Defenders."); Console.WriteLine("Press any key to retry"); Console.WriteLine("\n"); Console.Read(); System.Threading.Thread.Sleep(1000); SetUp(); } }
BUT when i hit a key to run SetUp() again it runs it twice instead of once. (At this point it has ran 3 times, once initially and twice the second time)
Results 1 to 5 of 5
Thread: C# Code Being Ran Twice
- 25 Dec. 2014 03:44am #1
C# Code Being Ran Twice
There's nothing ideal about being real, there's so many flaws to cover and conceal.
- 25 Dec. 2014 05:29am #2
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,325
- Reputation
- 114
- LCash
- 0.00
well you see the problem is...
its Christmas.https://discord.gg/TvN6xUb ~ chat on discord pls.
- 25 Dec. 2014 05:47am #3
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,325
- Reputation
- 114
- LCash
- 0.00
p.s you have it calling setup in the else statement. maybe have a stronger condition to call setup again.
https://discord.gg/TvN6xUb ~ chat on discord pls.
- 25 Dec. 2014 06:04am #4
- 25 Dec. 2014 06:19am #5
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,325
- Reputation
- 114
- LCash
- 0.00
only other thing i could think of is your timer working differently then expected, but that's doubtful.
https://discord.gg/TvN6xUb ~ chat on discord pls.