Giter VIP home page Giter VIP logo

fehwikibot's Introduction

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

fehwikibot's People

Contributors

pival13 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.