Chat Controlled Light

From GMod Wiki

Revision as of 12:12, 16 November 2011 by [RV] TJjokerR (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: Not what Garry wants the wiki to be used for
Last Edit was made on 11/16/2011



Chat Controlled Light

Chat Controlled Light: Chat Controlled Light
Page white text.png Description:It is a light with 30 preset colors.
link=User:Althalus Original Author:Althalus
Calendar.png Created:April, 9 2009
Page white text.png Notes:All you need is this E2 chip and a wire lamp.


Picture (if you need it?)

Assembly

  1. Create a wire lamp as you wish
  2. Wire the ON input of the lamp to the E2 On output
  3. Red>R
  4. Blue>B
  5. Green>G

Expression 2 Code

@name Light Chat Trig
@inputs 
@outputs On R B G
@persist A:string
@trigger all
#This contains startup presets
if (first())
    {
    R=255
    B=255
    G=255
    On=1
    print("Say 'Light, Help' ")
    }
runOnChat(1)
A=lastSaid()    #Change this to A=owner():lastSaid()  if you do not want other players to be able to make the hints show up on your screen.
if (A=="Light, Help")
    {
        hint("COMMAND LIST",7)
        hint("On - Turns light on",7)
        hint("Off - Turns light off",7)
        hint("Light, (Color) - Turns the light (Color)",7)
        hint("Color List:Red Blue Green White Yellow Purple Orange",7)
        hint("Pink Aqua Real Lblue Dim Navy Indigo Crimson",7)
        hint("Cobalt Slate Teal Aquamarine Spring Emerald Lime Forest",7)
        hint("Beige Banana Gold Flesh Maroon Olive",7)
        hint("There are 30 colors. this chip made by Althalus, it took him roughly 2 hours.",7)
        hint("say 'Light, Credits' for a list of thank you's",7)
    }
if (A=="Light, On") {On=1}
if (A=="Light, Off") {On=0}
if (A=="Light, Red"){R=255 G=0 B=0}
if (A=="Light, Blue"){R=0 G=0 B=255}
if (A=="Light, Green"){R=0 G=255 B=0}
if (A=="Light, White") {R=255 G=255 B=255}
if (A=="Light, Yellow") {R=255 G=255 B=0}
if (A=="Light, Purple") {R=255 G=0 B=255}
if (A=="Light, Orange") {R=250  G=125 B=125}
if (A=="Light, Pink") {R=255 G=125 B=125}
if (A=="Light, Aqua") {R=0 G=255 B=255}
if (A=="Light, Real") {R=255 G=220 B=160}
if (A=="Light, Lblue") {R=125 G=125 B=255}
if (A=="Light, Dim") {R=125 G=125 B=125}
if (A=="Light, Navy") {R=0 G=0 B=128}
if (A=="Light, Indigo") {R=75 G=0 B=130}
if (A=="Light, Crimson") {R=220 G=20 B=60}
if (A=="Light, Cobalt") {R=61 G=89 B=171}
if (A=="Light, Slate") {R=112 G=128 B=144}
if (A=="Light, Teal") {R=0 G=128 B=128}
if (A=="Light, Aquamarine") {R=127 G=255 B=212}   
if (A=="Light, Spring") {R=0 G=255 B=127}
if (A=="Light, Emerald") {R=0 G=201 B=87}    
if (A=="Light, Lime") {R=50 G=205 B=50}      
if (A=="Light, Forest") {R=34 G=139 B=34}   
if (A=="Light, Beige") {R=225 G=225 B=220}
if (A=="Light, Banana") {R=227 G=207 B=87}                       
if (A=="Light, Gold") {R=255 G=215 B=0}             
if (A=="Light, Flesh") {R=255 G=125 B=64}
if (A=="Light, Maroon") {R=128 G=0 B=0}     
if (A=="Light, Olive") {R=142 G=142 B=56}  
if (A=="Light, Credits")
{
   hint("SPECIAL THANKS:",7)
   hint("Boredom - without it I would have never made this",7)
   hint("Tape - inspiration and help.",7)
   hint("ECT",7)
   hint("Made by Althalus, put up for use on wiki.garrysmod.com tutorials.",7)
   hint("Please do not try to take credit for my work.",7)
   hint("I dont go around stealing credit for your work do I?",7)
   hint("Oh right, that's probably because you don't have any! ",7)
}
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox