summaryrefslogtreecommitdiff
path: root/wiki
diff options
context:
space:
mode:
Diffstat (limited to 'wiki')
-rwxr-xr-xwiki/tmw_deploy.py14
-rwxr-xr-xwiki/tmw_wikigen.py7
-rwxr-xr-xwiki/wikigen.py2
3 files changed, 19 insertions, 4 deletions
diff --git a/wiki/tmw_deploy.py b/wiki/tmw_deploy.py
index 2f497d9..fc34904 100755
--- a/wiki/tmw_deploy.py
+++ b/wiki/tmw_deploy.py
@@ -11,6 +11,7 @@ with open("password.txt") as f:
## Setup (also handles cookies on its own due to Session)
url = "https://wiki.themanaworld.org/api.php"
S = requests.Session()
+S.proxies={'https': "socks5://localhost:2121"} # <- Proxy mandatory
#r=S.post("%s?action=edit&format=json" % url)
@@ -28,9 +29,16 @@ login["lgtoken"]=token
login["format"]="json"
## *Actual* Login
-r=S.post("%s" % url, data=login)
-assert r.status_code == 200
-assert r.json()['login']['result'] == "Success"
+try:
+ r=S.post("%s" % url, data=login)
+ assert r.status_code == 200
+ assert r.json()['login']['result'] == "Success"
+except:
+ traceback.print_exc()
+ print(repr(r))
+ print(r.text)
+ print("Also, make sure the IP you have used is allowed.")
+ exit(1)
## Retrieve CSRF Token
r=S.get("%s?action=query&meta=tokens&format=json" % url)
diff --git a/wiki/tmw_wikigen.py b/wiki/tmw_wikigen.py
index 17c881a..8754a56 100755
--- a/wiki/tmw_wikigen.py
+++ b/wiki/tmw_wikigen.py
@@ -20,6 +20,7 @@ IT_ETC=[]
IT_USABLE=[]
IT_AMMO=[]
IT_CARD=[]
+IT_FOOD=[]
IT_PETEGG=[]
IT_WEAPON={ 'HAND_2': [], # TWO HAND (LR)
'HAND_1':[]} # WEAPONS (R)
@@ -386,6 +387,8 @@ def ItAlloc(it):
IT_ARMOR['EQP_MOUNT'].append(it)
elif 'EQP_SHADOW_ACC_R' in it.loc:
IT_ARMOR['EQP_ACC_R'].append(it) # Not really
+ elif 'EQP_SHADOW_ACC_L' in it.loc:
+ IT_FOOD.append(it)
else:
raise Exception("Invalid Loc for ID %s: %s" % (it.id, it.loc))
@@ -537,6 +540,10 @@ def writeItems():
wikia.write("== Pet Eggs ==\n")
ItemWrite(IT_PETEGG, ID=True, AEGIS=True, NAME=True, WEIGHT=True)
+ # Cooked Food Items
+ wikia.write("== Cooked Food ==\n")
+ ItemWrite(IT_FOOD, ID=True, AEGIS=True, NAME=True, WEIGHT=True, SCRIPT=True)
+
# Mount Items
wikia.write("== Mounts ==\n")
ItemWrite(IT_ARMOR['EQP_MOUNT'], ID=True, AEGIS=True, NAME=True, WEIGHT=True)
diff --git a/wiki/wikigen.py b/wiki/wikigen.py
index 3cae540..5104d64 100755
--- a/wiki/wikigen.py
+++ b/wiki/wikigen.py
@@ -535,7 +535,7 @@ def writeItems():
wikia.write("## Pet Eggs\n")
ItemWrite(IT_PETEGG, ID=True, AEGIS=True, NAME=True, WEIGHT=True)
- # Ammo Items
+ # Cooked Food Items
wikia.write("## Cooked Food\n")
ItemWrite(IT_FOOD, ID=True, AEGIS=True, NAME=True, WEIGHT=True, SCRIPT=True)