Going by Kelly Lindens example, i need to know if failed transactions automatically get paid later or if i need to edit it and if so how would i do that and avoid "double spending", list transactions;
// This is not a complete script and assumes PERMISSION_DEBIT has been granted.
default
{
touch_start(integer n)
{
transactions += [llTransferLindenDollars(llDetectedKey(0),1),1,llDetectedKey(0)];
}
transaction_result(key id, integer success, string data)
{
integer i = llListFindList(transactions, id);
if (i == -1)
{
// Unexpected transaction id!
return;
}
// Extra data for this transaction
integer amount = llList2Integer(transactions,i + 1);
key recipient = llList2Key(transactions,i + 2);
// Cleanup
transactions = llDeleteSubList(transactions,i,i+2);
if (success)
{
// Yay it succeeded
llSay("Gave L$" + (string)amount + " to " + (string)recipient);
}
else
{
// Boo it failed
llSay("Error giving L$" + (string)amount + " to " + (string)recipient + ": " + data);
}
}
}I've tried in the past to use a simplier approach and put in if (!success) llTransferLindenDollars(towhoever,whateveramount); but that created double, triple spending. Any help would be greatly appreciated, thank you.