ID:147776
 
It dusent work. The telafone used to work now wen you touch it it dusent do enything! It dusent make eny errors, it just dusent work! Duble-clicking shows the corect informasen, but wen you bump into it nuthing hapens! Plese help me to fix this.

I also want to no how to do it so that wen you start a box cums up that has a grid uv colors and also a box for enter HTML colors, and you can click on a color or make up yor own, and wen you make up yor own it checks to make ser that you ar not cheeting.

// ** In controls.dm **

world
mob=/mob/player
atom
movable/animate_movement=0
proc/BumpInto(osrc)
var/owner=MASTER_KEY

mob
player
text="<font color=#FFFFFF>@</font>"
density=1
var
started=0
helth=100
ammo=0
gems=0
score=0
Login()
if(started==0)
text="<font color=#"+input("Select color (HTML format, \
rrggbb without #)"
)+">@</font>"
loc=locate(/turf/Flor/start_pos)
started=1
Bump(Blockage) // Wat hapens wen you touch a object
Blockage:BumpInto(src)
Stat()
statpanel("Inventory",src.contents)

// ** In objects.dm **

telafone //***
density=1
text="<font color=#019A01>)"
DblClick()
usr << browse("Telafone Number: [tag]<br>\
Pick Up:
[pickup]<br>Uther Telafone: [utherfone]")
var
utherfone=null
pickup=0
New()
tag="telafone_"+copytext(name,2)
name="telafone"
return ..()
proc
ringing(fromcall)
utherfone=fromcall
pickup=0
view(src) << "The telafone is ringing!"
for(var/i=0,i<8,i++)
text="<font color=#C1FAC1>)"
view(src) << 'telafone.wav'
sleep(7)
text="<font color=#019A01>)"
if(pickup==1)
view(src) << "[usr] picked up the telafone"
return 1
sleep(7)
if(pickup==1)
view(src) << "[usr] picked up the telafone"
return 1
view(src) << "It ring to much times and now it\
atomaticly hang up<br>"

view(utherfone) << "It ring to much times and now it\
atomaticly hang up<br>"

utherfone:pickup=0
utherfone:utherfone=null
utherfone=null
BumpInto(osrc)
if(pickup==0 && utherfone==null)
var/hu_to_call=input("Wat telafone number do you want to call?")
if(hu_to_call=="") return 0
var/call_object=locate("telafone_"+hu_to_call)
if(!call_object)
osrc << "Ther is no such telafone number as that!"
return 0
osrc << "You ar calling [hu_to_call] on the telafone"
utherfone=call_object
pickup=1
call_object:ringing(src)
return 0
if(pickup==0 && utherfone!=null)
osrc << "You pick up telafone"
view(1,utherfone) << "Thay pick up telafone"
pickup=1
return 0
if(pickup==1)
var/wat_to_say=input("Wat do you want to say? (+++ to hang-up)")
if(wat_to_say=="") return 0
if(wat_to_say=="+++")
view(utherfone) << "Thay hang up."
utherfone:pickup=0
utherfone:utherfone=null
pickup=0
utherfone=null
osrc << "You hang up."
return 0
osrc << "You say \"<u>[wat_to_say]</u>\" on the telafone"
view(1,utherfone) << "Thay say \"<u>[wat_to_say]</u>\
\" on telafone"

return 0

// ** In telafone.dm **

obj/telafone
t000000;t000001
You really need to make an effort to communicate properly if you expect anyone to help you. You're not spelling this way because you don't know English; if you were, you'd have picked up a little bit by now. Seriously, man, this has gotten to be a problem and nobody's going to help you if they can barely understand you.

It will also help to use more than one space to represent a tab in your code; I recommend using at least two spaces.

Lummox JR
In response to Lummox JR
I use 6 :D

~Ease~
It seems to work fine, despite the phone numbers not making much sense. When you make a phone call, you are calling locate("telafone_"+hu_to_call), so it is adding the "telaphone_" prefix to the number automatically, so if you just type in the ending of the phone number, it should work. However, in the phone's New() proc you set its tag to tag="telafone_"+copytext(name,2), which doesn't seem to make much sense. The phone number of all phones would then be "elafone". Since each phone has the same number, it always calls the same phone. Also, you can call your own phone's number, so that may cause some problems.

I am not sure what you mean about somebody cheating when typing in an HTML tag. You could check the length of the string, and you could check that the letters and numbers are valid hex digits.

Lummox, I do not always disagree for the fun of it. Though it is fun, its purely coincidental. I don't think the community guidelines specify that posts have to meet your spelling and grammar standards. So, if you can't understand someone's post, then ask them to clarify, or, in the event that you have nothing useful to contribute to the thread, don't post. Even if the bad spelling is some sort of gimmick, what difference does it make?
In response to OneFishDown
OneFishDown wrote:
Lummox, I do not always disagree for the fun of it. Though it is fun, its purely coincidental. I don't think the community guidelines specify that posts have to meet your spelling and grammar standards. So, if you can't understand someone's post, then ask them to clarify, or, in the event that you have nothing useful to contribute to the thread, don't post. Even if the bad spelling is some sort of gimmick, what difference does it make?

If you have further comments on that particular side issue that was brought up in another thread, it'd make more sense to do so there.

But bad spelling as a gimmick is not doing these forums any good. Zzo is deliberately making his posts near-incomprehensible, which makes them more or less dead weight on the forums. And going by his posting volume, that's a lot of dead weight.

This is not just a newbie who's having trouble making himself clear, who can be (and usually is) taught to express himself better for the good of all involved. This is someone who's obfuscating in every post just to be cute. Nobody expects people in an online group to have perfect spelling or grammar, but we do expect them to communicate with the group on a civilized level. Polluting the forums with gibberish on purpose does not help that, nor does it help the people who actually are learning English as a second language. The community standards can be summed up by respect, which includes respecting the forum's users enough to try to communicate meaningfully with them.

Lummox JR
In response to Ease
http://developer.byond.com/hub/Crashed/ - Look for my phone demo. OneFishDown, Anarchy Robot, nice try, you fooled us all.
In response to OneFishDown
OneFishDown wrote:
It seems to work fine, despite the phone numbers not making much sense.
:: No, it dusent work properly! Wen the player mob bumps into the telafone object (or actely eny object at all), it dusent do enything!

When you make a phone call, you are calling locate("telafone_"+hu_to_call), so it is adding the "telaphone_" prefix to the number automatically, so if you just type in the ending of the phone number, it should work. However, in the phone's New() proc you set its tag to tag="telafone_"+copytext(name,2), which doesn't seem to make much sense. The phone number of all phones would then be "elafone". Since each phone has the same number, it always calls the same phone. Also, you can call your own phone's number, so that may cause some problems.
:: No, I never put direct telafone objects on the map, only sub-types, such as t000000 and t000001. I checked that the tags ar corect bi duble-clicking.

I am not sure what you mean about somebody cheating when typing in an HTML tag. You could check the length of the string, and you could check that the letters and numbers are valid hex digits.
:: But I also want to make a form that you can ether click on a color to select it, or type in a HTML color code. So that you can choose a color for the at sine that represents were yor caracter is on the map.

In response to Crashed
Well, I'm glad I'm not the only one to pick up instantly on the obvious, but in the interest of fairness I don't think OFD was trying to fool anyone.

[edit]
On taking a look at that demo, I don't see many similarities with Zzo's code although it does look like the latter was built using the demo as a guide. You'd do well though to change usr to src in your Logout() proc, since Logout() is not usr-safe.

Lummox JR
In response to Zzo38computer
I don't understand the purpose of the phone objs, but the phone mobs seemed to work pretty well. And for the color selection, Flick made a nice color selection thingy. However, if you want to also allow people to type in a value, then I'd suggest using an HTML form. With a little HTML and JavaScript it shouldn't be too hard.