Merry Christmas to 64Digits

Posted by Legolas710 on Dec. 5, 2007, 6:37 p.m.

Merry Christmas to all of the members of 64D! (early though)

I am submitting two examples and two scripts (read on) as presents to you all!

My first example is (currently 5th in the queue) is a Color Picker. This tells you all sorts of interesting information about the color, including the Hex and CMYK. The picker is not the defualt popup!

My second example is a gradient example (currently 22nd in the queue). It isn't very fast, but it does show you how gradients work.

Here are the scripts;

The first script is one that changes things like "Hey there!" to "hEy ThErE!". I'll just quote a post I made about it:

Quote: Me
An example of what this does, is ChIkEn AtE mY dOnUtS username. It makes every other character be uppercase/lowercase. Now I shall explain the arguments.

The usage for this is "i = string_case_change(str,spacecount,first);".

"str" is the string that you want to change.

"spacecount" is whether you want to count spaces or not. What that is meaning, is whether to count spaces as being capitalized or not (e.g. spacecount=true; "hElLo tOdAy!", spacecount=false; "hElLo ToDaY!"). This does need to be "true" or "false".

"first" is meaning whether you want the first letter capitalized or not. This does need to be "true" or "false".

Here is the script.

/*
** usage: i = string_case_change(str,spacecount,first); 
*/

var length,newstring,iii,oldstring;
oldstring=''; 
newstring=string(argument0);
length=string_length(argument0);
if (argument2==true || argument2==false) iii=!argument2;
else iii=false; 
for (j=1; j<real(length+1); j+=1) 
{
   if (string_char_at(newstring,j)==' ' && argument1==false) iii=iii;
   else
   {
	   if (iii==true) { oldstring=string_lower(string_char_at(newstring,j)); newstring=string_delete(newstring,j,1); newstring=string_insert(oldstring,newstring,j); }
	   if (iii==false) { oldstring=string_upper(string_char_at(newstring,j)); newstring=string_delete(newstring,j,1); newstring=string_insert(oldstring,newstring,j); }
	   iii=!iii;
   }
}
return newstring;

Now, here is an example (without spacecount):

Input: Hello! How are you feeling at the moment?

Output: hElLo! hOw ArE yOu FeElInG aT tHe MoMeNt?

I hope you guys enjoy this script

My second one draws a laser:

/*
draw_laser(x1,y1,x2,y2,maxdist);
*/


var x_new,y_new;
dir = point_direction(argument0,argument1,argument2,argument3);
for (line=1; line<argument4+1; line+=1)
{
    x_new = x+lengthdir_x(line,dir);
    y_new = y+lengthdir_y(line,dir);
    if (!place_free(x_new,y_new) || line==argument4)
    {
        draw_set_blend_mode(bm_subtract);
        draw_set_alpha(0.5);
        draw_line_color(x,y,x_new,y_new,c_black-c_red,c_black);
        draw_set_alpha(1);
        draw_set_blend_mode(bm_normal);
        exit;
    } 
}

Have fun with these and enjoy them!

Comments

god 16 years, 4 months ago

There are already ChIkEn Script engines and color pickers.

Polystyrene Man 16 years, 4 months ago

Quote:
Merry Christmas to all of the members of 64D! (early though)
Actually, in some parts of the world, Santa Claus comes on December 6th, so you're right on time. Obviously, Christmas day doesn't officially arrive until the 25th, but we all know the true meaning of Christmas…

Legolas710 16 years, 4 months ago

Yeah, I know.

This color picker is more advanced than most though. ;)

Legolas710 16 years, 4 months ago

Oh! Now I see your comment, Polystryene Man!

That is true. [:D]

poultry 16 years, 4 months ago

<_______________________________________________

_______________________________________________<

Legolas710 16 years, 4 months ago

Nice comment, ChIkEn! XD

PY 16 years, 4 months ago

oNe qUeStIoN ThOuGh, WhY On EaRtH WoUlD I AcTuAlLy(I give uP) want this?

Hands up who has ever used a cPicker?

Legolas710 16 years, 4 months ago

bEcUaSe YoU wAnTeD tO mAkE yOuR gAmE lOoK fUnNy. xD

Oh yeah, and many games have cPickers.

Zac1790 16 years, 4 months ago

Aren't lasers made out of photons (i.e. light) while this script draws a laser that darkens the room? You can see a laser's ending position (dot) on a white surface but you can't see a laser unless the room is dark in real life. Sooo I suggest changing the blend mode