Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Calculator Oddeven_calculator  

Oddeven_calculator

A script which calculates whether or not an integer (non-deciaml nuber) is odd or even. Integers must be above -2147483648 and below 2147483648.

Category: Calculator
By : Blind Paine
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Oddeven_calculator
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Oddeven_calculator_1.lsl
1 //Author: TSL Resident, Blind Paine
2
3 integer number;
4 string pre="mod "; //Set prefix here
5 default
6 {
8 {
9 llListen(0,"",llGetOwner(),"");
10 }
11
12 listen(integer chan,string name, key id,string msg)
13 {
14 if(llSubStringIndex(msg,pre)==0)
15 {
16 number=(integer)llGetSubString(msg,llStringLength(pre),-1);
17 if(number%2==1)
18 {
19 llOwnerSay((string)number+" is an odd number.");
20 }
21
22 if(number%2==0)
23 {
24 llOwnerSay((string)number+" is an even number.");
25 }
26
27 }
28 }
29
30 changed(integer change)
31 {
32 if(change&CHANGED_OWNER)
33 {
35 }
36 }
37 }

Back to the Best Free Tools in Second Life and OpenSim.