Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- import random
- import sys
- vowels = ['a', 'e', 'i', 'o', 'u']
- consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']
- hexchar = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']
- surfaceblocks = ['1', '2', '3', '1', '2', '3', '1', '2', '3', '1', '2', '3', '1', '2', '3', '2', '3', '2', '3', '2', '3', '2', '3', '3', '3', '3', '3', '4', '5', '12', '13', '17', '18', '19', '20', '24', '25', '35', '43', '45', '47', '48', '60', '79', '80', '86', '87', '88', '89', '87', '88', '89', '87', '88', '89', '87', '88', '89', '87', '88', '89', '97', '98', '103', '110', '112', '123', '125']
- groundblocks = ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '3', '4', '5', '12', '13', '17', '18', '19', '20', '24', '25', '35', '43', '45', '47', '48', '60', '79', '80', '86', '87', '88', '89', '97', '98', '103', '110', '112', '123', '125']
- oreblocks = ['CLAY', 'GRAVEL', '3', '14', '15', '16', '21', '56', '14', '15', '16', '21', '56', '4', '19', '30', '73', '87', '88', '89']
- uw_oreblocks = ['CLAY', 'COAL_ORE', 'GOLD_ORE', 'SAND', '79', '49']
- plantblocks = ['RED_ROSE', 'YELLOW_FLOWER', 'LONG_GRASS', '104', '105', '89']
- liquidblocks = ['Water', 'Lava']
- treetypes = ['Tree', 'BigTree', 'Foreset', 'HugeMushroom', 'SwampTree', 'Taiga1', 'Taiga2', 'JungleTree', 'GroundBush']
- def _vowel():
- return random.choice(vowels)
- def _consonant():
- return random.choice(consonants)
- def _cv():
- return _consonant() + _vowel()
- def _cvc():
- return _cv() + _consonant()
- def _syllable():
- return random.choice([_vowel, _cv, _cvc])()
- def create_fake_word():
- """ This function generates a fake word by creating between two and three
- random syllables and then joining them together.
- """
- syllables = []
- for x in range(random.randint(3,5)):
- syllables.append(_syllable())
- return ''.join(syllables)
- def _hexchar():
- return random.choice(hexchar)
- def _colorval():
- colorvalues = []
- for x in range(0,6):
- colorvalues.append(_hexchar())
- return ''.join(colorvalues)
- def _minsize():
- return abs(int(round(random.randint(1,50),0)))
- def _maxsize():
- return abs(int(round(random.randint(51,128),0)))
- def _minalt():
- return abs(int(round(random.randint(1,50),0)))
- def _maxalt():
- return abs(int(round(random.randint(51,128),0)))
- def _frequency():
- return abs(int(round(random.randint(1,25),0)))
- def _rarity():
- return abs(int(round(random.randint(1,25),0)))
- def _oresize():
- return abs(int(round(random.randint(4,64),0)))
- def _dungeonfreq():
- return abs(int(round(random.gauss(4, 16),0)))
- if __name__ == '__main__':
- filename = str.capitalize(create_fake_word())
- filename += 'Config.ini'
- fo = open(filename, 'wb')
- biomesize = 'BiomeSize:'
- biomesize += str(random.randint(3,10))
- fo.write(biomesize)
- fo.write('\n')
- biomerarity = 'BiomeRarity:'
- biomerarity += str(random.randint(25,75))
- fo.write(biomerarity)
- fo.write('\n')
- fo.write('BiomeIsBorder:')
- fo.write('\n')
- fo.write('NotBorderNear:')
- fo.write('\n')
- biometemperature = 'BiomeTemperature:'
- biometemperature += str(round(random.uniform(0.0, 1.1), 1))
- fo.write(biometemperature)
- fo.write('\n')
- biomewetness = 'BiomeWetness:'
- biomewetness += str(round(random.uniform(0.0, 1.1), 1))
- fo.write(biomewetness)
- fo.write('\n')
- biomeheight = 'BiomeHeight:'
- biomeheight += str(round(random.gauss(-10.0, 10.1), 1))
- fo.write(biomeheight)
- fo.write('\n')
- biomevolatility = 'BiomeVolatility:'
- biomevolatility += str(round(random.gauss(0.0,1.1),1))
- fo.write(biomevolatility)
- fo.write('\n')
- maxaverageheight = 'MaxAverageHeight:'
- maxaverageheight += str(round(random.gauss(-10.0, 10.1), 1))
- fo.write(maxaverageheight)
- fo.write('\n')
- maxaveragedepth = 'MaxAverageDepth:'
- maxaveragedepth += str(round(random.gauss(-10.0, 10.1), 1))
- fo.write(maxaveragedepth)
- fo.write('\n')
- volatility1 = 'Volatility1:'
- volatility1 += str(round(random.gauss(-10.0, 10.1), 1))
- fo.write(volatility1)
- fo.write('\n')
- volatility2 = 'Volatility2:'
- volatility2 += str(round(random.gauss(-10.0, 10.1), 1))
- fo.write(volatility2)
- fo.write('\n')
- fo.write('DisableBiomeHeight:false')
- fo.write('\n')
- fo.write('CustomHeightControl:0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0')
- fo.write('\n')
- surfaceblock = 'SurfaceBlock:'
- thissurfaceblock = random.choice(surfaceblocks)
- surfaceblock += thissurfaceblock
- fo.write(surfaceblock)
- fo.write('\n')
- groundblock = 'GroundBlock:'
- thisgroundblock = random.choice(groundblocks)
- groundblock += thisgroundblock
- fo.write(groundblock)
- fo.write('\n')
- fo.write('ReplacedBlocks:None')
- fo.write('\n')
- fo.write('disableNotchPonds:false')
- fo.write('\n')
- skycolor = ('SkyColor:0x')
- skycolor += str(_colorval())
- fo.write(skycolor)
- fo.write('\n')
- skycolor = ('SkyColor:0x')
- skycolor += str(_colorval())
- fo.write(skycolor)
- fo.write('\n')
- watercolor = ('WaterColor:0x')
- watercolor += str(_colorval())
- fo.write(watercolor)
- fo.write('\n')
- grasscolor = ('GrassColor:0x')
- grasscolor += str(_colorval())
- fo.write(grasscolor)
- fo.write('\n')
- foliagecolor = ('FoliageColor:0x')
- foliagecolor+= str(_colorval())
- fo.write(foliagecolor)
- fo.write('\n')
- dungeon = ('Dungeon(')
- dungeon += str(_dungeonfreq())
- dungeon += ',100,0,128)'
- if random.randint(0,10) > 2 :
- fo.write(dungeon)
- fo.write('\n')
- uglake = ('UnderGroundLake(')
- uglake += str(_minsize())
- uglake += (',')
- uglake += str(_maxsize())
- uglake += (',')
- uglake += str(_frequency())
- uglake += (',')
- uglake += str(_rarity())
- uglake += (',')
- uglake += str(_minalt())
- uglake += (',')
- uglake += str(_maxalt())
- uglake += (')')
- if random.randint(0,10) > 2 :
- fo.write(uglake)
- fo.write('\n')
- for i in range (0, random.randint(3,15)) :
- ore = 'Ore('
- ore += random.choice(oreblocks)
- ore += ','
- ore += str(_oresize())
- ore += ','
- ore += str(_frequency())
- ore += ','
- ore += str(_rarity())
- ore += ','
- ore += str(_minalt())
- ore += ','
- ore += str(_maxalt())
- ore += ','
- ore += thisgroundblock
- ore += ')'
- fo.write(ore)
- fo.write('\n')
- fo.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement