 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 2:48 pm Post subject: remember what i have typed and colors |
|
|
ok i want a code which will remember what i have typed the last time and also if i click a button it will change the color to the color the want
and i am using vb6 for both the codes
thnx alot from before
Last edited by raushan2007 on Mon Dec 17, 2007 10:31 am; edited 1 time in total |
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sun Dec 16, 2007 3:14 pm Post subject: |
|
|
1. Save file
2. Form1.backcolor = Rgb(0,0,0)
if thats what ur looking
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Tue Dec 18, 2007 7:28 am Post subject: |
|
|
| Anyone pls answer this i will +rep him!
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Dec 18, 2007 8:38 am Post subject: |
|
|
Save your information either to text file, or a configuration style file (INI, XML, etc.). What type of data are you trying to save?
As for the color question, what are you trying to change the color of?
_________________
- Retired. |
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Tue Dec 18, 2007 11:10 am Post subject: |
|
|
| Wiccaan wrote: | Save your information either to text file, or a configuration style file (INI, XML, etc.). What type of data are you trying to save?
As for the color question, what are you trying to change the color of? |
i am trying to change the color of the background to the color
and how do i save it in and .ini ot txt?
|
|
| Back to top |
|
 |
Elec0 Expert Cheater
Reputation: 0
Joined: 21 Nov 2007 Posts: 188 Location: Out of my mind, back in five minutes.
|
Posted: Tue Dec 18, 2007 11:37 am Post subject: |
|
|
| raushan2007 wrote: |
i am trying to change the color of the background to the color |
Do you mean the background color of the form?
As for writing to a text file, I wrote a tutorial a while ago, I'll edit my post with it in a few minutes.
For this tutorial I am assuming that you have a basic knowledge of VB6 and know some of the basics.
Here is how to open and edit text files.
Writing to Text Files
To open a file, you use this nifty line of code:
| Code: |
Open "C:\Test.txt" for Output As #1
|
That opens the file for writing to, (The Output, we'll learn more about that later.) But, if you open the file and forget to close it, things screw up, so, let's fix it.
| Code: |
Open "C:\Test.txt" for Output As #1
... ' This means put your code here, but we don't have any code to put there yet, so just ignore it
Close #1
|
That will open and close the text file Test.txt in your C drive. But what good will a file do you that is only open for a nanosecond you ask? Well, not much, so you have to execute some code in that nanosecond.
To write to a file, you can use
| Code: |
Print #1, Text1.text
|
Or:
| Code: |
Write #1, Val(Text1.text), Val(Text2.text)
|
What the heck do these do you ask? Well, the Print statement writes text to a file, in this case the text in the textbox Text1.
The Write statement does the same thing, except that it can write multiple things to the same file.
So, to compile the things that we have learned so far into one place we would do this:
| Code: |
Open "C:\Text.txt" for Output As #1
Print #1, Text1.text
Close #1
|
Can you figure out what that would do? (If you can't I suggest you either quit programming altogether or go back and read about the Print statement again.) If you said It would write the text of Text1 to the file C:\Text.txt then you are exactly right!
If you feel that you have that down, we can move on to getting text from a file, otherwise, feel free to go back and review and experiment until you feel comfortable with what we have covered so far.
Reading From Text Files
Now, to get text from text files is just a little bit different than writing to text files. You open the file in almost the same way, except you use the Input instead of the Output
| Code: |
Open "C:\Text.txt" for Input As #1
|
What Input does is allow you to read text instead of writing text, as with Output.
To write text to the file, you use the statement
| Code: |
Input #1, Text1.text
|
That will, as you have probably already figure out, write the text of file #1, (whatever that is) to the textbox Text1.
That was pretty easy right? Well, let's just squish all we know about reading from files into a couple lines of code
| Code: |
Open "C:\Test.txt" for Input As #1
Input #1, Text1.text
Close #1 ' You still have to close the file even when you are reading from it.
|
Easy right? Good.
Okay, time for review:
Q: What line of code do you use to open a file for writing to?
A: | Code: | | Open "C:\Text.txt" for Output As #1 |
Q: What line of code do you use to read text out of a textbox?
A: | Code: | | Input #1, Text1.text |
Q: What line of code do you use to open a file for reading from?
A: | Code: | | Open "C:\Text.txt" for Input As #1 |
So, how did you do on the quiz?
If you have any problems, please post here or PM me, I will be glad to try and help you.
Also, if you found this tutorial helpful please say so.
If you see something that I have typed wrong or did wrong, please let me know.
~Elec0
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Wed Dec 19, 2007 5:05 am Post subject: |
|
|
| Elec0 wrote: | | raushan2007 wrote: |
i am trying to change the color of the background to the color |
Do you mean the background color of the form?
As for writing to a text file, I wrote a tutorial a while ago, I'll edit my post with it in a few minutes.
For this tutorial I am assuming that you have a basic knowledge of VB6 and know some of the basics.
Here is how to open and edit text files.
Writing to Text Files
To open a file, you use this nifty line of code:
| Code: |
Open "C:\Test.txt" for Output As #1
|
That opens the file for writing to, (The Output, we'll learn more about that later.) But, if you open the file and forget to close it, things screw up, so, let's fix it.
| Code: |
Open "C:\Test.txt" for Output As #1
... ' This means put your code here, but we don't have any code to put there yet, so just ignore it
Close #1
|
That will open and close the text file Test.txt in your C drive. But what good will a file do you that is only open for a nanosecond you ask? Well, not much, so you have to execute some code in that nanosecond.
To write to a file, you can use
| Code: |
Print #1, Text1.text
|
Or:
| Code: |
Write #1, Val(Text1.text), Val(Text2.text)
|
What the heck do these do you ask? Well, the Print statement writes text to a file, in this case the text in the textbox Text1.
The Write statement does the same thing, except that it can write multiple things to the same file.
So, to compile the things that we have learned so far into one place we would do this:
| Code: |
Open "C:\Text.txt" for Output As #1
Print #1, Text1.text
Close #1
|
Can you figure out what that would do? (If you can't I suggest you either quit programming altogether or go back and read about the Print statement again.) If you said It would write the text of Text1 to the file C:\Text.txt then you are exactly right!
If you feel that you have that down, we can move on to getting text from a file, otherwise, feel free to go back and review and experiment until you feel comfortable with what we have covered so far.
Reading From Text Files
Now, to get text from text files is just a little bit different than writing to text files. You open the file in almost the same way, except you use the Input instead of the Output
| Code: |
Open "C:\Text.txt" for Input As #1
|
What Input does is allow you to read text instead of writing text, as with Output.
To write text to the file, you use the statement
| Code: |
Input #1, Text1.text
|
That will, as you have probably already figure out, write the text of file #1, (whatever that is) to the textbox Text1.
That was pretty easy right? Well, let's just squish all we know about reading from files into a couple lines of code
| Code: |
Open "C:\Test.txt" for Input As #1
Input #1, Text1.text
Close #1 ' You still have to close the file even when you are reading from it.
|
Easy right? Good.
Okay, time for review:
Q: What line of code do you use to open a file for writing to?
A: | Code: | | Open "C:\Text.txt" for Output As #1 |
Q: What line of code do you use to read text out of a textbox?
A: | Code: | | Input #1, Text1.text |
Q: What line of code do you use to open a file for reading from?
A: | Code: | | Open "C:\Text.txt" for Input As #1 |
So, how did you do on the quiz?
If you have any problems, please post here or PM me, I will be glad to try and help you.
Also, if you found this tutorial helpful please say so.
If you see something that I have typed wrong or did wrong, please let me know.
~Elec0 |
Yes how do i change the color of my background?
|
|
| Back to top |
|
 |
Elec0 Expert Cheater
Reputation: 0
Joined: 21 Nov 2007 Posts: 188 Location: Out of my mind, back in five minutes.
|
Posted: Wed Dec 19, 2007 8:51 am Post subject: |
|
|
Use
| Code: |
Print #1, Form1.BackColor
|
That will write the back color to a file.
Use
| Code: |
Input #1, Form1.BackColor
|
To load the color.
Of course, those pieces of code are just snippets, you need to use them with the Open #1 for Input as #1 and all that jazz.
~Elec0
|
|
| Back to top |
|
 |
h4ckz0r's twisted soul Grandmaster Cheater Supreme
Reputation: 1
Joined: 24 Oct 2007 Posts: 1181 Location: Paradise city, where the grass is green and the girls are somwhat pretty~
|
Posted: Wed Dec 19, 2007 9:05 am Post subject: |
|
|
It's called CTRL + C
_________________
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Thu Dec 20, 2007 1:45 am Post subject: |
|
|
| Elec0 wrote: | Use
| Code: |
Print #1, Form1.BackColor
|
That will write the back color to a file.
Use
| Code: |
Input #1, Form1.BackColor
|
To load the color.
Of course, those pieces of code are just snippets, you need to use them with the Open #1 for Input as #1 and all that jazz.
~Elec0 |
I see u know the code.! Can u make it as a .vbp and upload it?
thnx
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Thu Dec 20, 2007 8:16 am Post subject: |
|
|
| You want to learn or leach?
|
|
| Back to top |
|
 |
Elec0 Expert Cheater
Reputation: 0
Joined: 21 Nov 2007 Posts: 188 Location: Out of my mind, back in five minutes.
|
Posted: Thu Dec 20, 2007 5:59 pm Post subject: |
|
|
Indeed, what would be the point of you just copying and pasting my code without you learning anything? I'll admit that after many hours of doing that, some of the coding eventually sinks in, but it's much better if you learn to do it yourself.
Although, if you really get stuck, I will give you more in depth help if you want it.
~Elec0
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|