diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-05 12:24:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-05 13:40:44 +0300 |
commit | 0e2fa125c8719d9ddb21aa25e5465d8005fad545 (patch) | |
tree | da94bd2f4ba783f92f58e4376d42b55ab6e28698 /hercules/code | |
parent | 105cd3c21edd3c70b917ca96e389a2b6dc04825b (diff) | |
download | evol-tools-0e2fa125c8719d9ddb21aa25e5465d8005fad545.tar.gz evol-tools-0e2fa125c8719d9ddb21aa25e5465d8005fad545.tar.bz2 evol-tools-0e2fa125c8719d9ddb21aa25e5465d8005fad545.tar.xz evol-tools-0e2fa125c8719d9ddb21aa25e5465d8005fad545.zip |
hercules: convert "set var, val" into "var = val"
Diffstat (limited to 'hercules/code')
-rw-r--r-- | hercules/code/server/npcs.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hercules/code/server/npcs.py b/hercules/code/server/npcs.py index 130f944..2082b23 100644 --- a/hercules/code/server/npcs.py +++ b/hercules/code/server/npcs.py @@ -30,6 +30,8 @@ monsterRe = re.compile("^(?P<map>[^/](.+))[.]gat,([ ]*)(?P<x>[\d]+),([ ]*)(?P<y> "(?P<tag>monster)[\t](?P<name>[\w#' ]+)[\t]" "(?P<class>[\d]+),(?P<num>[\d]+),(?P<look>[\d-]+),(?P<delay1>[\d]+),(?P<delay2>[\d]+)$") +setRe = re.compile("^(?P<space>[ ]+)set[ ](?P<var>[^,]+),([ ]*)(?P<val>[^;]+);$"); + class ScriptTracker: pass @@ -270,5 +272,10 @@ def processStrReplace(tracker): line = line[:idx2 + 1] + ",\"all\"" + line[idx2 + 1:] line = line.replace("getmapmobs(", "mobcount(") + + m = setRe.search(line); + if m != None: + line = "{0}{1} = {2};\n".format(m.group("space"), m.group("var"), m.group("val")) + w.write(line) |