Skip to content

pival13/FehWikiBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fire Emblem Heroes Wiki Bot

Note: Theses scripts are currently being rewritten as classes, in order to no longer depends on feh-assets-json, now archived. They are available on the dev branch. The dependencies are the same, minus the feh-assets-json repository. However a JSON folder is still required for some steps.

This repository hosts various Python3 scripts use to create and update pages on the Fire Emblem Heroes Wiki.

It is a clone of the same gitlab repository and may therefore be out of date or broken compared to it.

Utilisation

Dependencies

The following dependencies are needed in order to the scripts to work properly:

  • feh-assets-json: HertzDevil repository containing converted version of the Fire Emblem Heroes binaries into JSON objects. This repository will be use whenever possible, and is assumed to always be up-to-date.
  • requests: A module use to perform HTTP requests. Needed in order to create or alter pages, or use the Fire Emblem Heroes Wiki API.
  • num2words: A module use to convert a number into a string.
  • PIL or Pillow: A module use to manipulate image. Needed for everything image related.

The next dependencies are only use by the Reverse part:

  • feh-bin: A Ruby module use to compress and decompress FeH binaries (format .bin.lz).
  • pycrypto: A module use to decrypt reward informations, as those are encrypted using an AES in Counter mode.

Depending what is your intent using this repository, all dependencies may not be necessaries.

Personal Data

A PersonalData.py module must be created. This module is use to get some of the needed informations, such as the location of the Fire Emblem Heroes files, or the user who will be use to perform posts.

Details about this module as well as an example can be found here.

JSON objects

Some modules will try to read json objects from the json folder you specified (JSON_ASSETS_DIR_PATH), which are not present by default on the feh-assets-json repository.

The json needed are those from sounds and background musics. However you can use the following python script in order to create them.

Show / Hide
#! /usr/bin/env python3

from os import listdir, makedirs
from os.path import isfile
from Reverse import reverseBGM, reverseSound
from util import BINLZ_ASSETS_DIR_PATH as BINLZ, JSON_ASSETS_DIR_PATH as JSON

path = BINLZ + '/Common/SRPG/StageBgm/'
try: makedirs(path.replace(BINLZ, JSON))
except FileExistsError: pass
for file in listdir(path):
    if isfile(path+file) and file[-7:] == '.bin.lz':
        try:
            with open(path.replace(BINLZ, JSON) + file[:-7] + '.json', 'x', encoding='utf-8') as f:
                print(reverseBGM(file[:-7]), file=f)
        except FileExistsError:
            print(f"BGM file '{file[:-7]}.json' already exist")

path = BINLZ + '/Common/Sound/arc/'
try: makedirs(path.replace(BINLZ, JSON))
except FileExistsError: pass
for file in listdir(path):
    if isfile(path+file) and file[-7:] == '.bin.lz':
        try:
            with open(path.replace(BINLZ, JSON) + file[:-7] + '.json', 'x', encoding='utf-8') as f:
                print(reverseSound(file[:-7]), file=f)
        except FileExistsError:
            print(f"Sound file '{file[:-7]}.json' already exist")

Scripts

See here for a description of each and every scripts

About

Hold several bot and modules usable on bot for the Fire Emblem Heroes Wiki.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published