Welcome to the new Diaspora forums, please let us know if you see anything broken! Notice: Some users may need to reupload their avatars due to an issue during forum setup!

E2 Chat Bot

DerpyDerpy Posts: 33Registered
edited June 2014 in Help and Tutorials #1
I need help with my Chat Bot "Megan" Cant talk for some reason it picks it up but doesn't Say anything

@name Megan
persist [URL CustID Response Input C]:string G:gtable Say
persist [ExplodedData ExplodedData2]:array


if (first() | dupefinished()) {
    runOnChat(1)
    runOnHTTP(1)
    URL = "http://www.pandorabots.com/botmaster/en/summary?botid=bbda04140e343060";
    G = gTable("Megan")
    CustID = G["CustID",string]

    if (!CustID) {
        httpRequest(URL+httpUrlEncode("My name is "+owner():name()))
    }
}

if (chatClk()) {
    
    Input = httpUrlEncode(lastSaid())
    C = ""
    if (CustID) {
        C = "&custid="+CustID
    }
    httpRequest(URL+Input+C)
    #print(URL+Input+C)
}

if (httpClk()) {
    print("Megan")
    if (CustID == "") {
        ExplodedData = httpData():explode("custid=\"")
        ExplodedData2 = ExplodedData[2,string]:explode("\">")
        CustID = ExplodedData2[1,string]
        G["CustID",string] = CustID
    }
    ExplodedData = httpData():explode("<that>")
    ExplodedData2 = ExplodedData[2,string]:explode("</that>")
    Response = ExplodedData2[1,string]
    Response = Response:replace(""","''"):replace("<","<"):replace(">",">"):replace("<br>"," "):replace("  "," "):replace(" ?","?"):replace(" !","!"):replace(" .","."):replace(toChar(34),"''")


}
Post edited by Unknown User on
"A hero is someone who has given his or her life to something bigger than oneself."

Comments

  • NinjrKillrNinjrKillr Posts: 192Registered
    Edited your post to add [ code ] tags. Don't think I have GMod installed atm, so I can't test sorry.

    "We fear that which we cannot see... we respect that which we cannot see... thus the blade will be wielded."

    Urahara_Bleach_Signature_by_Harty73.png
  • SteeveeoSteeveeo Posts: 848Registered, Administrator
    Other than "print("Megan")", where are you outputting to chat? Or is the problem that it's not outputting that string either?
  • DerpyDerpy Posts: 33Registered
    To say I don't know much about Chat Bots and So but if anybody could edit and test it that would be nice
    "A hero is someone who has given his or her life to something bigger than oneself."
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    So, looking at the code I can already tell you likely got it from locint(sweetone) or admiral hunter. If you're having problems getting it to work and you did get it from someone, its better to ask the person who made the code.

    There are two problems that I'm seeing with the code: you're not actually printing the response, and you haven't set the CustID variable properly so the chatbot probably doesn't know what to do. If you don't know E2 very well I'd suggest that you go learn the basics, there are plenty of E2 tutorials around so I'm sure you could find something.

    If locint gave this to you, tell him I said to start handing out working versions of this crap or stop giving it out unless he plans on explaining how to make it work, because you're the 3rd person I've seen with what looks like his code and the 3rd that it hasn't been working for.
    This is a block of text that can be added to posts you make. There is a 255 character limit.

    Lλmbdλ: donations for coding the space future of diaspora :>

    Get your extra long EVE trial here!
  • DerpyDerpy Posts: 33Registered
    I think i'm gonna Ask The Wanderer. Aka Admiral For a working code because i just heard that it doesn't work anymore
    "A hero is someone who has given his or her life to something bigger than oneself."
  • SweetOneSweetOne Posts: 39Registered
    Im propably the only one with working version of this and no it's not from me.

    I don't give a shit if people keep sharing my code since caring is sharing right?
  • DerpyDerpy Posts: 33Registered
    Well Sweet If you want you could fix the code or give a new one if you like
    "A hero is someone who has given his or her life to something bigger than oneself."
  • =)Y(= Admiral Hunter=)Y(= Admiral Hunter Posts: 16Registered
    Look, if this is what my incident with Loclnt started than I will ask that the codes themselves be banned. I did not intend for this to become what it is, nor did I intend Sweetone leave Diaspora, or this entire mess with Derpy and others be started. I unfortanutely can do no more than anyone else could because I haven't even looked at an E2 code in months. I can't be of any more help than anyone else could be. I'm sorry you got yelled at Sweetone, and I'm sorry I brought Derpy into this. I did not intend to share Melody, Rose, or GLaDOS' codes with anyone. I would fix Derpy's code myself, but due to my absence on and build servers in general, and my AIs' code still needing bugs removed, I cannot do more than I already have.

    Brandon, feel free to ban the code if you must. If not, then I will appear on the server to do what I can. SweetOne, I aplogize for the harsh words exchanged and my attitude and thievery of Rose's code.

    I personally apologize for all of this, and if it comes up again then feel free to ban the codes and myself if necessary.

    -Acting Admiral Hunter Hellfire
    True heroes don't kill their enemies. True heroes would rather themselves die than their enemy. A true hero fights to protect his friend and foe.

    -Admiral Hunter
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Look, if this is what my incident with Loclnt started than I will ask that the codes themselves be banned. I did not intend for this to become what it is, nor did I intend Sweetone leave Diaspora, or this entire mess with Derpy and others be started. I unfortanutely can do no more than anyone else could because I haven't even looked at an E2 code in months. I can't be of any more help than anyone else could be. I'm sorry you got yelled at Sweetone, and I'm sorry I brought Derpy into this. I did not intend to share Melody, Rose, or GLaDOS' codes with anyone. I would fix Derpy's code myself, but due to my absence on and build servers in general, and my AIs' code still needing bugs removed, I cannot do more than I already have.

    Brandon, feel free to ban the code if you must. If not, then I will appear on the server to do what I can. SweetOne, I aplogize for the harsh words exchanged and my attitude and thievery of Rose's code.

    I personally apologize for all of this, and if it comes up again then feel free to ban the codes and myself if necessary.

    -Acting Admiral Hunter Hellfire
    You're going overkill now, I'm not banning anything. Your chat code did originally come from sweetone(locint), so he is atleast partially involved. This is far from the first time that sweetone has shit his pants like this, don't blame yourself over it. Thread locked.
    This is a block of text that can be added to posts you make. There is a 255 character limit.

    Lλmbdλ: donations for coding the space future of diaspora :>

    Get your extra long EVE trial here!
  • NinjrKillrNinjrKillr Posts: 192Registered
    Thread now actually locked. Silly Branderp ;)

    "We fear that which we cannot see... we respect that which we cannot see... thus the blade will be wielded."

    Urahara_Bleach_Signature_by_Harty73.png
This discussion has been closed.