Skip to content
Programmable pseudo AI KAWARI 7 on JavaScript
C++ C Makefile Other
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
kawari-750-kdt
.bzrignore
.npmignore
Readme.md
bower.json
package.json

Readme.md

kawari7.js

Programmable pseudo AI KAWARI 7 on JavaScript

Original SHIORI module

KAWARI by KAWARI Development Team

Caution: This module is maintained by Narazaka and not officially supported by KAWARI Development Team. Do not report bugs or something that is caused by kawari.js to KAWARI Development Team.

Installation

bower install kawari7.js

or download zip archive and get kawari7.js

Usage

This module has only low level API, that is provided by emscripten.

So use the wrapper module, nativeshiori, and do like below.

<script src="encoding.min.js"></script>
<script src="nativeshiori.js"></script>
<script src="kawari7.js"></script>
<script>

var kawari_ini_str = 'dict : dict.txt\r\n';
var kawari_ini = Encoding.convert(Encoding.stringToCode(kawari_ini_str), 'SJIS', 'UNICODE');
var dict_txt_str = 'event.OnBoot : Hello World\r\n';
var dict_txt = Encoding.convert(Encoding.stringToCode(dict_txt_str), 'SJIS', 'UNICODE');
var storage = {
  'kawari.ini': new Uint8Array(kawari_ini), // filename: ArrayBufferView
  'dict.txt': new Uint8Array(dict_txt)
};

// Shiori instance and optional storage (/path/to/ghost/master/*)
var nativeshiori = new NativeShiori(new Kawari7(), storage);

// write files in storage to FS then load() if storage exists, else load()
var load_code = nativeshiori.load('/path/to/ghost/master'); 

// request()
var response = nativeshiori.request('GET Sentence SHIORI/2.6\r\nCharset: Shift_JIS\r\nEvent: OnBoot\r\n\r\n');

// unload()
var unload_code = nativeshiori.unload();

</script>

LICENSE

(C) 2014 Narazaka : Licensed under The BSD 3-Clause License

Something went wrong with that request. Please try again.