Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Others.Random is bugged

  • Product: WRobot General
  • Type: Bug
  • Status: Unconfirmed
Others.Random(1, 3); // always returns 1
Others.Random(2, 3); // always returns 2
//etc

 

User Feedback

Recommended Comments

Matenia

Elite user

I'm sure this worked on TBC back in the day. Currently definitely broken on Vanilla.

Hi,

I just tested (on latest version for Vanilla) and it works :

DFHfpQQMn6.gif

Matenia

Elite user
(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 by Matenia

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)

 

and value of 

(int) DateTime.Now.Ticks

(I'm not sure robotManager.dll is up to date)

Matenia

Elite user

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.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.