Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Simple Anti Camp Bot Camp Script

Flater Baxter
Registered User
Join date: 23 May 2007
Posts: 48
10-08-2007 04:39
its a normal campscript till the av stands up
then he/she will get a word trough dialog, they then have to press the button with the same label.

they have 2 try's to answer the question, and 30 sec, ofcourse you can mod this.

I made this script becouse i saw i had allot of camp-bots/camping bots, and i like to give money to people who gonna spend it in sl, good for the economy, I dont want to give money to people who have allot of bots. and want to make money this way.

so an anti camp-bot script with no extra's(chat listners etc), just a simple check on cashout.

I hope you can use it.

From: someone


//JUST AN OTHER CAMPSCRIPT, MOD BY FLATER BAXTER///
//////////////////////
////CAMP SETTINGS/////
//////////////////////

integer mins = 1; //MINS
integer amount = 2; // LINDENS

//////////////////////
//////////////////////

list list_check = ["APPLE","BIRD","CAKE","EAL","FRUIT","GOTH","HOT","IRIS","NUMBER"];
integer count;
integer minutes;
integer cash = 0;
integer Max_Cash = 0;
integer counter = FALSE;
key user;
key payee;
string sitting ;
string dsitting ;
integer show = TRUE;
integer clen;
integer cnr;
string qw;
integer chk;
integer chan5 ;

vector color = <1,0,0>;
integer plus = 0;
integer chan ;
list parceld;
list parcelo= [PARCEL_DETAILS_NAME, PARCEL_DETAILS_DESC];
string parceln;
vector regionbase;


RefreshText()
{

llSetText("Sit here for
"+(string) amount+" L$s Per. " +(string) mins+" Mins

.
.
.
.
.
.",color,1);
}



RefreshText1()
{

llSetText("

"+sitting+"
Has made: "+(string) cash+" L$s
by sitting for: "+(string) count+" mins

"+(string) amount+" L$s Per. " +(string) mins+" Mins

.
.
.
.
.
.",color,1);


}

integer charge=0;
integer Ready=FALSE;

default
{
state_entry()
{
llSetText("INACTIVE",<1,0,0>,1);
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_DEBIT)
{
state one;
}
else
{
llOwnerSay("You need to give premisions";);
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
}
}
}

state one
{
state_entry()
{

RefreshText();
parceld= llGetParcelDetails( regionbase, parcelo);
parceln=llStringTrim( llList2String(parceld ,0),STRING_TRIM);


}

on_rez(integer tot_num)
{
llResetScript();
}


changed(integer change)
{
if (change & CHANGED_LINK)
{
user = llAvatarOnSitTarget();

llMessageLinked(LINK_SET,0,"on",NULL_KEY);


if (user != NULL_KEY) {
counter = TRUE;
color = <1,0,0>;
sitting = llKey2Name(user);
llSetTimerEvent(60);
RefreshText1();
payee = user;
}

else
{
counter = FALSE;
sitting = dsitting;
if (cash>0){
state pay;


}
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;


llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();

}

}

}
timer()
{
if(counter == TRUE)
{
count += 1;
plus += 1;


if(plus == mins)
{
cash += amount;
plus = 0;



}


RefreshText1();

}
}
}
state pay
{
state_entry()
{
clen =llGetListLength(list_check);
cnr = llFloor(llFrand(clen));
qw = llList2String(list_check,cnr);
llSetText("In Use, \n please wait 30 sec.",<1,0,0>,1);
llSetTimerEvent(30);
chan5 = llFloor(llFrand(99999.1000));
llListen(chan5,"",payee,"";);
llDialog(payee,"\n SELECT THIS WORD IN THE MENU BUTTONS: \n \n"+qw + "\n \n",list_check,chan5);

}
listen(integer channel, string name, key id, string message)
{
if(message == qw)
{
llGiveMoney(payee,cash);
Max_Cash += cash;
llSay(0,llKey2Name(payee)+" got " +(string) cash+ "L$s, Just for lounging here at "+ parceln);
/////////////////
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;


llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
chk = 0;
state one;
}
else {
llSay(0,"Wrong answer, please try aggain";);
chk += 1;
if(chk <= 1) llDialog(payee,"\n SELECT THIS WORD IN THE MENU BUTTONS: \n \n"+qw + "\n \n",list_check,chan5);

if (chk == 2)
{
llSay(0,"Wrong Again, srry cant payout";);
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;


llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
chk = 0;
state one;

}
}}
timer()
{
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;


llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
state one;

}

}
CCTV Giant
Registered User
Join date: 2 Nov 2006
Posts: 469
10-16-2007 06:56
Hey man -- first off thanks for the addition. Keeping Bots to a minimum is a noble cause. However, you might consider place the question on the front end also to avoid even the slightest abuse instead waiting till some damage has been done. Keep them out all together. the second portion of the script is great for catching the resit bots
Xavier Tosung
Registered User
Join date: 12 Sep 2006
Posts: 4
Minor Bug in code
11-23-2007 04:49
Hi, thanks so much for posting the script :) just to let you know you are missing an llSitTarget.... in the state entry of state one. Othersie llAvatarOnSitTarget will allways return a NULL_KEY

Thanks again

Xavier
Flater Baxter
Registered User
Join date: 23 May 2007
Posts: 48
11-23-2007 07:41
you are right, I use a multi pose script for that, so this is just the campscript, not an,sit/animation script. THANKS for letting me know !!!