# Problem with operators (math)

## Recommended Posts

Hello.

```\$ntime = StringRegExp(\$text, "» \d+Attack v(\d+) :( \d+) :( \d+) h", 3)
If @error = 0 Then
\$nhours = Number(\$ntime[0])
MsgBox(0, "", \$nhours)
\$nminutes = Number(\$ntime[1])
MsgBox(0, "", \$nminutes)
\$nsec = Number(\$ntime[2])
MsgBox(0, "", \$nsec)
\$attackat = \$nhours*60*60*1000 + \$nminutes*60*1000 + \$nsec*1000
MsgBox(0, "", \$attackat)
Else
;nothing
EndIf```

The problem is, that the last msgbox (MsgBox(0, "", \$attackat)) says number 999999. So I insert more msgboxes. For example I have incoming attack for 30 sec. So the first MsgBox says 0, second says 0 too, and third is 30. Then if u calculate this \$attackat you get result 30000. But autoit give me the result 999999.

So anyone can help me?

Edited by DoctorSLO

##### Share on other sites

Works fine here with the values you described :

```\$nhours = 0
MsgBox(0, "", \$nhours)
\$nminutes = 0
MsgBox(0, "", \$nminutes)
\$nsec = 30
MsgBox(0, "", \$nsec)
\$attackat = \$nhours*60*60*1000 + \$nminutes*60*1000 + \$nsec*1000
MsgBox(0, "", \$attackat)```

Last MsgBox shown 30000

Edited by Inverted

## Create an account

Register a new account

×

• Wiki

• Back

• Git