I have some script for an object that kind of works and kind of doesn't. It's sending an email and recieving an xmlrpc response from a c# service on my web server.
The parts that seems to work are the email goes out with the correct data for the service on the webserver. The service does on the whole manage to get the xmlrpc through to the object. However I seem to be getting myself into some kind of endless loop, as it will only allow me to 'touch' it once. Can anyone advise me what I am doing wrong.
As you can see the LSL script is based on the one on the wiki for XMLRPC. I have just added the stuff I needed. I think I'm making a mistake with states.
LSL script:
key gChannel;
integer gCommand;
default {
state_entry() {}
touch_start(integer total_number)
{
llListen( 0, "", llGetOwner(), ""
;llSay( 0, "requests input" ); //not actual code, but gets input from user
}
listen( integer channel, string name, key id, string message )
{
list parsed = llParseString2List( message, [ " " ], [] );
integer command = llList2Integer( parsed, 0 );
gCommand = command;
llOpenRemoteDataChannel();
}
remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) {
if (type == REMOTE_DATA_CHANNEL) {
gChannel = channel;
llEmail(sends email); //not actual code but sends out an email with the info the c# service requires, this works
state go;
}
}
}
state go {
remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) {
if (type == REMOTE_DATA_REQUEST) {
if (sval != ""
{
llSay(0, sval);
}
}
}
state_exit() {
llCloseRemoteDataChannel(gChannel); // clean up when you no longer want to handle requests
}
}
Also with this script my items have started to be returned to lost and found by the sim quite quickly, this wasn't happening previously.
I would be very grateful if one could advise.
Thanks
Richard.