[Mudlet]Raise and lower hood via gmcp

JonathinJonathin Retired in a hole.
edited December 2012 in Curing Systems and Scripts
This is just a random thing I wrote up because I wanted to raise and lower my hood depending on whether or not I am indoors. 

Script name: hooding
Event handler: gmcp.Room.Info
Script:

function hooding()

  if table.contains(gmcp.Room.Info.details,"indoors") == true then

    if hood == true then

      send("lower hood")

    end

  else

    if hood == false then

      send("raise hood")

    end 

  end

end




Trigger pattern(beginning of the line substring): You carefully lower the hood on

Script: hood = false


Trigger pattern(beginning of the line substring): You carefully raise the hood on

Script: hood = true




Just copy and paste into the appropriate places (script goes into scripts, and triggers go into triggers). Don't copy the yellow highlighted stuff.

Not sure why some of the text is not the same color as the background, I tried removing formatting, and pretty much every other highlight color.



I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.

Comments

  • edited December 2012
    Jonathin said:

    Not sure why some of the text is not the same color as the background, I tried removing formatting, and pretty much every other highlight color.

    If you copy and paste something, it shows up with a white background instead of the normal greyish forums background.
    image
  • I copied like it says, it fails to raise and lower hood.
  • JonathinJonathin Retired in a hole.
    Well, you'll need to raise or lower the hood manually first. I didn't actually set the variable in the script.
    I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.
Sign In or Register to comment.