teh jimpie Posted May 20, 2010 Author Share Posted May 20, 2010 heyI want to change the battlemessage's time.I've looked up for it in the source at the time but, at the time it says: "GetTickCount". Where is that exactly? Isnt it just set by a timer? Im using eclipse stable 1.2.2thanks Link to comment Share on other sites More sharing options...
balliztik1 Posted May 20, 2010 Share Posted May 20, 2010 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 More sharing options...
teh jimpie Posted May 21, 2010 Author Share Posted May 21, 2010 @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 More sharing options...
balliztik1 Posted May 21, 2010 Share Posted May 21, 2010 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 = GetTickCountDo If x < GetTickCount - 5000 Then MsgBox "5 seconds have passed" Exit Sub End IfLoop```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 More sharing options...
teh jimpie Posted May 23, 2010 Author Share Posted May 23, 2010 So I just change that 7000 in that code to the ammount of miliseconds I want?Also, should it be possible to have 30 seconds on the left, and 7 seconds on the right? Im making a pm system so Im using the left for the messages XD Link to comment Share on other sites More sharing options...
balliztik1 Posted May 23, 2010 Share Posted May 23, 2010 Yup. Just change the first 7000 to 30000\. The second one is the right side. Link to comment Share on other sites More sharing options...
teh jimpie Posted May 23, 2010 Author Share Posted May 23, 2010 thanks :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now