I want my bot to read from my .ini.
I want to create accounts but using the list from a .ini.
I tried
Dim strCompare as string
Acc1.text = right(Strcompare, 1)
And this is my config code
Public Function OpenConfig()
Dim strCompare As String
Open App.Path & "\Names.ini" For Output As #1
Print #1, "Names to make"
' Print #1, "Warning: Do it like this: Username-Password"
Print #1, "Server: "
Print #1, "CDKEY: "
Print #1, "1st: Username:Password"
Close #1
End Function
And on Form_Load i want it to open that file (ive made it do that atm) and then Read the "1st: " text, and create it or whatever, then go to "2nd: " and so on. But i dont know i can make it read them all. I can only get it read ONE :-\
Help please? :-*
Look into these API's
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Function GetFromIni(AppName As String, Key As String, File As String) As String
Dim Default As String, Size As Integer, Value As Long
Dim User As String
User = Space$(128)
Size = Len(User)
Default = ""
Value = GetPrivateProfileString(AppName, Key, Default, User, Size, File)
User = Mid(User, 1, InStr(User, Chr(0)) - 1)
GetFromIni = User
End Function
For calling function:
Config.ini:
[Configuration]
Username=Dan
Password=Owns
Username = GetFromIni("Configuration", "Username", "C:\Config.ini")
Password = GetFromIni("Configuration", "Password", "C:\Config.ini")
[Edit: Grammar Mistakes]
Giving people code doesn't help them really.
Well, not to hard to make though...
Want me to remove code?
Quote from: Archangel on March 12, 2005, 10:12 AM
Well, not to hard to make though...
Want me to remove code?
IMO, it would be better to give them the API call and then maybe a short description oh how it works.
Quote from: Archangel on March 12, 2005, 10:12 AM
Well, not to hard to make though...
Want me to remove code?
Well i didnt copy / paste your code so i cant cheat. But if you want remove it, but if you dont, please comment it. It does help people.
Ok, so now ive got the basic jiff of it. But how would i make it stay the same every time i load it up again? Cos it just goes bk to "".
I put it to go to "", but thats the only way i can save it :-\
Heres my code
Public Function OpenConfig()
Dim strCompare As String
Open App.Path & "\Names.ini" For Output As #1
Print #1, "Names to make"
' Print #1, "Warning: Do it like this: Username-Password"
Print #1, "Server: "
Print #1, "CDKEY: "
Print #1, "1st: Username:Password"
Print #1, "2nd:"
Print #1, "3rd:"
Print #1, "4th:"
Print #1, "5th:"
Print #1, "6th:"
Print #1, "7th:"
Print #1, "8th:"
Print #1, "9th:"
Print #1, "10th:"
Close #1
See i put it to "", only way i can make it save tbh.
Can anybody help?
Quote from: QwertyMonster on March 12, 2005, 08:18 AMI want to create accounts but using the list from a .ini.
It'd be easier to read lists from a .txt as opposed to an .ini which is better for storing all the details.
Quote from: FrOzeN on March 12, 2005, 08:29 PM
Quote from: QwertyMonster on March 12, 2005, 08:18 AMI want to create accounts but using the list from a .ini.
It'd be easier to read lists from a .txt as opposed to an .ini which is better for storing all the details.
What makes it easier to read from a file with a certain extension opposed to another?
Quote from: Warrior on March 12, 2005, 09:24 PM
the i and n keys are closer than the t and x keys :P
I agree with UserLoser on this one.
You should use the ini Structure if your going to save the file as a .ini
Well to me it sounded like he wanted to create a accounts from a
list.
And lists are normally stored in .txt's.
So inside a Accounts.txt or something he would have something like:
Quotename1:*****
name2:*****
name3:*****
name4:*****
name5:*****
etc..
And then a Config.ini have:
Quote[Settings]
CdKey=0000000000000
Product=PXES
Server=useast.battle.net
;etc..
Instead of something like:
Config.ini:
Quote[Settings]
CdKey=0000000000000
Product=PXES
Server=useast.battle.net
1st=name1:*****
2nd=name2:*****
3rd=name3:*****
4th=name4:*****
5th=name5:*****
;etc..
If Config.ini's are faster for lists why are they never used to store lists then??
[EDIT] Fixed Tags.
Why the hell would anyone care about speed (which is barely noticeable) when reading/writing to a file? INI is a more organized way to store information.
Ok, so now basically now i am using a .txt. Now would i read it like this:
Account1 = App.path & "\names.txt", "Names", "Acc1: "
Something along those lines?
This should be in the VB forums and not the BotDev forums.
Quote from: rabbit on March 13, 2005, 08:15 AM
This should be in the VB forums and not the BotDev forums.
Yes it should.
But does saying that help my problem? I think some people should go back and read some "News" called "Stay on topic".
Not sounding like a flame, so dont take it like one, but that was a useless Post. :-\
If the entire thread is in the wrong place, then it's off topic :)
Quote from: QwertyMonster on March 13, 2005, 08:20 AM
that was a useless Post. :-\
Haha, Thats a lot coming from the king of useless posts.
Quote from: Blaze on March 13, 2005, 01:37 PM
Quote from: QwertyMonster on March 13, 2005, 08:20 AM
that was a useless Post. :-\
Haha, Thats a lot coming from the king of useless posts.
Oh, haha :-\
Now thats alot coming from the Queen of useless posts ;)
Can we kind of...
Get back on topic. Thanks.
We have already givin you everything you need, plus an example on how to use it... What more do you want?
Quote from: Blaze on March 13, 2005, 01:54 PM
We have already givin you everything you need, plus an example on how to use it... What more do you want?
Do it for me.
Not sounding like a flame, so don't take it like one, but that was the only logical step to go.
I wanted him to say that, or post the code that we already posted and said it doesn't work. -.-
Eh i must be blind ;D
Missed the code bit, nvm. Thanks for all help. And thx to that dxiogm person, for posting code so i can learn from it.
How can you miss code
Quote from: Warrior on March 13, 2005, 05:01 PM
How can you miss code
No. I didnt mean i MISSED IT. But i looked through it and didnt think it was what i was looking for or needed. But i re-read it and it seems i can make it work for what i need it for. Thanks.
Does every thread have to go into arguments over too much or too little help? You guys are almost all noobs to programming, and nearly none of you have room to be criticizing someone else who is just starting out. Your 2-5 years experience doesn't mean jack, especially if it is not in the real world working with teams of programmers and customers on significant projects. No school work matters, except maybe a few graduate projects (most of those don't matter).
Please stop flooding the threads with useless chest-thumping about how much code was or was not posted to other noobs.
Sworry :'( :-*
Quote from: Grok on March 14, 2005, 03:29 PM
Does every thread have to go into arguments over too much or too little help? You guys are almost all noobs to programming, and nearly none of you have room to be criticizing someone else who is just starting out. Your 2-5 years experience doesn't mean jack, especially if it is not in the real world working with teams of programmers and customers on significant projects. No school work matters, except maybe a few graduate projects (most of those don't matter).
Please stop flooding the threads with useless chest-thumping about how much code was or was not posted to other noobs.
I have something to say about this... but I think the lack of moderation due to some people being involved in MMORPGs too much allowed some people to think they could post what they want and it'd be ok since nobody is around to tell them otherwise. I know I have my
bad posts some places in the past, but those don't happen anymore
Quote from: UserLoser on March 14, 2005, 07:14 PM
I have something to say about this... but I think the lack of moderation due to some people being involved in MMORPGs too much allowed some people to think they could post what they want and it'd be ok since nobody is around to tell them otherwise. I know I have my bad posts some places in the past, but those don't happen anymore
Well, I have been looking at this thread, feeling the itch to split and remove posts, but neither Yoni nor DarkVirus are involved with any MMORPGs at this time as far as I know....
I have posted a bit of useless posts, and stuipid Posts. And i myself thought admins DID watch, but nothing came apon it. I shall now stop my stuipid / useless posts.
Quote from: QwertyMonster on March 15, 2005, 09:44 AM
I have posted a bit of useless posts, and stuipid Posts. And i myself thought admins DID watch, but nothing came apon it. I shall now stop my stuipid / useless posts.
Some noise just isn't worth our getting involved. But when the noise level grows very much, one of us sometimes feels compelled to moderate. Mostly I think we all prefer that our public community has a bit of maturity, focus, self-control, and civility. That just isn't always true.
Quote from: Grok on March 15, 2005, 12:09 PM
Some noise just isn't worth our getting involved. But when the noise level grows very much, one of us sometimes feels compelled to moderate. Mostly I think we all prefer that our public community has a bit of maturity, focus, self-control, and civility. That just isn't always true.
It's also worth noting that if it comes to admin moderation, it will typically end up involving banning.
Quote from: Adron on March 15, 2005, 07:32 AM
Well, I have been looking at this thread, feeling the itch to split and remove posts, but neither Yoni nor DarkVirus are involved with any MMORPGs at this time as far as I know....
Well, Yoni is in the Army more then he is here and DarkVirus's Last Active time was January 11, 2005, 11:15 pm.
Quote from: Adron on March 15, 2005, 07:32 AM
Quote from: UserLoser on March 14, 2005, 07:14 PM
I have something to say about this... but I think the lack of moderation due to some people being involved in MMORPGs too much allowed some people to think they could post what they want and it'd be ok since nobody is around to tell them otherwise. I know I have my bad posts some places in the past, but those don't happen anymore
Well, I have been looking at this thread, feeling the itch to split and remove posts, but neither Yoni nor DarkVirus are involved with any MMORPGs at this time as far as I know....
I was actually trying to talk about a good chunk of forum in general, not just VB one
Quote from: UserLoser on March 15, 2005, 01:29 PM
Quote from: Adron on March 15, 2005, 07:32 AM
Quote from: UserLoser on March 14, 2005, 07:14 PM
I have something to say about this... but I think the lack of moderation due to some people being involved in MMORPGs too much allowed some people to think they could post what they want and it'd be ok since nobody is around to tell them otherwise. I know I have my bad posts some places in the past, but those don't happen anymore
Well, I have been looking at this thread, feeling the itch to split and remove posts, but neither Yoni nor DarkVirus are involved with any MMORPGs at this time as far as I know....
I was actually trying to talk about a good chunk of forum in general, not just VB one
I read the same forums today that I read before WoW came along. What's your point?