Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 16th Jul 2004 14:17
why isnt this working?

Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 16th Jul 2004 14:32
one other question while im at it.
whats the difference between the randomize timer() and the timer() commands?

and is there a command that sets "timers" on when to place certain things at certain times?

I also figured out my question up top

it was myname$ silly me
Nitro Methane
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Anderson , SC
Posted: 16th Jul 2004 14:32 Edited at: 16th Jul 2004 14:39
Change the myname# to myname$. # is used for real numbers, you have to use the $ symbol for string variables.

Okay.

Tommy
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 16th Jul 2004 14:42
thank you tommy
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Jul 2004 18:33
Quote: "whats the difference between the randomize timer() and the timer() commands?"


Randomize Timer() is a combination of 2 commands.

Timer() returns the system time in milliseconds, you can't change it. If you want multiple timers, you need to put the Timer() value in to a variable, and use that in your code to make comparisons with the current Timer() value.

Randomize Timer() is simply utilising the virtually unpredictable return value of Timer() to generate a random seed.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Jul 2004 22:22
also your input command is missing the first argument

input "",myname$


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 17th Jul 2004 10:10
another question(s)

how do I get my input to space itself

print "please enter your name"
input myname$
print
print "hello", myname$
wait key

when I put this code in, the outcome is always "helloname"

what I want to do, is have that be spaced: "hello name"

thank you
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 17th Jul 2004 10:20
Just put a space after "hello"

print "hello, ",myname$
wait key

Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 17th Jul 2004 10:36
thank you.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 17th Jul 2004 13:15
You asked how to time events to happen at determined time intervals:

Here is a small example:



This code will count seconds and keep the number of seconds past in the variable "interval". Every time at least one second has passed, it increases the interval variable and resets the lasttime variable to the current time. Should be easy to understand.

Good Luck

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 17th Jul 2004 16:40
thank you bolt!
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 17th Jul 2004 17:10
bolt - now, how would I be able to cancel this, when lets say it hits about the 5000 mark?
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 18th Jul 2004 05:52
ok bolt - this is what I am trying to do.

wait 5 seconds then cancel a loop, or a running process.
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 18th Jul 2004 06:14
one other thing bolt. lol

is this the right code to make two of these? I thought this was interesting, but just couldnt execute it properly.

lasttime=timer():interval=0
lasttime2=timer():intervalD=0
do

if timer()-lasttime>=10
if timer()-lasttime2>=1000
lasttime=timer()
lasttime2=timer()
inc interval
inc intervalD
endif

cls
text 10,10,"seconds: "+str$(interval)
text 10,50,"seconds2: "+str$(intervalD)
sync

loop
Plastico
20
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 18th Jul 2004 11:33
hehe I figured it out, it just needed another endif
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 18th Jul 2004 14:20
Glad you got it, sorry I didn't post sooner, I only check for forums every one or two days...

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]

Login to post a reply

Server time is: 2024-09-22 17:25:12
Your offset time is: 2024-09-22 17:25:12