Others.Random(1, 3); // always returns 1 Others.Random(2, 3); // always returns 2 //etc
Matenia 628 Posted November 22, 2022 I'm sure this worked on TBC back in the day. Currently definitely broken on Vanilla.
Droidz 2738 Posted November 23, 2022 Hi, I just tested (on latest version for Vanilla) and it works :
Matenia 628 Posted November 23, 2022 (edited) I did the same test yesterday (exact same in development tools). Maybe it was a bad seed or something. My computer had already been running all day. Edit: Just did it again and it still always reports 1 - this is WRobot 32758. I can get it to work if I execute it before even starting the bot (Quester). If I use it while the bot is running without ever using it before, it will ALWAYS result in 1. For now, I just made my own implementation in my quester profile to work around. Edited November 23, 2022 by Matenia
Droidz 2738 Posted November 23, 2022 Random code is simple internal static readonly Random Rng = new Random(unchecked((int)DateTime.Now.Ticks)); /// <summary> /// Return Random number. /// </summary> /// <param name="from">From.</param> /// <param name="to">To.</param> /// <returns>System.Int32.</returns> public static int Random(int from, int to) { try { return Rng.Next(from, to + 1); } catch (Exception exception) { Logging.WriteError("Random(int from, int to): " + exception); } return 0; } What is your value of unchecked((int)DateTime.Now.Ticks)
Droidz 2738 Posted November 23, 2022 and value of (int) DateTime.Now.Ticks (I'm not sure robotManager.dll is up to date)
Matenia 628 Posted November 23, 2022 For now, I can't reproduce it anymore (5 minutes ago, It was possible - idk!). If I can reproduce it again, I will put the values of Ticks checked and unchecked here. Droidz 1
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now