THE tip jar

Répondre
Partager Rechercher
Bonjour

je suis en train d'essayer de refaire la JAR des DJ invités

et en gros j'ai deux scripts que j'aimerais fussionner

le premier viens de mon ancienne jar, qu'est vraiment pas mal

// Durée d'émission des particules en secondes
float DELAI = 12;


integer totaldonated;
string owner;
MakeParticles(key keydest)//This is the function that actually starts the particle system.
{
llParticleSystem([ //KPSv1.0
PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them
| PSYS_PART_INTERP_COLOR_MASK //Colors fade from start to end
| PSYS_PART_INTERP_SCALE_MASK //Scale fades from beginning to end
| PSYS_PART_FOLLOW_VELOCITY_MASK //Particles are created at the velocity of the emitter
| PSYS_PART_EMISSIVE_MASK //Particles are self-lit (glow)
| PSYS_PART_TARGET_POS_MASK
| PSYS_PART_WIND_MASK

,PSYS_SRC_PATTERN, 2
,PSYS_SRC_TARGET_KEY, keydest
,PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE,0) //desired particle texture
,PSYS_PART_MAX_AGE, 2.5 //Lifetime, in seconds, that a particle lasts
,PSYS_SRC_BURST_RATE, .5 //How long, in seconds, between each emission
,PSYS_SRC_BURST_PART_COUNT, 2 //Number of particles per emission
,PSYS_SRC_BURST_RADIUS, 1.0 //Radius of emission
,PSYS_SRC_ACCEL, <3.0,3.0,0.0> //Acceleration of particles each second
,PSYS_PART_START_ALPHA, 1.0 //Starting transparency, 1 is opaque, 0 is transparent.
,PSYS_PART_END_ALPHA, 0.0 //Ending transparency
,PSYS_PART_START_SCALE, <.20,.20,.20> //Starting particle size
,PSYS_PART_END_SCALE, <0.15,0.15,0.15> //Ending particle size, if INTERP_SCALE_MASK is on
,PSYS_SRC_OMEGA, <1.0,0.0,0.0> //Rotation of ANGLE patterns, similar to llTargetOmega()
]);
}
default
{
on_rez( integer sparam )
{
llResetScript();
}

state_entry()
{
owner = llKey2Name( llGetOwner() );
llSetPayPrice(100,[50,100,200,500]);
llSetText( "Tip Jar de DJ Raven\nmerci pour votre tip !\nL$0 don de la tip jar",<.25,1,.65>,1);
}

money(key id, integer amount)
{
llSetTimerEvent(DELAI);
MakeParticles(id);
totaldonated += amount;

llSay(0, llKey2Name(id)+ " Merci beaucoup ! ");
llSetText( "Tip Jar de DJ Raven\nTotal des versements " + (string)totaldonated + " L$\nDernier don de "+ (string)amount + " L$ par "+ llKey2Name(id),<.25,1,.65>,1);
llOwnerSay((string)llKey2Name(id)+" a donné " + (string)amount + " L$");
}

timer()
{
llParticleSystem([]);
}
}


le 2éme viens de Menthal Oh, qui m'a donné un coup de main


string profile_key_prefix = "<meta name="imageid" content="";
string profile_img_prefix = "<img alt="profile image" src="http://secondlife.com/app/image/";
integer profile_key_prefix_length;
integer profile_img_prefix_length;
list deftextures;

GetProfilePic(key id)
{
string URL_RESIDENT = "http://world.secondlife.com/resident/";
llHTTPRequest( URL_RESIDENT + (string)id,[HTTP_METHOD,"GET"],"");
}

key DJ;

integer total;

integer ecoute;

key cible;
key texture = "4adac490-323e-9bc0-b29a-fc05c9919743";//mettre ici l' UUID des particules souhaités

poof() {
llParticleSystem([
PSYS_PART_START_COLOR,<1.0,1.0,1.0>, PSYS_PART_END_COLOR,<1.0,1.0,1.0>,
PSYS_PART_START_SCALE, <0.3,0.3,FALSE>, PSYS_PART_END_SCALE, <0.4,0.4,FALSE>,
PSYS_SRC_TEXTURE,texture,
PSYS_PART_START_ALPHA, 0.8, PSYS_PART_END_ALPHA, 0.8,
PSYS_SRC_BURST_PART_COUNT,1,
PSYS_SRC_BURST_RATE,0.6,
PSYS_PART_MAX_AGE, 5.0,
PSYS_SRC_MAX_AGE, 4.0,
PSYS_SRC_PATTERN, 8,

PSYS_SRC_ANGLE_BEGIN, 0*DEG_TO_RAD, PSYS_SRC_ANGLE_END, 2.0*DEG_TO_RAD,
PSYS_SRC_OMEGA, <90,0,0>*DEG_TO_RAD,
PSYS_SRC_BURST_RADIUS, 0.4,
PSYS_SRC_BURST_SPEED_MIN, 2.0, PSYS_SRC_BURST_SPEED_MAX,2.0,
PSYS_SRC_TARGET_KEY,cible,

PSYS_PART_FLAGS,
PSYS_PART_EMISSIVE_MASK
|PSYS_PART_FOLLOW_VELOCITY_MASK
| PSYS_PART_EMISSIVE_MASK
|PSYS_PART_INTERP_COLOR_MASK
|PSYS_PART_INTERP_SCALE_MASK
|PSYS_PART_TARGET_POS_MASK
]);
}


default
{
on_rez( integer sparam )
{
llResetScript();
}

state_entry()
{
llSetText("Tip Jar\nClic pour s 'enregistrer",<1,0,0>,1);
llSetTexture(TEXTURE_DEFAULT,0);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
}

touch_end(integer total_number)
{
DJ = llDetectedKey(0);
state marche;
}
}

state marche
{
state_entry()
{
GetProfilePic(DJ);
profile_key_prefix_length = llStringLength(profile_key_prefix);
profile_img_prefix_length = llStringLength(profile_img_prefix);

llSetText("**Tip Jar de** \n"+ llGetDisplayName(DJ)+"\nL$0 pour l' instant",<0,1,0>,1);
llSetPayPrice(0, [50, 100,200,500]);
}

http_response(key req,integer stat, list met, string body)
{
integer s1 = llSubStringIndex(body, profile_key_prefix);
integer s1l = profile_key_prefix_length;
if(s1 == -1)
{
s1 = llSubStringIndex(body, profile_img_prefix);
s1l = profile_img_prefix_length;
}

if(s1 == -1)
{
llSetTexture(TEXTURE_DEFAULT,0);
}
else
{
s1 += s1l;
key UUID=llGetSubString(body, s1, s1 + 35);
if (UUID == NULL_KEY)
{
llSetTexture(TEXTURE_DEFAULT,0);
}
else
{
llSetTexture(UUID,0);
}
}
}

money(key id, integer amount)
{
total= total + amount;
cible = id;
poof();
llSetText("**Tip Jar de** \n"+ llGetDisplayName(DJ)+"\nL$" + (string)total + " au total\nDernier donateur:\n"+llGetDisplayName(id),<0,1,0>,1);
llInstantMessage(id,"Merci pour le tip!");

integer pourcentage = (integer) llGetObjectDesc();
if(pourcentage <=100)
{
llGiveMoney(DJ,(amount*pourcentage)/100);
}
else
{
llOwnerSay("erreur de pourcentage qui doit être entre 0 et 100 dans la description de l' objet");
}
}

touch_end(integer total_number)
{
if(llDetectedKey(0) == DJ)
{
llListenRemove(ecoute);
ecoute = llListen(-99999, "", DJ, "");
llDialog(DJ, "Voulez-vous vraiment delog?", ["OUI", "NON" ] , -99999);
}
}

listen(integer chan, string name, key id, string msg)
{
if (msg == "OUI")
{
llResetScript();
}
else
{
llListenRemove(ecoute);
}
}
}


alors il y a des bons trucs dans les deux
et j'aimerais fussioner les deux pour ne garder que les bons trucs

1) les particles du 1ér script sont parfaites
2) le fait que le 2éme script montre la photo de profil du DJ, c'est cool
mais quand personne n'est LOG, ça serait cool que ça montre une image par defaut (logo du club) au lieu du bois du prim >> par exemple: e72ee96f-c70f-46d6-543d-e947ec9eede0
3) montrer les noms d'usage c'est parfait (2éme script)
mais.. parfois quand je mix j'ai la tête dans le controleur pendant genre 10 minutes et voila après je regarde SL et tout d'un coup j'ia eu plein de tips, et je sais pas qui m'a tipé...
dans l'ancien script il me suffisait de remonter le chat pour avoir les infos
dans le nouveau j'ai pas cette option
4) l'histoire de pourcentages est supérflue, c'est forcement 100% pour le DJ, il y a pas besoin d'alourdir le script avec d'autres options, c'est toujours 100%
5) en anglais c'est mieux, car tout le monde comprends l'anglais
6) si en plus la jar pouvoir en plus donner un petit cadeau (un giver) ça serait top

Voila si quelqu'un aurait l'amabilité de se pencher sur la question, il ou elle aurait mon éternelle réconnaissance ♥

Dernière modification par *RAV3N* ; 24/10/2020 à 08h58.
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés