Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[TUT]How To Make Load Bar[TUT]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Mon Feb 11, 2008 11:29 am    Post subject: [TUT]How To Make Load Bar[TUT] Reply with quote

-----------------------------How To Make Load Bar-------------------------
Program: Visual Basic 6

Need:
1.1 frame
2.1 shape
3.timer

Make 1 frame remove the name so its a rectangle put a shape inside make the width 1 of the shape then drag the shape until its as long as the frame copy the code then put width back to 1 put a timer then put"
Code:
shape1.width = shape1.width +10
"
Code:
then put "if shape1.width="the width you copy" then msgbox"done"

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Feb 11, 2008 12:36 pm    Post subject: Reply with quote

are there no progress bar controls in VB6 somehow?
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Mon Feb 11, 2008 12:48 pm    Post subject: Reply with quote

Dude seriously. Use a progressbar.
Back to top
View user's profile Send private message
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Mon Feb 11, 2008 1:53 pm    Post subject: Reply with quote

who cares about the bar you can make your own Shocked Shocked Shocked
i dont even know the code for the progress bar

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Feb 11, 2008 2:29 pm    Post subject: Reply with quote

betting on:

ProgressBarControlName.Value()
Back to top
View user's profile Send private message
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Mon Feb 11, 2008 2:38 pm    Post subject: Reply with quote

slovach wrote:
betting on:

ProgressBarControlName.Value()
thx Very Happy
_________________
Back to top
View user's profile Send private message
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Mon Feb 11, 2008 2:43 pm    Post subject: Reply with quote

Say I want to read a 1 gigabyte file. I want my buffer to be of 16 kilobyte.
So my loop will go for 65536 times ( 1gigabyte = 1073741824 bytes. 16 kilobyte = 16384 bytes. Divide them). My progress bar will go to 100 max. So, I'll have to divide the number of loops by 100 to get how often I'll update my progress bar (at 655 bytes). Here is an example code in c# (logic is the same, just need to do it differently in some other languages). It is basic logic. You could always set the maximum value of the progress bar to the length of the loop and update by every byte. There are a lot of ways to do this, so find one that you like and use it.
Code:

 for (int i = 0,x = 655; i <= 65536; i++)
            {
                if (i == x)
                {
                    progressbar.Value += 1;
                    x += 655;
                }
               
            }
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Mon Feb 11, 2008 2:59 pm    Post subject: Reply with quote

killersamurai wrote:
Say I want to read a 1 gigabyte file. I want my buffer to be of 16 kilobyte.
So my loop will go for 65536 times ( 1gigabyte = 1073741824 bytes. 16 kilobyte = 16384 bytes. Divide them). My progress bar will go to 100 max. So, I'll have to divide the number of loops by 100 to get how often I'll update my progress bar (at 655 bytes). Here is an example code in c# (logic is the same, just need to do it differently in some other languages). It is basic logic. You could always set the maximum value of the progress bar to the length of the loop and update by every byte. There are a lot of ways to do this, so find one that you like and use it.
Code:

 for (int i = 0,x = 655; i <= 65536; i++)
            {
                if (i == x)
                {
                    progressbar.Value += 1;
                    x += 655;
                }
               
            }


you know this tut is for VB6 not C
Back to top
View user's profile Send private message
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Mon Feb 11, 2008 3:16 pm    Post subject: Reply with quote

Can't stand vb syntax, so I did it in a more soothing syntax. Logic is still the same, but it just needs to be in vb syntax.

Code:

 Dim i As Integer = 0, x As Integer = 655
 While i <= 65536
     If i = x Then
         progressbar.Value = progressbar.Value + 1
         x += 655
       
     End If
     i += 1
 End While
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Feb 11, 2008 6:15 pm    Post subject: Reply with quote

killersamurai wrote:
Can't stand vb syntax, so I did it in a more soothing syntax. Logic is still the same, but it just needs to be in vb syntax.

Code:

 Dim i As Integer = 0, x As Integer = 655
 While i <= 65536
     If i = x Then
         progressbar.Value = progressbar.Value + 1
         x += 655
       
     End If
     i += 1
 End While


Still wont work with VB, but yea, good try either way lol.

Anyway, you can find the progressbar control in the common controls component. As for the code you would simply need to setup:

ProgressBar1.Min = xxx
ProgressBar1.Max = xxx
ProgressBar1.Value = xxx

In a loop like you are stating above to read from 0 to 65535 you could do:

Code:
    Dim x As Long
    For x = 0 To 65535
        ProgressBar1.Value = (x * 100) \ 65535
        DoEvents
    Next x


Which would convert 65535 to a percentage between 0% and 100%.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Feb 11, 2008 7:07 pm    Post subject: Reply with quote

Is that the right slash, Wicc?
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Feb 11, 2008 9:51 pm    Post subject: Reply with quote

samuri25404 wrote:
Is that the right slash, Wicc?


Yea. / in VB keeps a remainder while \ drops it.

1.77777 / 1 = 1.77777
1.77777 \ 1 = 2
1.49 \ 1 = 1

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Tue Feb 12, 2008 10:22 am    Post subject: Reply with quote

Dude.
What's the point if u dont bind it to a action?
...

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Feb 14, 2008 5:29 pm    Post subject: Reply with quote

killersamurai wrote:
Can't stand vb syntax, so I did it in a more soothing syntax. Logic is still the same, but it just needs to be in vb syntax.

Code:

 Dim i As Integer = 0, x As Integer = 655
 While i <= 65536
     If i = x Then
         progressbar.Value = progressbar.Value + 1
         x += 655
       
     End If
     i += 1
 End While



lol. Are you kidding? If you can understand vc then you can understand vb.

Edit: Thats called mod division.
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Thu Feb 14, 2008 6:09 pm    Post subject: Reply with quote

You can also make the bar xp-style with a user control and with modules.

as Wiccaan said, nothing else than a Progrssbar.Min / Max value to define the limits, and control to make it increase is all needed to make one, also can be done with a simple label.

_________________

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites