ID:179406
 
I want to have it so like, lets say they are in a webpage, and they have to choose A B C D and they choose A, i want to have it so that a variable called A goes up one

and i want to have like a variable, like,
Background="Green"
Text="Blue"

and in the web page, the text is the color of whatever text is set as, and the background is whatever the background is.
mob/var/webpagehtml = ""
mob/verb/MakeWebPage()
var/bgcolor = input("What color should be bg be?") in list("Red","Blue","Green","Black","White")
var/textcolor = input("What color should the text be?") in list("Black","White")
webpagehtml = "<body bgcolor='[bgcolor]' text='[textcolor]'>"

There you go! Expand on that and you'll be running in no time.
In response to Lord of Water
i want to have it so there is a webpages that can be affected by variables made in the game like
var/BGCOLOR="Green"
var/TEXT="blue"



and in the webpage it would call for them variables like
<body background="BGCOLOR" text="TEXT">
In response to dbz73
That's what that code did, you have to use browse().
In response to Nadrew
I think he means coding in html purely and not DM, which is basically impossible unless you use java or other things like that.
In response to Ebonshadow
Sure, you can do that. Use javascript:

<html>
<head>
<script>
function PrintBody(bgcolor,textcolor)
{
document.write("<body bgcolor='" + bgcolor + "' text='" + textcolor + "'>)
}
</script>
</head>
<script>
PrintBody("black","white")
</script>


I think that should work.
In response to Lord of Water
Lord of Water wrote:
Sure, you can do that. Use javascript:

> <html>
> <head>
> <script>
> function PrintBody(bgcolor,textcolor)
> {
> document.write("<body bgcolor='" + bgcolor + "' text='" + textcolor + "'>)
> }
> </script>
> </head>
> <script>
> PrintBody("black","white")
> </script>
>

I think that should work.

Thats what i said. You cant do it unless you use "java or something".
In response to Ebonshadow
i want to mix HTML and DM together like they click something, and A=5, and the click a thing and A gets 1 added to it. and when they click another thing, it brings them to a differnt page and that has its own variables, and say they go from one thing to another and then their HP goes up 3 or something
In response to dbz73
there is a library that does that, its the html form library, you should check it out. The browser, and byond, can talk directly to each other, although im not sure how. You would have to check out the library.

FIREking
In response to dbz73
There's a few procs for this, but you can't just use a .html page for it here's an example code:

mob/verb/Browser()
usr<<browse("Click <a href=?aone>A1</a> to get something")

client/Topic(href)
if(href == "aone")
mob<<"Okay, I lied you don't get anything.."
In response to Nadrew
I have a question on this because i am doing something like your example Nadrew, but using vars like:

list2+=" [hubentry2]"

and having the usr choose tha vars, but it wont work all the way. anything i put as the hubentry doesnt work it liks to my C: drive and comes up Page unavailable. Anyone know why?