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

Posts: 33Registered
edited June 2014 #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 &#91;URL CustID Response Input C&#93;:string G:gtable Say
persist &#91;ExplodedData ExplodedData2&#93;:array

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

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&#91;2,string&#93;:explode("\"&gt;")
CustID = ExplodedData2&#91;1,string&#93;
G&#91;"CustID",string&#93; = CustID
}
ExplodedData = httpData():explode("&lt;that&gt;")
ExplodedData2 = ExplodedData&#91;2,string&#93;:explode("&lt;/that&gt;")
Response = ExplodedData2&#91;1,string&#93;
Response = Response:replace("&quot;","''"):replace("&lt;","&lt;"):replace("&gt;","&gt;"):replace("&lt;br&gt;"," "):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."

• Posts: 175Registered
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."

Other than "print("Megan")", where are you outputting to chat? Or is the problem that it's not outputting that string either?
• 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."
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!
• 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."
• 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?
• 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."
• 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.

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.

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.