Difference between revisions of "User:Ugleh Ulrik"
Ugleh Ulrik (talk | contribs) |
Ugleh Ulrik (talk | contribs) |
||
Line 36: | Line 36: | ||
Below are some User-Defined functions I have created and use in most of my items. Some other scripters have helped out with improvements on some if you go to the discussion section for the "More at" links. | Below are some User-Defined functions I have created and use in most of my items. Some other scripters have helped out with improvements on some if you go to the discussion section for the "More at" links. | ||
=== Vector2List === | === Vector2List === | ||
< | <source lang="lsl2"> | ||
list Vector2List(vector v){ | list Vector2List(vector v){ | ||
return [v.x, v.y, v.z]; // *Tips a wink to Strife* | return [v.x, v.y, v.z]; // *Tips a wink to Strife* | ||
} | } | ||
</ | </source> | ||
More at [[User:Ugleh_Ulrik/Vector2List]] | More at [[User:Ugleh_Ulrik/Vector2List]] | ||
=== FirstName === | === FirstName === | ||
< | <source lang="lsl2"> | ||
string FirstName(key k){ | string FirstName(key k){ | ||
list fn = llParseString2List(llKey2Name(k),[" "],[]); | list fn = llParseString2List(llKey2Name(k),[" "],[]); | ||
Line 51: | Line 51: | ||
return firstn; | return firstn; | ||
} | } | ||
</ | </source> | ||
More at [[User:Ugleh_Ulrik/FirstName]] | More at [[User:Ugleh_Ulrik/FirstName]] | ||
=== LastName === | === LastName === | ||
< | <source lang="lsl2"> | ||
string LastName (key k){ | string LastName (key k){ | ||
list ln = llParseString2List(llKey2Name(k),[" "],[]); | list ln = llParseString2List(llKey2Name(k),[" "],[]); | ||
Line 61: | Line 61: | ||
return lastn; | return lastn; | ||
} | } | ||
</ | </source> | ||
More at [[User:Ugleh_Ulrik/LastName]] | More at [[User:Ugleh_Ulrik/LastName]] | ||
=== StringTruncate === | === StringTruncate === | ||
< | <source lang="lsl2"> | ||
string trimstring(string text, integer length) { | string trimstring(string text, integer length) { | ||
if (length < llStringLength(text)){ | if (length < llStringLength(text)){ | ||
Line 76: | Line 76: | ||
} | } | ||
} | } | ||
</ | </source> | ||
More at [[StringTruncate]] | More at [[StringTruncate]] | ||
=== GiveBulkMoney === | === GiveBulkMoney === | ||
< | <source lang="lsl2"> | ||
GiveBulkMoney(list u, integer amount){ | GiveBulkMoney(list u, integer amount){ | ||
integer a = 0; | integer a = 0; | ||
Line 89: | Line 89: | ||
} | } | ||
} | } | ||
</ | </source> | ||
More at [[User:Ugleh_Ulrik/GiveBulkMoney]] | More at [[User:Ugleh_Ulrik/GiveBulkMoney]] | ||
Revision as of 17:57, 13 July 2015
- Avid Programmer
- LSL
- PHP
- MySql
- C#
- CSS
- Javascript/jQuery/ajax
About
Im just your average Ugleh. I hang out in SL, helping the scripting groups with my knowledge. I script weapons, utilities, games, and pretty much anything. I can script projects for free if simple, if not id ask for some lindens.
Second Life Marketplace
Ugleh's Essentials Marketplace Store I sell stuff that I make, and most of the stuff is freebies. I usually make stuff people request more then selling products.
UD Functions
Below are some User-Defined functions I have created and use in most of my items. Some other scripters have helped out with improvements on some if you go to the discussion section for the "More at" links.
Vector2List
list Vector2List(vector v){
return [v.x, v.y, v.z]; // *Tips a wink to Strife*
}
More at User:Ugleh_Ulrik/Vector2List
FirstName
string FirstName(key k){
list fn = llParseString2List(llKey2Name(k),[" "],[]);
string firstn = llList2String(fn,0);
return firstn;
}
More at User:Ugleh_Ulrik/FirstName
LastName
string LastName (key k){
list ln = llParseString2List(llKey2Name(k),[" "],[]);
string lastn = llList2String(ln,1);
return lastn;
}
More at User:Ugleh_Ulrik/LastName
StringTruncate
string trimstring(string text, integer length) {
if (length < llStringLength(text)){
length = length-1;
string newstring = llGetSubString(text,0, length) + "...";
return newstring;
}else{
return text;
}
}
More at StringTruncate
GiveBulkMoney
GiveBulkMoney(list u, integer amount){
integer a = 0;
while(a < llGetListLength(u))
{
llGiveMoney(llList2Key(u,a), amount);
++a;
}
}
More at User:Ugleh_Ulrik/GiveBulkMoney
Other Functions
ListKeyCase
User:Ugleh_Ulrik/ListKeyCase Changes the Key Case of the list, based off a PHP function called array_change_key_case.
Random String
RandomString Creates a random string, 2 examples 1 with strings and numbers, and 1 with just strings.
Time Ago
TimeAgo a function to set "time ago", i.e '3 minutes ago'.
DialogPlus
DialogPlus Dialog plus is a function that creates a dialog menu that will use more then 12 buttons.
ListAverage
ListAverage ListAverage will take all the integers from a list and return the average of all the integers.
GradientValue
GradientValue GradientValue will take 2 vectors, beginColor, and endColor, and a percentage, and grab the color between those two based off the percentage given.
TrimList
TrimList TrimList will do the final process of trimming a whole list before its output in a dialog box.