Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gerdoe-jr/tw-econ
Rust library for using Teeworlds external console
https://github.com/gerdoe-jr/tw-econ
cli teeworlds
Last synced: 3 months ago
JSON representation
Rust library for using Teeworlds external console
- Host: GitHub
- URL: https://github.com/gerdoe-jr/tw-econ
- Owner: gerdoe-jr
- Created: 2021-05-26T20:54:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-25T14:57:05.000Z (almost 2 years ago)
- Last Synced: 2024-07-13T05:46:57.996Z (7 months ago)
- Topics: cli, teeworlds
- Language: Rust
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tw-econ
## Description
Rust library provides you a simple synchronous interface to interconnect with Teeworlds external console.## Example
Let's say you have Teeworlds server running with `ec_password zohan` and `ec_port 6060` and you want to use it's econ.
```rust
use tw_econ::Econ;fn main() -> std::io::Result<()> {
let mut econ = Econ::new();econ.connect("127.0.0.1:6060")?;
let authed = econ.try_auth("nahoz")?;
assert_eq!(authed, false);let authed = econ.try_auth("hozan")?;
assert_eq!(authed, false);let authed = econ.try_auth("zohan")?;
assert_eq!(authed, true);econ.send_line("echo \"Hi\"")?;
println!("{}", econ.recv_line(true)?);Ok(())
}
```## Projects
* [tw-econ-tui](https://github.com/gerdoe-jr/tw-econ-tui)