|
Intolerable Ginsburg
Registered User
Join date: 19 Jul 2006
Posts: 35
|
11-29-2006 00:28
I'm having problems with the following: email(string time, string address, string subj, string message, integer num_left) {
if (message == variable) { do stuff }The problem I'm running into is that message never equals variable, although using llOwnerSay it shows that it is. Always fails and goes to the else statement. Is there something I'm missing about the message portion of email, as I'm not running into this problem with the other variables (at least not with address and subj). Any pointers greatly appreciated. EDIT: Forgot to mention, this email is coming from outside of SL. Same results using numerous mailers. Intolerable
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-29-2006 02:34
From: Intolerable Ginsburg I'm having problems with the following: email(string time, string address, string subj, string message, integer num_left) {
if (message == variable) { do stuff }The problem I'm running into is that message never equals variable, although using llOwnerSay it shows that it is. Always fails and goes to the else statement. Is there something I'm missing about the message portion of email, as I'm not running into this problem with the other variables (at least not with address and subj). Any pointers greatly appreciated. EDIT: Forgot to mention, this email is coming from outside of SL. Same results using numerous mailers. Intolerable Without knowing how complex a message it is its hard to say, but I'd check for spaces, tabs or other 'hidden' differences.
|
|
Dimentox Travanti
DCS Coder
Join date: 10 Sep 2006
Posts: 228
|
11-29-2006 05:34
I have an update script that uses mail.. I think your forgetting the headers. I am not on my computer at home to tell you..
Check the script repository for theautoupdate.. Youll see a function that does mail without headers. and also deleting everything before a cerain keyword.
In mu update script i am searching the message for "DCSU" and when it finds that it deletes that and everything behind it. Therefore leaving message to be what i need it to be.
_____________________
LSL Scripting Database - http://lsl.dimentox.com
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
11-29-2006 06:54
Just to double check...I would hope this isn't the case since you did have it Ownersay successfully, but the global "variable" is a string variable, and not the value, correct?
With the small snippet of code provided my natural assumptions want me to go with the unknown, but most obvious things such as this.
|
|
Intolerable Ginsburg
Registered User
Join date: 19 Jul 2006
Posts: 35
|
11-29-2006 22:22
From: Dimentox Travanti I have an update script that uses mail.. I think your forgetting the headers. I am not on my computer at home to tell you..
Check the script repository for theautoupdate.. Youll see a function that does mail without headers. and also deleting everything before a cerain keyword.
In mu update script i am searching the message for "DCSU" and when it finds that it deletes that and everything behind it. Therefore leaving message to be what i need it to be. I couldn't find the script that you mention, but we did try stripping the headers (although nothing shows up like when sending in-world emails, just whatever is in message), but no luck there. We've tried making the variable global, local to email() and trying to do the conditional statement against the value (message == "whatever"  , all with the same results. Sending messages in-world between objects and from the object to itself using the same script (with header stripping) works, no problem.
|
|
Nynthan Folsom
Registered User
Join date: 29 Aug 2006
Posts: 70
|
12-01-2006 18:15
Just looking at the script I would point to the email headers. The email headers list on separate lines the sending object name, the region name where the sending object is, and the region local position of the sending object, and a blank line. (I think that's it, but I'm not online to check at the moment. You could llSay or llOwnerSay the received message to check for yourself.) You can use llParseString2List with a "\n" in the separator list to explode the received message lines, and then reference the part of the message you want using llList2String.
|