Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 8:03 pm

All times are UTC




Post new topic Reply to topic  [ 50 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: GetTickCount
PostPosted: Tue Jul 03, 2007 4:39 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I was wondering if there was a tut with a good explanation of using GetTickCount. If so could someone point me in the direction,

Thanks.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 4:43 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Code:
dim currenttick, nexttick, elapsed as long 'variables we are using

currenttick = gettickcount 'currenttick is now saved as the time this line was executed

'CODE GOES HERE ROFL

nexttick = gettickcount 'same as above

elapsed = nexttick - currenttick 'the elapsed time is the time recorded after the code minus the time recorded before the code

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 4:44 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
so that would work for replacing timers?

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 4:46 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Oh yeah! Completely!

I mean, it doesn't matter what the timers are doing!

This one piece of code will manage to replace all the timers in the game!

Wooooooooh!

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 4:48 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
so key this
Code:
dim currenttick, nexttick, elapsed as long 'variables we are using

currenttick = gettickcount 'currenttick is now saved as the time this line was executed
before anything that you want to use GetTickCount and
Code:
nexttick = gettickcount 'same as above

elapsed = nexttick - currenttick 'the elapsed time is the time recorded after the code minus the time recorded before the code
at the end of the code?

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 5:38 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
I gave you just a small example of how to use gettickcount.

My example showed a quick calculation to see how long it takes for a piece of code to finish.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 8:07 pm 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
Contrary to many people's beliefs.. API != Advanced Programming Interface. It stands for Application Programming Interface.

No offense meant to the poster. It's a common mistake.

Topic moved to Beginner Questions.


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 10:49 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
What?

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 10:55 pm 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
What part didn't you understand? :P


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Tue Jul 03, 2007 11:03 pm 
Verrigan wrote:
What part didn't you understand? :P


The fact that nobody said anything about that in this post? xD


Top
  
 
 Post subject: Re: GetTickCount
PostPosted: Wed Jul 04, 2007 1:42 am 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. :(


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Wed Jul 04, 2007 1:44 am 
Verrigan wrote:
I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. :(


Don't cry now. Lol.

It's okay. Everything will be fine.


Top
  
 
 Post subject: Re: GetTickCount
PostPosted: Wed Jul 04, 2007 2:05 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
I thought it was a joke, but my technical wittiness, whilst quite powerful, is nothing compared to yours.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Wed Jul 04, 2007 2:14 pm 
Robin wrote:
I thought it was a joke, but my technical wittiness, whilst quite powerful, is nothing compared to yours.



Haha, you're an ass dude.


Top
  
 
 Post subject: Re: GetTickCount
PostPosted: Wed Jul 04, 2007 2:22 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Aug 17, 2006 5:27 pm
Posts: 866
Location: United Kingdom
Verrigan wrote:
I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. :(


actually i drew assumptions and understood it... i just didnt want to post incase i looked like an idiot ;D


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Wed Jul 04, 2007 4:21 pm 
Offline
Knowledgeable

Joined: Wed May 31, 2006 8:00 pm
Posts: 142
rofl, I didnt get it at all :lol:

I searched high and low, but couldnt find it. I even used the search :P

_________________
xFire:- funkynut


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Thu Jul 05, 2007 3:55 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Ok I got everything working now, accept I can't get the equipped items to blit at all. any suggestions?

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Thu Jul 05, 2007 7:58 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Aug 17, 2006 5:27 pm
Posts: 866
Location: United Kingdom
DarkX wrote:
Ok I got everything working now, accept I can't get the equipped items to blit at all. any suggestions?


scream and roll on the floor? ^_^

honestly.. what do you mean cant get them to blt? blt where? maybe your blt'd them into the recycle bin?

I dont understand.. i thought this was about gettickcount o.0


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Thu Jul 05, 2007 8:00 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Except.
Blt.

Check your spelling next time.

As to what you're on about, maybe you should read the topic title before posting ^_^

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Fri Jul 06, 2007 12:04 am 
Didn't he start the topic? O_o (Too lazy to check. xD)

And Blt is only the term used in the programming. It would be spelled Blit. ^_^


Top
  
 
 Post subject: Re: GetTickCount
PostPosted: Fri Jul 06, 2007 2:49 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
We only assume it's pronounced blit.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Fri Jul 06, 2007 3:08 am 
Same difference. I feel like an idiot when I say blt though. Makes me want a sammich. O_o


Top
  
 
 Post subject: Re: GetTickCount
PostPosted: Fri Jul 06, 2007 7:51 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Perfekt wrote:
Didn't he start the topic? O_o (Too lazy to check. xD)

And Blt is only the term used in the programming. It would be spelled Blit. ^_^


Yes I did start the topic, and it is about TickCount which I thank Robin for the code. By the way the Blit thing, I was rewriting GSD's Visual Inventory code to use GetTickCount, and I think somewhere along the lines I messed up the blit code for the equipped. But thanks for the assistance from all ya.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Fri Jul 06, 2007 8:40 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
It already uses gettickcount...

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: GetTickCount
PostPosted: Sun Jul 08, 2007 9:02 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Code:
double click the timer in frmMirage (the one u made) add the following:

Dim Q As Integer

On Error Resume Next
For Q = 0 To MAX_INV - 1
If PicInv(Q).Picture <> LoadPicture() Then
PicInv(Q).Picture = LoadPicture()
Else
Call BitBlt(PicInv(Q).hdc, 0, 0, PIC_X, PIC_Y, PicItems.hdc, 0,
Item(GetPlayerInvItemNum(MyIndex, lstInv.SelCount + Q)).Pic * PIC_Y,
SRCCOPY)
End If
Next Q
that's a line from the code, does that not mean that it uses a timer?

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group