Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TickCount / BattleMsg


teh jimpie
 Share

Recommended Posts

When the text appears, it records a variable set to GetTickCount, which holds the amount of time a program has been running, in milliseconds, if I'm not mistaken. Regardless, you can check that variable against the current GetTickCount value.
Link to comment
Share on other sites

@Ballie:

> When the text appears, it records a variable set to GetTickCount, which holds the amount of time a program has been running, in milliseconds, if I'm not mistaken. Regardless, you can check that variable against the current GetTickCount value.

I'm sorry, I'm not understanding 100%. So every TickCount is a diffrent time? That's obviously.
But where is the TickCount value then?
Link to comment
Share on other sites

You don't need to know the current Tick value. All you need to know is that it stores a number used to tell time. Let me show you some sample code.

```
x = GetTickCount
Do
    If x < GetTickCount - 5000 Then
        MsgBox "5 seconds have passed"
        Exit Sub
    End If
Loop
```
This checks the current TickCount against x, a value set before the loop. When the current Tick is 5000 milliseconds greater than x, that means 5 seconds have passed.

More practically, look at this:

```
                    For I = 1 To MAX_BLT_LINE
                        If BattlePMsg(I).Index > 0 Then
                            If BattlePMsg(I).Time + 7000 > GetTickCount Then
                                Call DrawText(TexthDC, 1 + sx, BattlePMsg(I).y + frmMirage.picScreen.Height - 15 + sx, Trim$(BattlePMsg(I).Msg), QBColor(BattlePMsg(I).color))
                            Else
                                BattlePMsg(I).Done = 0
                            End If
                        End If

                        If BattleMMsg(I).Index > 0 Then
                            If BattleMMsg(I).Time + 7000 > GetTickCount Then
                                Call DrawText(TexthDC, (frmMirage.picScreen.Width - (Len(BattleMMsg(I).Msg) * 8)) + sx, BattleMMsg(I).y + frmMirage.picScreen.Height - 15 + sx, Trim$(BattleMMsg(I).Msg), QBColor(BattleMMsg(I).color))
                            Else
                                BattleMMsg(I).Done = 0
                            End If
                        End If
                    Next I
```
BattlePMsg(I).Time is the millisecond that the message was received. This particular loop checks for if the message has surpassed 7000 milliseconds of display time. You can easily edit that as you need. :)
Link to comment
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
 Share

×
×
  • Create New...