Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::: Author: T3RRY ; Created: 27/02/2021 ; Version: 1.0
- ::: Purpose: System for Generating random Charachter Name / Surname Combinations
- ::: For use In RPG / Rogue-like batch games
- ::: Predefined lists for names / surnames use the 100 most common english names/surnames.
- ::: Substitute these lists as you see fit. Script is based on each list having 100 names.
- ::: First Names list includes Gender Binary and Gender Neutral names.
- @Echo off
- :# Define Lists of Names / Surnames for Selection by random Index.
- Set Names=Sophia Liam Olivia Noah Riley Jackson Emma Aiden Ava Elijah Isabella Grayson^
- Aria Lucas Aaliyah Oliver Amelia Caden Mia Mateo Layla Muhammad Zoe Camilla Carter ^
- Charlotte Jayden Eliana Ethan Mila Sebastian Everly James Luna Michael Avery Benjamin Maya ^
- Evelyn Logan Harper Leo Lily Luca Ella Alexander Gianna Levi Chloe Adalyn Josiah ^
- Charlie Henry Isla Jayce Ellie Julian Leah Jack Nora Ryan Scarlett Jacob Asher ^
- Abigail Wyatt Madison William Aubrey Owen Emily Gabriel Kinsley Miles Elena Lincoln Hannah ^
- Paisley Ezra Madelyn Isaiah Aurora Luke Peyton Cameron Nova Emilia Isaac Daniel Mason ^
- Carson Sarah Samuel Ariana Colton Penelope Maverick Lila Matthew Caleb
- Set Surnames=Smith Jones Williams Taylor Brown Davies Evans Wilson Thomas Johnson Roberts Mills ^
- Robinson Thompson Wright Walker White Edwards Hughes Green Hall Lewis Harris Clarke Harrison ^
- Jackson Wood Turner Martin Cooper Hill Ward Morris Moore Clark Lee King Baker ^
- Morgan Allen James Scott Phillips Watson Davis Parker Price Bennett Young Griffiths Patel ^
- Mitchell Kelly Cook Carter Richardson Bailey Collins Bell Shaw Murphy Miller Cox Richards ^
- Khan Marshall Anderson Simpson Ellis Adams Singh Begum Wilkinson Foster Chapman Powell Barnes ^
- Webb Rogers Gray Mason Ali Hunt Hussain Campbell Matthews Owen Palmer Holmes Harvey ^
- Knight Lloyd Butler Russell Barker Fisher Stevens Jenkins Murray Dixon
- :# Determine Random Generation Modulous range in accordance with index size of Name and Surname Lists
- :# - Allows names in the above lists to be added or removed without having to adjust the below code.
- Set /A {Ni}={Si}=0
- For %%G in (%Names%)Do Set /A {Ni}+=1
- For %%G in (%Surnames%)Do Set /A {Si}+=1
- :# Test delayed Expansion State prior to macro definition. Reject environment with DelayedExpansion Enabled
- If "!"=="" (Echo Delayed Expansion Must be Disabled Prior to Macro Definition&Pause &Exit /B)
- (Set \n=^^^
- %= \n Macro newline variable. Do not Modify =%)
- :# GetName Macro Definition. USAGE: %GetName%ReturnVar
- Set GetName=For %%n in (1 2)Do if %%n==2 ( %\n%
- Set /A "{i1}={i2}=0" %\n%
- Set /A "{n1}=!Random! %%{Ni} + 1" %\n%
- Set /A "{n2}=!Random! %%{Si} + 1" %\n%
- For %%G in (!Names!)Do ( %\n%
- Set /A "{i1}+=1" %\n%
- If "!{i1}!"=="!{n1}!" ( %\n%
- Set "!ReturnName!=%%G" %\n%
- )) %\n%
- For %%H in (!Surnames!)Do ( %\n%
- Set /A "{i2}+=1" %\n%
- If "!{i2}!"=="!{n2}!" ( %\n%
- For %%v in (!ReturnName!)Do ( %\n%
- Set "!ReturnName!=!%%v! %%H" %\n%
- ))))Else Set ReturnName=
- :# Enable DelayedExpansion for Macro Expansion
- Setlocal EnableDelayedExpansion
- :# Example usage - Define an array of 5 characters:
- For /L %%i in (1 1 5)Do %GetName%Character[%%i]
- Set Character[
- Pause
- Endlocal & Goto :Eof
Add Comment
Please, Sign In to add comment