View Full Version : adding together veriables and making a new document


blink57
06-23-2008, 06:28 PM
hello, im new to VB so i was hoping you guys could help me :D

well im trying to make a program that will generate a text file (.psc extention text file) with a bunch of veriables that are defined by the user in the gui. right now i cant figure out for the life of me how to generate a text file let alone input the veriables into the code template.

***edit***
just to clarify, the code below is what i want to be stated in the final text file that is generated. the veriables like npc names will be entered by the user of my app and then placed into the code template by filling out text boxes with the name names and stuff. the application is ment to make it easier for people who are less handy with code to eaily make code like below.

so basicaly im asking how can i have the value entered into texbox name vendor1 be auto entered into the code below, then have the code with the new values made into a text file ...
***edit***


example of code template
<code>

// released by timeforlunch
Par
{

$MinLevel = $MyLevel - 5;
$MaxLevel = $MyLevel + 1;


Rest
{

$Prio = 0;
}

Defend
{

$Prio = 0;
}


Danger
{
$Prio = 1;

// Attack hostiles this close
// $Distance = 15;
}




Buy
{


$Items = [["Filtered Draenic Water", 10, 80]];
$NPC = "Innkeeper Biribi";
$Location = [-2919.72, 4020.27, 0.42];
}




Vendor
{
$Prio = 1;
$MinDurability = 0.30; // 15%
$MinFreeBagSlots = 5;
$UseMount = True;
$SellGrey = true;
$SellGray = true;
$SellWhite = true;
$SellGreen = true;
$Protected =["Arakkoa", "Garadar", "Cloth", "Arrow"];

$NPC = "Cecil Meyers";

$Location = [-2978, 4031.54, 3.57];


// Blacklist vendor for a short time after visit
$BlacklistTime = 5 * 60;



}



Pull
{
$Prio = 3;

$Factions = [1738];

}
Loot
{
$Prio = 2;
$Skin = False; // True if you have skinning, otherwise False

}


Hotspots
{
$Prio = 5;

$Order = "Random"; // For sequential use: $Order = "Order";


$Locations =
[
[-1453.31, 4534.44, 41.61],
[-1605.35, 4376.38, 34.68],
[-1742.03, 4426.55, 4.53]

];
}

</code>

the things like the npc names and items are the veriables that i have defined in the gui

p.s. yes this is ment for a game