ID:162469
 
Well, My announce verb I have made goes on the browser, and not the log, but every time I make an announcement, it resets..

Here's a screen shot of what I meam:
Photobucket

The code I have:
mob/admin
verb
Announce(message as message)
set category = "Staff"
world << browse("<body bgcolor=black><center><hr><br><font color=red><font size=5>[usr] would like to Announce:<br><font size=3><font color=blue>[message]<br><hr></body>")


An edited Screen Shot of what I want it to do:
Photobucket


As you see, I want the old announces to stay on there. Can anyon help me out?

PS. I want the new announcements to go above the old ones.
*cough*4.0 has multiple output control*cough*
You're going to have to store the announcements in a variable, then update the variable when you want to create another announcement. After the announcement, you should update the browser by resending the updated page.
In response to Unknown Person
Unknown Person wrote:
You're going to have to store the announcements in a variable, then update the variable when you want to create another announcement. After the announcement, you should update the browser by resending the updated page.

And how do I store the announcements into a variable?
In response to Howey
Howey wrote:
And how do I store the announcements into a variable?

There are many ways to do it, but the simplest way to do it is with a text string, as the announcements are just text. You'll want to update the variable storing the text every time an announcement is made. When you add a new announcement, you will want to append the new announcement string in front of the current announcement string. Once this is done, you can then output the page with the announcements that you have stored.

Here's a simple example.

var/announcements = "" // string storing previous announcements

mob/verb/make_announcement(t as text)
announcements = t + "<br />" + announcements // append the new announcement in front of the old announcement string, and put a line break between each announcement
var/page = "<html><body>[announcements]</body></html>" // generate a page, and place the announcement text in the body
world << browse(page) // display to world
In response to Unknown Person
Ok thanks, I got that to work.

I do have one more thing I woul like to know how to do.

That is pop ups...

I want to add an MOTD for when people login to my game, but not sure how to do it..


I've tried making it myself, I got this:

//Simple Login for testing!!!
mob
proc
start()
var/cname = input("","What name would you like?") as text|null
if(length(cname) < 2)
alert("Your name must be longer than two characters!")
return
if(length(cname) > 20)
alert("Your name can not be longer than twenty characters!")
return
if(!usr)
return
usr.name="[html_encode(cname)]"
switch(input("Which Race Are you going to be?","Race")in list("Saiyan","Halfbreed","Namekian"))
if("Saiyan")
usr.Race = "Saiyan"
if("Halfbreed")
usr.Race = "Halfbreed"
if("Namekian")
usr.Race = "Namekian"
switch(alert("What base icon?","icon","White","None"))
if("White")
var/icon/T = new('BaseWhite.dmi')
usr.icon=T
if("None")
return
usr.loc=locate(2,2,1)
usr << browse(WelcomeNote)
usr << popup(MOTD)

var/MOTD = "Mesage Of the Day!!"


But this doesn't work...
In response to Howey
If you want to display a popup browser window to a player, you can use the same proc, browse(), except you must specify a window in the text parameters of browse()'s second argument. Look up browse() in the DM Reference, and you'll figure out how to manipulate these windows.

// simple popup browser page
mob/verb/popup()
src << browse("Popup Window", "window=mywindowname")


If you're interested in creating a browser interface in your game, then you can take a look at my 3 part article series on browser interfaces posted at the Dream Makers guild.
In response to Unknown Person
Unknown Person wrote:
If you want to display a popup browser window to a player, you can use the same proc, browse(), except you must specify a window in the text parameters of browse()'s second argument. Look up browse() in the DM Reference, and you'll figure out how to manipulate these windows.

> // simple popup browser page
> mob/verb/popup()
> src << browse("Popup Window", "window=mywindowname")
>

If you're interested in creating a browser interface in your game, then you can take a look at my 3 part article series on browser interfaces posted at the Dream Makers guild.

Ok Thanks alot for your help.