Author Topic: I want to use my own Config file  (Read 846 times)

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
I want to use my own Config file
« on: December 10, 2008, 08:13:35 AM »
How would I set up my own plugin/script to use its own configuration file?
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
I want to use my own Config file
« Reply #1 on: December 10, 2008, 12:00:59 PM »
Code: [Select]
WriteConfigEntry Section, Key, Value, ConfigFile
ReadConfigEntry Section, Key, ConfigFile

Take note, however, that ConfigFile is read from the bot's main folder. You cannot place a config file outside of the bot's folder. This should be good enough, however.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
I want to use my own Config file
« Reply #2 on: December 10, 2008, 01:23:56 PM »
Not  Read, "Get"

Code: [Select]
Sub WriteConfigEntry(Category As String, Key As String, Value As String, Path As String)
'// Notes:
'//  - Auto creates file
'//  - I think the  path can be outside the application path (bot path), but it  definitely  defaults to the app path if you don't specify a drive.
'//  - Example: WriteConfigEntry "Main", "Username", "MyNewNameIsBob", "config.ini"
Function GetConfigEntry(Category As String, Key As String, Path As String) As String
'//  - Auto creates the file
'//  - Returns the value of the specified  key
'//  - Reading non-existent keys returns vbNullString
'//  - Example: botname = GetConfigEntry("Main", "Username", "config.ini")
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector