ID:815584
 
(See the best response by Nadrew.)
Hope this helps!

Here are a few bits of basic code to help out people who have just started learning to code.


OOC verb
mob/verb
OOC()
var text=input("What would you like to say: ")as text
world << "OOC---[src] says:[text]"



Say verb
mob/verb
Say()
var/text=input("What would you like to say: ")as text
view(usr,7) << "[src] says:[text]"



Who verb
mob
verb
Who()//define the proc who
var/PlayerCount//make a var
usr << "<font color = blue size = 4>((-Players Online-))"//just some html
for (var/mob/M in world)//counts a person in the world, labels them M, keeps doing it
if (M.client)//if they're a person
PlayerCount ++//then playercount goes up
usr << "--<font color = white>(player=[M] Key=[M.key])<font color=blue>--"//they get listed
usr << "<font color = red size = 3> ((-[PlayerCount] Players Online-))"//tells how many people are on
world.status = "((-[PlayerCount] Players Online. World Running Version 1.0-))"
/*This last line is something that I've concoted. Everytime someone presses who, it will automatically set
how many players are online on the hub. world.status is shown next to the join button on hubs, so it will
be an accurate description of who is actually online.*/


These are just a few verbs i created for anyone to use in their game, hope they help.

King_Ed
I believe this is the wrong section you are posting in...
I believe this is the correct section as it is Developer Help and what im doing is helping out game developers.
Developer Help is for people who are NEEDING help. This should be posted as a tutorial or demo of some sort.
Ok. A Fourm Moderator will move it to where they think its appropriate!
Best response
Considering all three of those verbs are done the wrong way (yes, there's a wrong way) I don't think it deserves a spot on the tutorial section. In fact, the original poster may need some help figuring out what's wrong ;)

Seems like the right place for that.
In response to Nadrew (#5)
Nadrew wrote:
Considering all three of those verbs are done the wrong way (yes, there's a wrong way) I don't think it deserves a spot on the tutorial section. In fact, the original poster may need some help figuring out what's wrong ;)

Seems like the right place for that.

Well I wouldn't go so far as to call them wrong, although I would agree they aren't tutorial pieces. Wrong is just a little bit harsh and based on your opinion of what is correct, not technically what is correct writing.
The only one that's close to right is Who(), and it's entirely less efficient than it should be. The Say() and OOC() commands are outright wrong, that's not opinion that's fact. I know enough about DM to be able to see when one of the most basic things you can write in the language is done poorly.

They should be using verb arguments instead of input() inside of the verb, especially since the input() in those verbs provides no way to cancel, so people would have no choice but to send something, even if just a blank line.

The Who() should be looping over clients, not every single mob in the world, that's just silly. Instead of using Who() to update world.status he should simply be keeping track of players inside of a list, and updating status as they enter and leave -- the same time he adds and removes them from the list. This would be TONS more efficient and a lot easier to manage.
Whats even more worse is that he is using other people's demo's. His who verb was just copy pasted from this demo: http://www.byond.com/developer/SpikeNeedle/WhoVerb


~Ndangerman