I'm passing valid keys to a code snippet for both llInstantMessage and llGiveMoney and both refuse to accept the keys. Has anyone else had this problem or am I just doing something woefully incorrect?
myAuthors is a previously defined list of strings ( I am retrieving keys from a notecard).
amount is a previously defined amount of money.
CODE
integer numberOfPeople = llGetListLength(myAuthors);
// Amount each person gets
integer amountPerPerson = amount / numberOfPeople;
// Index of person's key in list.
integer personIndex = 0;
// For every person in the list:
for (personIndex = 0; personIndex < numberOfPeople; personIndex++)
{
// Get the person's key
key personKey = (key)llList2String(myAuthors, personIndex);
llWhisper(0, (string)personKey);
// If person is not owner
// (paying the owner of the object would be redundant)
if (llList2Key(myAuthors, personIndex) != llGetOwner()) {
llInstantMessage(llList2Key(myAuthors, personIndex), ". Your share is L$" + (string)amountPerPerson + ".");
llGiveMoney(llList2Key(myAuthors, personIndex), amountPerPerson);
}
}
it compiles and it should do everything I want it to... I even have it whisper the key it's going to use so I can make sure it'll work right. But it just won't. They both come back and say it's invalid key. Yet I copy and paste the 'invalid key' into a simple script that pays money or sends messages (using the key directly) and it works fine. So seriously, wtf. Is this a type conversion problem or something?