|
Lucy Zelmanov
Registered User
Join date: 19 Feb 2007
Posts: 178
|
04-25-2008 10:14
I've been doing some playing around with the ALICE bot script I found on this wiki:  For the most part it seems to work fine, but there are some oddities in it's output that relate to the script itself. From: someone Me: oh whos that? Stumpy: Whoa. What does "that" refer to? the bit thats bugging me is the bit. I've had a look tru the script and I can't figure out how to clean up the output without damaging the script itself. Any help with this greatly apreciated. I should point out I can read scripts and tinker, but I'm not a scripter per say. Thankies in advance 
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
04-25-2008 11:40
I'm assuming this part of the code: http_response(key request_id, integer status, list metadata, string body) { integer i; if (request_id == requestid) { cust_begin=llSubStringIndex(body, "custid="); cust=llGetSubString(body, cust_begin+8, cust_begin+23); that_begin = llSubStringIndex(body, "<@that>"); // this should be < that > (delete @) that_end = llSubStringIndex(body, "<@/that>"); //this should be < / that > (delete @) reply = llGetSubString(body, that_begin + 6, that_end - 1); newreply = SearchAndReplace(reply, "%20", " "); reply = newreply; newreply = SearchAndReplace(reply,"&@quot;","\""); //this should be & quot; (delete @) the wiki changes it to " reply = newreply; newreply = SearchAndReplace(reply,"&@lt;br&@gt;","\n"); //the first search should be & lt;br & gt; (delete @) reply = newreply; newreply = SearchAndReplace(reply, "&@gt;", ">"); //the first search should be & gt; (delete @) reply = newreply; newreply = SearchAndReplace(reply, "&@lt;", "<"); //this first search should be & lt; llSay(0,newreply); } }
..as per the comments, should become this: http_response(key request_id, integer status, list metadata, string body) { integer i; if (request_id == requestid) { cust_begin=llSubStringIndex(body, "custid="); cust=llGetSubString(body, cust_begin+8, cust_begin+23); that_begin = llSubStringIndex(body, "<that>"); that_end = llSubStringIndex(body, "</that>"); reply = llGetSubString(body, that_begin + 6, that_end - 1); newreply = SearchAndReplace(reply, "%20", " "); reply = newreply; newreply = SearchAndReplace(reply,""","\""); reply = newreply; newreply = SearchAndReplace(reply,"<br>","\n"); reply = newreply; newreply = SearchAndReplace(reply, ">", ">"); reply = newreply; newreply = SearchAndReplace(reply, "<", "<"); llSay(0,newreply); } }
|
|
Ciera Spyker
Queen of SL
Join date: 25 Mar 2008
Posts: 424
|
Im trying a bot too
04-25-2008 13:20
but Im very simple. (blond) I can get my bot to talk jump and fly but not walk or follow me like i think it can.
|
|
Lucy Zelmanov
Registered User
Join date: 19 Feb 2007
Posts: 178
|
04-25-2008 13:55
From: Pale Spectre I'm assuming this part of the code:
Yup that was the bit, but I've been given updated code inworld and it seems to be running fine now. Now comes the hard bit getting it to do all the other stuff.
|