Results 1 to 3 of 3

Thread: [TUT]Calling FindNormalRandoms Correctly!

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default [TUT]Calling FindNormalRandoms Correctly!

    Hello guys, i've seen ALOT of people call antirandoms like this -

    Simba Code:
    my code my code
    my code my code
    FindNormalRandoms;
    my code my code my code

    That is WRONG!

    Let's take a look at FindNormalRandoms shall we?

    Simba Code:
    (*
    FindNormalRandoms
    ~~~~~~~~~~~~~~~~~

    .. code-block:: pascal

        function FindNormalRandoms(): boolean;

    Finds and solves Runescape's random events.  Returns true if an event was
    solved.

    .. note::

        Author: Coh3n
        Last Modified: Jan. 22nd, 2012 by Coh3n

    Example:

    .. code-block:: pascal

        FindNormalRandoms();
    *)

    function FindNormalRandoms(): boolean;
    begin
      result := _FindAllrandoms(true);
    end;

    As you can see, it returns a BOOLEAN value, meaning a true or false.
    It results TRUE if the Random gets solved, and results FALSE if it does NOT.
    The correct way to call FindNormalRandoms is like this -

    Simba Code:
    my code my code
    my code my code
    my code my code my code
    if not FindNormalRandoms then
      if not LoggedIn then
        TerminateScript/NextPlayer;

    What this does is, if it FAILS to solve the random, it'll check if it is logged in.
    If it IS logged in, then it'll continue (we'll get to it next ) if it isn't, it'll close the script.

    Again, most likely if you fail a random, you get teleported to a random location, so unless your script has failsafes, this is what you should do -
    Simba Code:
    if not FindNormalRandoms then
      if not LoggedIn then
        TerminateScript/Next Player else
        begin
          Logout;
        TerminateScript/NextPlayer;
       end;

    This was done in browser, so there WILL be errors, point them out to me

    [/SIMBA]

  2. #2
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Cheers i will keep this in mind =]
    Learning To Code - So Excuse the n00b questions!

  3. #3
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    But if FindNormalRandoms finds a random but can't solve it it will carry on, don't you need:
    Simba Code:
    FindNormalRandoms;
      if not LoggedIn then
        begin
          Players[CurrentPlayer].Status := 'Stuck in a random';
          NextPlayer(False);
        end;
      //or
      FindNormalRandoms;
      if not LoggedIn then
        TerminateScript;
    Since FindNormalRandoms will always log you out if you fail a random

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •