Results 1 to 10 of 10

Thread: Random Fact Generator

  1. #1
    Join Date
    Mar 2011
    Location
    Oklahoma
    Posts
    98
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Random Fact Generator

    Do you need something to write out in your scripts while your character is doing something?

    Do you need entertainment while your bot is running? Try this function: GetRandomFact.

    GetRandomFact grabs a random fact from the web and places it in a string for you! Writeln it or paint it on smart, the posibilities endless.

    Simba Code:
    function GetRandomFact: string;
    //This function returns a random fact from
    //  the website 'http://randomfactgenerator.net/'
    // Author: kanah
    //  Special thanks to Euphemism for the idea
    var
      SearchString0, SearchString1, Text: string;
    begin
      //Search strings are used to mark the begining and end of useful info
      SearchString0 := '<div id="facts">';
      SearchString1 := '<br/><br/>';

      //Text is loaded with the raw html text from the website
      Text := GetPage('http://randomfactgenerator.net/');

      //Text is now broken down from the entire html page into the random fact
      Text := Between(SearchString0,SearchString1,Text);

      //Now trim to remove spaces and get rid of the "<div>" text
      Trim(Text);
      delete(Text,1,pos('>',Text));
      Result := Text;
    end;

    did you know?
    Europe is the only continent without a desert.
    ---- Kanah ----

    “If God did not exist then surely man would create him" - Voltiare

  2. #2
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    "In 1976 an LA secretary named Jannene Swift officially married a 50 pound rock in a ceremony witnessed by more than 20 people."

    The function turned out really nice!
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  3. #3
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Pretty neat! Thanks for posting this. Rep+

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  4. #4
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    This is what I've got...

    " The smallest human penis ever recorded was just 5/8 of an inch long! "

    Hi

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Not gonna tell you how exactly, but you could get all three facts relatively easily. Hint: they are all within " data-text=' " (no spaces), and " ' ".

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    ReGeX!
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  7. #7
    Join Date
    Dec 2011
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol

  8. #8
    Join Date
    Sep 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very interesting! WOuld love to see more antis like this in includes for Simba...

  9. #9
    Join Date
    Mar 2012
    Location
    Australia
    Posts
    625
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by hoopla View Post
    Very interesting! WOuld love to see more antis like this in includes for Simba...
    but then again, thousands of people running around quoting random things? not suss :|

  10. #10
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I like it! I pretty much know all of these though... because I has no lyfes

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
  •