Editing
Area Coordinate List
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== The Script == <nowiki> import re import math from collections import namedtuple f = open("icesus_atlas.txt") txt = f.read() def try_pat(pattern): return re.finditer(pattern, txt) matches = try_pat(r"\?[^\w\(]*([\w\s'.]*)\((\d+)[^\(\)]*?,[^\(\)]*?(\d+)\)") Area = namedtuple("Area", ["name", "x", "y"]) areas = [] for m in matches: n, x, y = m.group(1, 2, 3) # Try to clean up the name: get rid of all repeated upper case letters at # the beginning, and any lower case letter followed by an upper case letter. cleaned1 = re.match("[A-Z]*([A-Z][^A-Z].*)", n) cleaned2 = re.match("[a-z]*([A-Z][^A-Z].*)", n) if cleaned1 is not None and len(cleaned1.group(1)): n = cleaned1.group(1) if cleaned2 is not None and len(cleaned2.group(1)): n = cleaned2.group(1) areas.append(Area(name=n, x=x, y=y)) # This script mostly extracts all the areas, but it misses Vaerlon because # it's not marked with ? on the map. In general this can't be perfect, but # Vaerlon is important enough that we want to add it manually. vaerlon = Area(name="Vaerlon", x="505", y="632") areas.append(vaerlon) print('{| class="wikitable sortable"') print("|-") print("! Name") print("! X") print("! Y") print("! Distance From Vaerlon") vaer_x, vaer_y = (505, 632) areas.sort(key=lambda a: a.name) for a in areas: vaer_dist = int(math.sqrt((int(a.x) - vaer_x) ** 2 + (int(a.y) - vaer_y) ** 2)) print("|-") print("|{} || {} || {} || {}".format(a.name, a.x, a.y, vaer_dist)) print("|}") </nowiki> [[category:Player's Handbook]][[Category:Newbie tome]]
Summary:
Please note that all contributions to Icesus Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Icesus Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
icesus.org
Back to icesus.org
Play Now
Forums
Atlas
Navigation
Main page
Command book
Guilds
Items
Maps
MK2 stats
Open guilds
Secondary guilds
Professional guilds
Racial guilds
Races
Skills and spells
Rulebook
Player's Handbook
Prestigious Monsters
Worldbook
Recent changes
Contributors
Tools
What links here
Related changes
Special pages
Page information