Difference between revisions of "User:Ugleh Ulrik"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div style="position: relative;"><div align="center">
{{skills
{| cellspacing="0" cellpadding="0" border="0"
|Builder=
|colspan="3"|<imagemap>
|Scripter=*
Image:Ugleh_chat_top.png
|}}
poly 0 [[User:Ugleh Ulrik]]
{{ISO_639-3/cat-speaking|eng}}
desc none
</imagemap>
|-
|<imagemap>
Image:Zai_chat_left.png
poly 0 [[User:Ugleh Ulrik]]
desc none
</imagemap>
|style="background:#243f6a;" valign="top" width="394" align="left"|{{:User:Ugleh_Ulrik/quote}}
|<imagemap>
Image:Ugleh_chat_right.png
poly 0 [[User:Zai Lynch]]
desc none
</imagemap>
|-
|colspan="3"|<imagemap>
Image:Ugleh_chat_bottom.png|
poly 0 [[User:Ugleh Ulrik]]
desc none
</imagemap>
|-
|}
</div>
</div>
 
 
{{SL-hCard/2.0
|name=Ugleh Ulrik
|image=Ugleh.png
|fields=
Ugleh having fun with a amputee ao.
{{SL-hCard/field|Expertise|
* Avid Programmer
** LSL
** PHP
** MySql
** CSS
** Javascript/jQuery/ajax
}}
}}


=== About ===
=== 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 work for Learn Avatar as a teacher, in return i get a small piece of land to keep my projects including my inworld servers.
Started Second Life in 2009 and has been a scripter since. I rarely make an appearance nowadays. Second Life had its ups and downs but lately it has been a glorified chat room instead of an experience. I wish the best to anyone viewing this page for coding or otherwise.  
I can script projects for free if simple, if not id ask for some lindens, but i never name prices, you name your own price and ill accept what you give me.


__TOC__
__TOC__


=== XStreetSL ===
[https://xstreetsl.com/modules.php?name=Marketplace&MerchantID=704873 Xstreet Link]
On my spare time I do need some linden flow to provide some land for my servers and all around scripting zone where I spend most my time, to do this I sell games and other stuff ive made.


== UD Functions ==
== 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.
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 ===
<lsl>
<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*
}
}
</lsl>
</source>


More at [[User:Ugleh_Ulrik/Vector2List]]
More at [[User:Ugleh_Ulrik/Vector2List]]


=== FirstName ===
=== FirstName ===
<lsl>
<source lang="lsl2">
string FirstName(key k){
string FirstName(key k){
list fn = llParseString2List(llKey2Name(k),[" "],[]);
list fn = llParseString2List(llKey2Name(k),[" "],[]);
Line 74: Line 29:
return firstn;
return firstn;
}
}
</lsl>
</source>
More at [[User:Ugleh_Ulrik/FirstName]]
More at [[User:Ugleh_Ulrik/FirstName]]
=== LastName ===
=== LastName ===


<lsl>
<source lang="lsl2">
string LastName (key k){
string LastName (key k){
list ln = llParseString2List(llKey2Name(k),[" "],[]);
list ln = llParseString2List(llKey2Name(k),[" "],[]);
Line 84: Line 39:
return lastn;
return lastn;
}
}
</lsl>
</source>
More at [[User:Ugleh_Ulrik/LastName]]
More at [[User:Ugleh_Ulrik/LastName]]


=== trimstring ===
=== StringTruncate ===


<lsl>
<source lang="lsl2">
string trimstring(string text, integer length) {
string trimstring(string text, integer length) {
     if (length < llStringLength(text)){
     if (length < llStringLength(text)){
Line 99: Line 54:
}
}
}
}
</lsl>
</source>
More at [[User:Ugleh_Ulrik/trimstring]]
More at [[StringTruncate]]


=== GiveBulkMoney ===
=== GiveBulkMoney ===
<lsl>
<source lang="lsl2">
GiveBulkMoney(list u, integer amount){
GiveBulkMoney(list u, integer amount){
integer a = 0;
integer a = 0;
Line 112: Line 67:
}
}
}
}
</lsl>
</source>
More at [[User:Ugleh_Ulrik/GiveBulkMoney]]
More at [[User:Ugleh_Ulrik/GiveBulkMoney]]


Line 138: Line 93:
ListAverage will take all the integers from a list and return the average of all the integers.
ListAverage will take all the integers from a list and return the average of all the integers.


=== Encryption / Decryption ===
====GradientValue====
<lsl>
[[GradientValue]]
string enc(string source){
GradientValue will take 2 vectors, beginColor, and endColor, and a percentage, and grab the color between those two based off the percentage given.
    string new;
list s1 = ["!", " ","#","$","%","&","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"];
list s2 = ["y","n","C","?","q","Z","d","`","B","u","t","<",";","a","+","J","[","m","7","M","v","I","g","}","i","]","K","L","k","H","W","@","P","Y","4","{","V","Q","x","(","O","X","0","=","T","c","9","[","z","N","r","|","^","!","h","F","3",".","8","/","5","6",">","1","A","~","D","U","p","o","_","$","&","l","*","R","w","S","-","f","G","2","E","e","b","#",":",")","s","%","j"," "];
integer s;
integer l = llStringLength(source);
do
new+= llList2String(s2,llListFindList(s1, [llGetSubString(source,s,s)]));
while(l>++s);
return new;
}
 
string dec(string source){
    string new;
list s2 = ["!", " ","#","$","%","&","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"];
list s1 = ["y","n","C","?","q","Z","d","`","B","u","t","<",";","a","+","J","[","m","7","M","v","I","g","}","i","]","K","L","k","H","W","@","P","Y","4","{","V","Q","x","(","O","X","0","=","T","c","9","[","z","N","r","|","^","!","h","F","3",".","8","/","5","6",">","1","A","~","D","U","p","o","_","$","&","l","*","R","w","S","-","f","G","2","E","e","b","#",":",")","s","%","j"," "];
integer s;
integer l = llStringLength(source);
do
new+= llList2String(s2,llListFindList(s1, [llGetSubString(source,s,s)]));
while(l>++s);
return new;
}
 
default
{
 
    touch_start(integer total_number)
    {
        string encoded = enc("Hello There");//encoding the string "Hello There"
        llSay(0, encoded);//Outputting it
        string decoded = dec(encoded);//Decoding the encoded text, returning back "Hello There"
        llSay(0, decoded);//Outputting it
    }
}
 
</lsl>
 
== Contributions ==


{|{{prettytable}}
====TrimList====
|+
[[TrimList]]
|-{{Hl2}}
TrimList will do the final process of trimming a whole list before its output in a dialog box.
!function
!purpose
|-
|| [[Google_Translator]] || Translates Spanish to English and as long as you know the language abbreviations you can make it translate anything to anything.
|-
|| [[:Category:LSL_User-Defined_Functions]] || UD Functions category, to provide a list of custom functions.
|-
|| [[User:Ugleh_Ulrik/Name2Key | PHP Name2Key]] || Here you will get a php file to grab Name2Key via a off-world server. I made this using curl then saw someone made one that looked alike, so go figures.
|-
|}

Latest revision as of 18:09, 3 March 2020


About

Started Second Life in 2009 and has been a scripter since. I rarely make an appearance nowadays. Second Life had its ups and downs but lately it has been a glorified chat room instead of an experience. I wish the best to anyone viewing this page for coding or otherwise.


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.