Home   Help Search Login Register  

Author Topic: What's "&" do?  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.

occam

  • Guest
What's "&" do?
« on: 09 Sep 2002, 15:30:38 »
I was pawing though the scripts.pbo and noticed that a couple of the scripts have a line like:

&2

or

&3

The rest of the commands made sense to me, but I can't find any reference to this in any text or tutes. Anyone know what it does?

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:What's "&" do?
« Reply #1 on: 10 Sep 2002, 06:15:44 »
It means "when the time reaches the specified time, go on."

&3 means @_time >= 3

or in english: "When the variable '_time' is equal to or greater than 3, go on."

Every time you start a script, a local variable called _time is created. It counts up from zero when the script starts and keeps track of how much time the script has run.

Here is a blurb about it in the official command ref:

Code: [Select]
Waiting for a time: line starting with '&'.
    Example: &endTime is equivalent to @_time >= (endTime)

When they say "endTime" they are expecting you to assign a number to it.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

occam

  • Guest
Re:What's "&" do?
« Reply #2 on: 10 Sep 2002, 13:35:36 »
Aha! Very Handy.

Thank you for the clear and concise info.