Second Life Copybot
Camp Chair Get L$ - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: Business Scripts (https://secondlifecopybot.com/forum-44.html)
+----- Thread: Camp Chair Get L$ (/thread-609.html)



Camp Chair Get L$ - steadymobbin - 02-18-2013

PHP Code:
integer campmoney 0;
integer campadd 1// Amount for each camp time finished (L$).
integer camptime 900// Camp time for get the amount (seconds).

string sittext1 "Sit here for free money\nL$";
string sittext2 =  " every 15 minutes"// Change this line when you change the camp time (15mn = 900s).
string camptext "Paying L$1/15min.... Money: "// Change this line when you change the camp time and amount.
string piesittext "Camp";
string sittext;
string reciever;


default
{
    
state_entry()
    {
        
sittext sittext1 + (string)campadd sittext2;
        
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
        
llSetText(sittext, <0.01.00.0>, 1);
        
llSitTarget(<0.00.00.6>, ZERO_ROTATION);
        
llSetSitText(piesittext);
    }
    
on_rez(integer start_param)
    {
        
llResetScript();
    }
    
changed(integer change)
    {
        if (
change CHANGED_LINK)
        {
            if (
llAvatarOnSitTarget() != NULL_KEY)
            {
                
reciever llAvatarOnSitTarget();
                
llSetText(camptext + (string)campmoney, <0.01.00.0>, 1.0);
                
llSetTimerEvent(camptime);
            }
            else
            {
                
llGiveMoney(recievercampmoney);
                
reciever "";
                
campmoney 0;  
                
llSetText(sittext, <0.01.00.0>, 1.0);
                
llSetTimerEvent(100000000);
            }
        }
    }
    
timer()
    {
        
campmoney campmoney campadd;
        
llSetText(camptext + (string)campmoney, <0.01.00.0>, 1.0);
        if (
llAvatarOnSitTarget() != NULL_KEY)
        {
        }
        else
        {
            
reciever "";
            
campmoney 0;  
            
llSetText(sittext, <0.01.00.0>, 1.0);
        }
    }
    
run_time_permissions(integer perm)  
    {
        if(
perm PERMISSION_DEBIT)
        {
            
llSetText(sittext, <0.01.00.0>, 1.0);
        }
        else
        {
            
llSetText("OFFLINE", <1.00.00.0>, 1.0);
            
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
        }
    }