ID:176282
 
var/bckcolor= "green"
client/script = "<STYLE>BODY {background: [bckcolor]; color: silver}</STYLE>"

mob/verb/color(t as text)
bckcolor= t


What im trying to do is make a verb towhere the user can change the background color in client. But it will not allow vars in it for some reason. Is there another way to resolve around?

Something can not be set to a variable at compile time. You need to set client/script at runtime.
In response to Garthor
How would that be done? I really don't see a way through
In response to Jacob
Iv'e just ran into another problem.
        Background(T as text)
set category = "Host"
if(usr.key == host)
client << "<STYLE>BODY {background: [T]; color: silver}</STYLE>"
color= T
else
usr << "You can't"


At first I thought it worked but when when someone talks the background goes back to white =-\
Try something like this..

var/bckcolor="green"
client
proc/Updatescript()
style = "<STYLE>BODY {background: [bckcolor]; color: silver}</STYLE>"
New()
..();Updatescript()

mob/verb/color(t as text)
usr.client.bckcolor=t


This snippet is doing what you wish, although I would have people pick from a list of colors in the color verb instead of typing it in.

(This would provide a better chance of people not familiar with HTML, picking a correct color.)

Also I would make bckcolor a client variable instead of a global one.

Lance
...Guardian of Dragons...
In response to Dragon Guardian
Yeah I plan on having a list but right now im just trying to figure out to get this to work.

Hmm that one doesn't seem to be working for me either I have errors
In response to Jacob
Jacob wrote:
Iv'e just ran into another problem.
>       Background(T as text)
> set category = "Host"
> if(usr.key == host)
> client << "<STYLE>BODY {background: [T]; color: silver}</STYLE>"
> color= T
> else
> usr << "You can't"

At first I thought it worked but when when someone talks the background goes back to white =-\

well you can just set that to a variable and display it everytime.
mob/var
style
color = "black" //bg color
tcolor = "white" //text color
mob/New()
style = "<STYLE>BODY {background: [src.color]; color: [src.tcolor}</STYLE>"


//good to have a list of players
<dm>var/list/Players = list()
mob/Login()
Players += src
..()
mob/Logout()
Players -= src
del(src)

then for a say verb
mob/verb/Say(T as text)
Players << "[style] [usr] says [T]"

that might work.