Sign in to follow this  
Followers 0
DoctorSLO

Problem with operators (math)

2 posts in this topic

#1 ·  Posted (edited)

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 this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0