Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 06-11-2007, 10:27 PM   #1 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Lightbulb Light Switch (so simple!)

/************ LightSwitch.cs v.2 **********
*
* (C) 2008, Lokai
*
* Description: (Player) house item that
* will turn on BaseLights which are
* locked down. Switch must be locked
* down to use, also. (GameMaster)
* item that will turn on BaseLights
* anywhere in the world that you have
* linked to the Switch.
* Usage: Use the Connect or Disconnect
* context menu to add or remove lights
* from the group of lights that the
* Switch will control. You can link
* an unlimited number of lights.
*
*******************************************/
Light Switch

What is it?

Uh....it turns on the lights in the house.
Version 2 also lets GMs use it anywhere in the world!

How do you add it?

[add LightSwitch (of course, you can also sell them on vendors, etc.)

Installation:

Place in scripts folder anywhere.

As per what Tru said, if you want this to be accessible to anyone, make this change:

in BaseHouse.cs after this
Code:
 
 
else if ( item is Clock )return true;
add this
Code:
 
 
else if ( item is LightSwitch ) return true;
Technical Mumbo Jumbo:

- It is a Flippable Furniture item, so it can be locked down, and turned to be put facing either direction.
- It will switch up(ON) and down(OFF) when double-clicked.
- It will only operate your lights when it is Locked Down.
- It will turn On and Off EVERY light in your house that is also Locked Down.
- It does not check to see if you own the house. (After all, anyone can flip a switch, right?)

EDIT:

Added new download. Check it out.
Attached Files
File Type: zip LightSwitch.zip (833 Bytes, 205 views)
File Type: zip LightSwitch v2.zip (2.3 KB, 80 views)

Last edited by Lokai; 05-08-2008 at 10:30 AM. Reason: fixed bug in connect method
Lokai is offline   Reply With Quote
Old 06-11-2007, 10:37 PM   #2 (permalink)
Newbie
 
Join Date: May 2005
Age: 41
Posts: 84
Default love it

i dont see a download here am i missing something
lordrichard is offline   Reply With Quote
Old 06-11-2007, 11:02 PM   #3 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by lordrichard View Post
i dont see a download here am i missing something
oops!

sorry about that.
Lokai is offline   Reply With Quote
Old 06-11-2007, 11:29 PM   #4 (permalink)
Forum Novice
 
Join Date: Jul 2006
Location: Oklahoma
Age: 30
Posts: 612
Default

Thanks will just add a bit more realism for my shard
oiii88 is offline   Reply With Quote
Old 06-12-2007, 12:17 AM   #5 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 40
Posts: 3,260
Default

Have to edit BaseHouse to be able to use it though.
Tru is offline   Reply With Quote
Old 06-12-2007, 12:21 AM   #6 (permalink)
andrewd
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Tru View Post
Have to edit BaseHouse to be able to use it though.
i dont understand what u need to eddit in base house to use it can u post this please?
  Reply With Quote
Old 06-12-2007, 01:18 AM   #7 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 40
Posts: 3,260
Default

in BaseHouse.cs after this

Code:
else if ( item is Clock )
return true;
add this

Code:
else if ( item is LightSwitch )
	return true;
Tru is offline   Reply With Quote
Old 06-12-2007, 05:40 AM   #8 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Thanks Tru.

I never use "Players" to test these things, just my lonely Owner.

I guess it will only work for the owner of the house unless you make that change.

Oh well.
Lokai is offline   Reply With Quote
Old 06-12-2007, 06:01 AM   #9 (permalink)
Newbie
 
moonrune's Avatar
 
Join Date: Oct 2006
Posts: 55
Default

Work in 1.0? (Sorry, waiting for the official release of 2.0 stable version)

Great work! =)
moonrune is offline   Reply With Quote
Old 06-12-2007, 06:44 AM   #10 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Not sure about 1.0. I never use it any more.

Check out new download.

- Fixed ItemID goof in the Switch.

- Added "clap on", "clap off" support. Please comment this out if you don't like it, but I couldn't resist. It animates and shuts on and off the lights on command.
Lokai is offline   Reply With Quote
Old 06-12-2007, 08:42 AM   #11 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 40
Posts: 3,260
Default

Quote:
Originally Posted by Lokai View Post
Thanks Tru.

I never use "Players" to test these things, just my lonely Owner.

I guess it will only work for the owner of the house unless you make that change.

Oh well.
Nope anyone not access level wouldnt be able to access it. I tried it initially with the owner of a house.
Tru is offline   Reply With Quote
Old 06-12-2007, 11:45 AM   #12 (permalink)
andrewd
Guest
 
Posts: n/a
Default im trying to get it to work for 1.0

im getting 2 errors here any idea what i might need to change
[code]
- Error: Scripts\custom\LightSwitch.cs: CS0117: (line 61, column 17) 'string' d
oes not contain a definition for 'Contains'
- Error: Scripts\custom\LightSwitch.cs: CS0117: (line 66, column 17) 'string' d
oes not contain a definition for 'Contains'
[code]
  Reply With Quote
Old 06-12-2007, 11:51 AM   #13 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by andrewd View Post
im getting 2 errors here any idea what i might need to change
[code]
- Error: Scripts\custom\LightSwitch.cs: CS0117: (line 61, column 17) 'string' d
oes not contain a definition for 'Contains'
- Error: Scripts\custom\LightSwitch.cs: CS0117: (line 66, column 17) 'string' d
oes not contain a definition for 'Contains'
[code]


string.Contains is a valid bool. What version of .Net are you using?
Lokai is offline   Reply With Quote
Old 06-12-2007, 12:27 PM   #14 (permalink)
andrewd
Guest
 
Posts: n/a
Default net framework

5.1.26 version 1.0 runuo
  Reply With Quote
Old 06-12-2007, 01:01 PM   #15 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by andrewd View Post
5.1.26 version 1.0 runuo
5.1.26 is your version of Windows, not .Net.

You are using 1.0 of RunUO. Are you using .NET version 1.1?

If so, that would explain the difference.
Lokai is offline   Reply With Quote
Old 06-12-2007, 01:16 PM   #16 (permalink)
andrewd
Guest
 
Posts: n/a
Default yes sir

1.1 is what im using
  Reply With Quote
Old 06-12-2007, 02:03 PM   #17 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by andrewd View Post
1.1 is what im using
Since you are using XP, I would strongly recommend .NET 2.0. Someone can correct me if I am wrong, but I believe it fully supports the RunUO v1.0 Server.
Lokai is offline   Reply With Quote
Old 06-12-2007, 03:07 PM   #18 (permalink)
andrewd
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Lokai View Post
Since you are using XP, I would strongly recommend .NET 2.0. Someone can correct me if I am wrong, but I believe it fully supports the RunUO v1.0 Server.
actually i was wrong i am using 2.0 because i think i needed to dowmload it to get connect uo to work.
i think it has something to do with 1.0 and the word contains
  Reply With Quote
Old 06-12-2007, 03:42 PM   #19 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by andrewd View Post
actually i was wrong i am using 2.0 because i think i needed to dowmload it to get connect uo to work.
i think it has something to do with 1.0 and the word contains

When you start the Server, it says exactly which versions you are running.

Quote:
Originally Posted by My Console Window
RunUO - [www.runuo.com] Version 2.0, Build 2676.27169
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...
Lokai is offline   Reply With Quote
Old 06-12-2007, 07:22 PM   #20 (permalink)
andrewd
Guest
 
Posts: n/a
Default not showing at startup

Quote:
Originally Posted by Lokai View Post
When you start the Server, it says exactly which versions you are running.
when i start server it dosent say anything about the core net/
  Reply With Quote
Old 06-12-2007, 07:49 PM   #21 (permalink)
Forum Expert
 
Join Date: Jul 2005
Age: 32
Posts: 410
Default Very Nice !!!!!!!!

Very nice script, i installed it and was amazed right away......like: LET THERE BE LIGHT....and click there it IS!
lmao

I have a suggestion;
Maybe have in props for a timer to set on or off and time to set timer to,
also maybe have it where you can alos link them to certain lights instead of all:
so you'd have the choices of decoing diff rooms or even setting a path in a dungeon for players to follow.....
....just some ideas, but i'd love to see those included if you know how and have time to do it.

I dont think i'd be able to script it myself - Mainly because i dont have much time anymore with new job, also dotn think im good enough scripter yet to figure that much out.
__________________
LoveTheGame...ClickHere.
Owner Of SecretsOfClones
Feel free to check it out so far...
wulf monat is offline   Reply With Quote
Old 06-12-2007, 09:30 PM   #22 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by andrewd View Post
im getting 2 errors here any idea what i might need to change
[code]
- Error: Scripts\custom\LightSwitch.cs: CS0117: (line 61, column 17) 'string' does not contain a definition for 'Contains'
- Error: Scripts\custom\LightSwitch.cs: CS0117: (line 66, column 17) 'string' does not contain a definition for 'Contains'
[code]
I suggest you comment out the "clapper" section until you figure another method for comparing strings that is compatible with your version of .NET.
Lokai is offline   Reply With Quote
Old 06-13-2007, 09:09 AM   #23 (permalink)
Forum Novice
 
koluch's Avatar
 
Join Date: Mar 2004
Location: Wisconsin
Age: 45
Posts: 813
Thumbs up Very Nice!

We are just about to hold a House Deco Contest and many players are using types of lighting for effect - this is an excellent item to give each contestant for thier home.
Simple.
Nice.
Enough said!

Koluch
a.k.a - Hater of nightsite and removing the nice glow that was once a valuable part of the feel of UO.
__________________
If the words are coming from someone whos opinion you value, think it over, if not, consider the source.
koluch is offline   Reply With Quote
Old 05-07-2008, 04:24 PM   #24 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Just released v2 of this script:

* Description: (Player) house item that
* will turn on BaseLights which are
* locked down. Switch must be locked
* down to use, also. (GameMaster)
* item that will turn on BaseLights
* anywhere in the world that you have
* linked to the Switch.


* Usage: Use the Connect or Disconnect
* context menu to add or remove lights
* from the group of lights that the
* Switch will control. You can link
* an unlimited number of lights.
Lokai is offline   Reply With Quote
Old 05-08-2008, 09:51 AM   #25 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

I discovered a potential problem in the latest version of the script. It is possible for a mischievous Player to have a bit of fun with this...

If a Player were to carry his LightSwitch around with him, he could link it to BaseLights all over the world, in people's homes, dungeons, anywhere. Now, the Player himself would not be able to affect any of those lights, but if he then installed the switch in his house, and an unsuspecting GM came along, the GM could accidentally ignite or douse all of those lights all over the world by flipping the switch. oops.

** EDIT **

There was also a bug allowing Players to try to flip the switch while it was not in their house, causing Null Reference errors.

The problems have been corrected. New file posted.

Last edited by Lokai; 05-08-2008 at 10:29 AM.
Lokai is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5