Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
WritePrivateProfileString and GetPrivateProfileString

 
Post new topic   Reply to topic Printable version
 View previous topic  Java: Class Reload for Bot Post :: Post Using points  View next topic  
Author Message
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:34
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Sat Nov 12, 2005 8:55 am    Post subject: WritePrivateProfileString and GetPrivateProfileString Reply to topic Reply with quote

I searched for a detailed tutorial on how to use these functions and got no success.

Can someone direct me to a website that tells me exactly how I would use these functions in a code? I've seen it before from the rankbot plugin but I need a break down on what everything means and how to plug each line into the code.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Nov 12, 2005 2:42 pm    Post subject: Reply to topic Reply with quote

GetPrivateProfileString(section, key, default, buffer, bufsize, inifile);

Here's the INI file ekted.ini in the "current directory":

[section1]
one=hello
two=world

[section2]
one=you
two=suck

If you want the string for "[section1] two", you would do:

char buf[256];

GetPrivateProfileString("section1", "two", "some default string", buf, sizeof(buf), ".\\ekted.ini");

If you expect to get a value back, you use the same function and then use atoi() or atof().
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Sat Nov 12, 2005 2:48 pm    Post subject: Reply to topic Reply with quote

http://www.google.com/search?q=WritePrivateProfileString
http://www.google.com/search?q=GetPrivateProfileString

It comes down to
Code: Show/Hide
BOOL WritePrivateProfileString(
  LPCTSTR lpAppName,
  LPCTSTR lpKeyName,
  LPCTSTR lpString,
  LPCTSTR lpFileName
);


lpAppName = the name of the [key] in the .ini file.
lpKeyName = the name of the Key=... value in the .ini value
lpString = the value that needs to be writtened to the key
lpFileName = the filename of the .ini file that needs to be modified

Code: Show/Hide
DWORD GetPrivateProfileString(
  LPCTSTR lpAppName,
  LPCTSTR lpKeyName,
  LPCTSTR lpDefault,
  LPTSTR lpReturnedString,
  DWORD nSize,
  LPCTSTR lpFileName
);


http://wiki.minegoboom.com/index.php/MERVBot_Tutorial#Input_with_GetPrivateProfileString

lpAppName = the [key] name
lpKeyName = the name of the Key=... value in the .ini value
lpDefault = the value returned to lpReturnedString when the key/App/file is not found.
lpReturnedString = the result of the operation is written to this variable
nSize = the size of the lpReturnedString
lpFileName = the file name of the .ini file

It ain't that hard, you know
_________________
Nickname: Maverick (I changed my name!)
TWCore developer | Subspace statistics
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Sat Nov 12, 2005 2:49 pm    Post subject: Reply to topic Reply with quote

bah ekted! sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:34
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Sat Nov 12, 2005 4:46 pm    Post subject: Reply to topic Reply with quote

Heh, thanks guys.. Mav, I searched and saw that page and didnt understand lol.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Nov 13, 2005 12:55 am    Post subject: Reply to topic Reply with quote

Which is why you shouldn't even try writing a MERVBot plugin before you learn C++.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:34
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Sun Nov 13, 2005 8:11 am    Post subject: Reply to topic Reply with quote

No.. Who told you that? These are just two functions I didn't know how to use. Im pretty cool with fstreams, but I feel that these look way easyier. Give me a break already.. Anyway, I know WritePrivateProfileString now. Now to use GetPrivateProfileString.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Nov 13, 2005 11:37 am    Post subject: Reply to topic Reply with quote

I told myself that. It must be hard to understand C docs when you don't understand english. icon_confused.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can 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 can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 87 page(s) served in previous 5 minutes.

phpBB Created this page in 0.597444 seconds : 32 queries executed (86.2%): GZIP compression disabled