rustfire

Crates.iorustfire
lib.rsrustfire
version0.2.0
sourcesrc
created_at2023-02-26 15:40:46.220457
updated_at2023-02-26 20:20:23.804604
descriptionA crate that allows you to use Rust to generate DiamondFire templates.
homepagehttps://crates.io/crates/rustfire
repositoryhttps://github.com/akarahdev/rustfire
max_upload_size
id795233
size22,555
Endistic (akarahdev)

documentation

https://docs.rs/rustfire

README

Rustfire

open issues rustfire version maintain status docs status chat

Note: This project is not ready for full usage. Please refrain from main usage until 1.0.0. This is because syntax is constantly changing and new systems are being added/removed.

RustFire is a project coded in Rust. It allows users to create DiamondFire templates through the use of the Rust programming language.

Installation

You can either type the following into your command prompt:

cargo add rustfire

or add the following to your cargo.toml:

[dependencies]
rustfire = "0.2.0"

Dependencies of this will be installed automatically.

After this, you will want to install Python 3 (if you don't have it already) and add the following to the root directory of your project. This file should be called send.py:

import socket
import sys
import json

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

try:
    # Connect to server and send data
    sock.connect(("localhost", 31372))
    sock.sendall(bytes(sys.argv[1],encoding="utf-8"))
finally:
    sock.close()

This code opens a socket on 31372 for RustFire to send templates through. This will later be implemented as base into RustFire.

Usage

Here is a basic program written in RustFire.

use rustfire::*;

// Code to be ran. This is usually split into multiple functions.
fn main() {
    build_set!("Player Join Event"); // Template name. System will soon be reworked.
    player_event!(join); // Player Join Event. 
    select!(all_players); // Select all players. By default, all codeblocks have the Selection target. This system will be reworked soon.
    player_action!(send_message "text::&a&lJOINED! &e%default &7has joined!"); // Send the player a message
    build!(); // Send code to Recode.
}

Check the examples directory for more examples.

Contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project falls under the MIT license. Read it at LICENSE.txt

Documentation

coming soonTM

Commit count: 14

cargo fmt