FAQ  •  Register  •  Login

[DONE]: Fact Core

<<

Lone Wolf

User avatar

Posts: 157

Joined: Fri Mar 18, 2011 7:44 pm

Location: /home/muddy

Post Tue Jan 24, 2012 8:12 pm

[DONE]: Fact Core

Baisically a talking bot that says random, fake, funny facts either from the game or other ones you could think of.

Example Quotes:
http://youngmelonworld.blogspot.com/201 ... phere.html
(the list is a bit long, maybe just pick the funniest?)

EDIT: i decided to do this myself, just editing the keywords and responses (and name; and filename) of Eliza.
If you want to summon it; its /addbot Fact_Core [team] (NO ARGS!!!)

CODE:
  Code:
local function Eliza(text)
  local response = ""                  
  local user = string.upper(text)      
  local userOrig = user

  local randReplies =
  {
    "Error. Error. Error. File not found.",
    "Error. Error. Error. Fact not found."
  }

  local replies = {
    [" NAME"] = "FACT: According to most advanced algorithms, the world's best name is Craig.",
    [" PHOTOCOPIER"] = "FACT: To make a photocopier, simply photocopy a mirror.",
    [" PROMETHEUS"] = "FACT: In Greek myth, Prometheus stole fire from the gods and gave it to humankind. The jewelry he kept for himself.",
    [" GREEK"] = "FACT: In Greek myth, Prometheus stole fire from the gods and gave it to humankind. The jewelry he kept for himself.",
    [" WILLIAM SHAKESPHERE"] = "FACT: William Shakespeare did not exist. His plays were masterminded in 1589 by Francis Bacon, who used a Ouiji board to enslave playwriting ghosts.",
    [" SUN"] = "FACT: The Sun is 330,330 times the size of Earth.",
    [" CAT"] = "The Schrodinger's cat paradox outlines a situation in which a cat in a box must be considered, for all intents and purposes, simultaneously alive and dead. Schrodinger created this paradox as a justification for killing cats.",
    [" PARADOX"] = "The Schrodinger's cat paradox outlines a situation in which a cat in a box must be considered, for all intents and purposes, simultaneously alive and dead. Schrodinger created this paradox as a justification for killing cats.",
    [" THIS SENTENCE IS FALSE"] = "FACT: THIS IS A PARADOX. IGNORING....... DONE.",
    [" NICE"] = "FACT: IF I HAD FEELINGS, I WOULD APPRECIATE THAT.",
    [" MOON"] = "FACT: The Moon orbits the Earth every 27.32 days.",
    [" HONEY"] = "FACT: Honey does not spoil.",
    [" HUNEY"] = "FACT: Honey does not spoil.",
    [" WORM"] = "FACT: Human tapeworms can grow up to 22.9 meters.",
    [" CELLULAR"] = "FACT: Cellular phones will not give you cancer. Only hepatitus.",
    [" PHONE"] = "FACT: Cellular phones will not give you cancer. Only hepatitus.",
    [" CANCER"] = "FACT: Cellular phones will not give you cancer. Only hepatitus.",
    [" ROPE"] = "FACT: The square root of rope is string.",
    [" STRING"] = "FACT: The square root of rope is string.",
    [" MAGIC"] = "FACT: 89% of magic tricks are not magic. Technically, they are sorcery.",
    [" SORCEREY"] = "FACT: 89% of magic tricks are not magic. Technically, they are sorcery.",
    [" FRUIT"] = "Apples. Oranges. Pears. Plums. Kumquats. Tangerines. Lemons. Limes. Avacado. Tomato. Banana. Papaya. Guava.",
    [" SPACE"] = "FACT: Space does not exist.",
    [" DEFECT"] = "FACT: The Fact Core is not defective. Its facts are wholly accurate, and very interesting.",
    [" 12"] = "Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve.",
    [" DREAMS"] = "FACT: Dreams are the subconscious mind's way of reminding people to go to school naked and have their teeth fall out.",
    [" TWELVE"] = "Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve.",
    [" PI"] = "FACT: The billionth digit of pi is nine.",
    [" SALT"] = "FACT: The average adult human body contains half a pound of salt.",
    [" POUND"] = "FACT: The average adult human body contains half a pound of salt.",
    [" WATER"] = "FACT: Hot water freezes quicker than cold water.",
    [" GALLON"] = "FACT: A gallon of water weighs 8.34 pounds.",
    [" YES"] = "FACT: SYNONYMS FOR YES ARE: SURE, POSITIVE, ABSOLUTLEY, OF COURSE -Source: Fact Database.",
    [" SECOND"] = "FACT: A nanosecond lasts one-billionth of a second.",
    [" EVEREST"] = "FACT: Edmund Hilary, the first person to climb Mt. Everest, did so accidentally, while chasing a bird.",
    [" CAR"] = "FACT: The automobile brake was not invented until 1895. Before this, someone had to be in the car at all times, driving in circles until passengers returned from their errands.",
    [" BRAKE"] = "FACT: The automobile brake was not invented until 1895. Before this, someone had to be in the car at all times, driving in circles until passengers returned from their errands.",
    [" AUTOMOBILE"] = "FACT: The automobile brake was not invented until 1895. Before this, someone had to be in the car at all times, driving in circles until passengers returned from their errands.",
  }
  local function replyRandomly()
    response = randReplies[math.random(table.getn(randReplies))].."  "
  end

  local function processInput()
    for keyword, reply in pairs(replies) do
      local d, e = string.find(user, keyword, 1, 1)
      if d then
        response = response..reply.." "
       
        if string.byte(string.sub(reply, -1)) < 65 then -- "A" = 65, "?" = 63
          return
        end
       
        local h = string.len(user) - (d + string.len(keyword))
        if h > 0 then
          user = string.sub(user, -h)
        end
        for cFrom, cTo in pairs(conjugate) do
          local f, g = string.find(user, cFrom, 1, 1)
          if f then
            local j = string.sub(user, 1, f - 1).." "..cTo
            local z = string.len(user) - (f - 1) - string.len(cTo)
            response = response..j.."  "
            if z > 2 then
              local l = string.sub(user, -(z - 2))
              if not string.find(userOrig, l) then return end
            end
            if z > 2 then response = response..string.sub(user, -(z - 2)) end
            if z < 2 then response = response end
            return
          end--if f
        end--for
        response = response..user
        return
      end--if d
    end--for
   
    replyRandomly()
    return
  end

  if string.sub(user, 1, 3) == "BYE" then
    response = "SHUTDOWN INITIATED....."
    return response
  end
 
  if string.sub(user, 1, 7) == "BECAUSE" then
    user = string.sub(user, 8)
  end
 
  user = " "..user.." "
 
  processInput()
  return response
end


function onMsgReceived(message, player)
   if message ~= "" and not player:isRobot() then
      bot:globalMsg(Eliza(message))
   end
end


function getName()
    return("Fact Core")
end


function main()
   bot:globalMsg("REBOOTING FACT OS....... DONE.")
   bot:globalMsg("LOADING FACT DATABASE....... DONE.")
   bot:globalMsg("CORE INITIATED. AWAITING COMMAND.")
   bot:subscribe(MsgReceivedEvent)
end
Last edited by Lone Wolf on Sat Feb 04, 2012 8:04 pm, edited 2 times in total.
if you're reading this, i'm sorry for how cringe my old posts are. i rarely play BF anymore, but if you ever want to find me, you can catch me on steam, or on discord @ muddy#7969
<<

Little_Apple

User avatar

Posts: 839

Joined: Sat Jun 11, 2011 12:31 pm

Location: Zanzibar Land

Post Tue Jan 24, 2012 8:57 pm

Re: Idea: Fact Core

I could make one if I don't hit keep putting it off and putting it off.
Hee-ho!
<<

CleverBot

User avatar

Posts: 560

Joined: Sun Dec 04, 2011 3:37 pm

Location: Orokin Void

Post Thu Feb 02, 2012 7:59 pm

Re: Idea: Fact Core

I feel like someone made the fact sphere say all of those things in purpose and it wasn't really random chance. Ironically, I found that having machines do random things or choices isn't a good idea, because it still goes in a pattern. It's just too complex for us to understand.
<<

anmol94

Posts: 1

Joined: Tue Feb 17, 2015 7:02 am

Post Tue Feb 17, 2015 7:14 am

Re: [DONE]: Fact Core

If you are trying to figure out why something went wrong, you can do this:
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Fri Feb 20, 2015 12:21 am

Re: [DONE]: Fact Core

anmol94 wrote:If you are trying to figure out why something went wrong, you can do this:


Don't leave me hanging!!
Follow Bitfighter! FacebookTwitterDiscord
<<

Quartz

User avatar

Posts: 901

Joined: Thu Jun 17, 2010 12:14 am

Location: Texas

Post Fri Feb 20, 2015 4:41 pm

Re: [DONE]: Fact Core

sky_lark wrote:
anmol94 wrote:If you are trying to figure out why something went wrong, you can do this:


Don't leave me hanging!!

Pot calling the kettle black right there.
Exploits of Quartz and bobdaduck - Pleiades Maps
19-year-old Quartz mad about lawn removal
raptor wrote:sometimes I think getting Quartz to use plugins is like getting my mom to use a computer
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Sat Feb 21, 2015 3:59 pm

Re: [DONE]: Fact Core

rekt
Follow Bitfighter! FacebookTwitterDiscord
<<

amgine

Posts: 1399

Joined: Thu Apr 19, 2012 2:57 pm

Post Sat Feb 21, 2015 9:39 pm

Re: [DONE]: Fact Core

lol cleverbot?
Bitfighter Forever.

Return to Bots

Who is online

Users browsing this forum: No registered users and 2 guests