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
Derpy
Registered Posts: 33
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),"''") }
"A hero is someone who has given his or her life to something bigger than oneself."
This discussion has been closed.
Comments
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.
Lλmbdλ: donations for coding the space future of diaspora :>
Get your extra long EVE trial here!
I don't give a shit if people keep sharing my code since caring is sharing right?
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
-Admiral Hunter
Lλmbdλ: donations for coding the space future of diaspora :>
Get your extra long EVE trial here!