ID:146973
 
This is the verb code, it's finding an error with my dividing on line 8

[edit] rid of the goto(I am too newbish to use it anyways, I can't use it properly :P ((Please excuse any newbishness in this))
mob
host
verb
Set_Shutdown_Time()
set category = "Host"
var/A = input("Please insert amount of time(in minutes) until you want the server to go down.")as null|text
if(!A)
return
if(A == 0)
src << "The time must be greater than 0."
var/B = A / 600 / 2 //This line
var/C = B * 600 // And this line
sleep(B)
world << "The world is going down [C] minutes from now."
sleep(B)
world << "The world is shutting down in 10 seconds."
sleep(10)
world.Del()
return


Does anyone see anything wrong with my dividing?

Also, how would I make it see if A is not a number? so I can put an if() statement in there saying if it's not a number, then goto start:
I think the first priority is to forget about the math, and get rid of that goto abuse. The goto command should not be used for simple loops.

Considering a handy cancel option would be a good idea, you should lose the loop altogether and just bail out if(!A), immediately after calling input().

Lummox JR
In response to Lummox JR
Aiight, thanks Lummox, well, i'm off to find a way to do this, later all :P
In response to Lenox
Simple. You're asking the player for a text string, then later trying to divide a text string by a number. The input() that defines A should be as null|num, not as null|text.

~X
In response to Xooxer
Ok, thank you, I'll try that.

[edit]
It worked, Thank you very much.

[editx2]
lol! turns out I remembered the math wrong. I was thinking that Milliseconds x 600 = seconds, when it's really seconds x 600 = milliseconds( I believe it was milliseconds), So I was doing all of this unecessary stuff until just now when I realized.