...again there is a weird error in my script. After a resident payed my machine a llSetTimerEvent is initialised for 180 seconds. But soon after the resident pays the timer event is triggered and the resident gets logged off. This is weird. This error occurs totaly NOT periodic. Some time he does, some time he does not.
I just initialized the llSetTimerEvent() ONCE. With 180s.
Funnily enough it worked when a resident had to touch the terminal, after he payed. In the current version no touch necessary. After he payed he processes.
CODE
touched(key toucher)
{
if (currentUser == toucher || currentUser == NULL_KEY)
{
//llSetTimerEvent(0);
llInstantMessage(currentUser,"You are the current user of this terminal");
name = llDetectedName(0);
integer ch = ChannelFromName(name);
llListen(ch,"",currentUser,"");
}
else
{
llInstantMessage(currentUser,"This system is already in use. ");
}
}
default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
state idle;
}
}
state idle
{
state_entry()
{
resetParameters();
llSetText("",<1,0,0>,1);
llSetPayPrice(PAY_HIDE,[15,30,45,60]);
}
money(key giver, integer amount)
{
name = llDetectedName(0);
integer ch = ChannelFromName(name);
currentUser=giver;
refund = amount;
howlong = ((amount / 15) * 7);
draws = amount/15;
state payed;
}
}
state payed
{
state_entry()
{
integer ch = ChannelFromName(name);
llListen(ch,"",currentUser,"");
llSetTimerEvent(180);
touched(currentUser);
}
listen()
{
...
}
timer()
{
llInstantMessage(currentUser,"Time is up. You were logged off");
llGiveMoney(currentUser, refund);
currentUser = NULL_KEY;
state idle;
}
Thx so much

