Skip to content

raygoe/vpsdk-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vpsdk-rs

A safe, Rust wrapper around vpsdk.

Requirements

  • vpsdk = 4 (r1779)

You should make sure that you install the VPSDK into a directory and create an environment variable, VPSDK_DIR, that points to the library.

Installing

At the moment, I've not put it on cargo.io. In order to use it you can follow this:

$ cargo new --new greeter-bot

Then you will need to modify your Cargo.toml file and add the git repo as a dependency:

$ nano Cargo.toml

[dependencies]
vpsdk = { git = "https://github.com/raygoe/vpsdk-rs" }

After that, you can use the sdk:

 $ nano src/main.rs
extern crate vpsdk;

use vpsdk::Sdk;

fn main() {
    let mut sdk = Sdk::create("universe.virtualparadise.org", 57000).expect("Could not connect!");
    sdk.login("<USERNAME>", "<PASSWORD>", "Rust Bot").expect("Could not login!");
    sdk.enter("Blizzard").expect("Could enter world!");
    sdk.update().expect("Could not update!");
}

Then, you can just start the bot!

$ cargo run

FAQ

If I run my bot on 'nix, it complains that it cannot find libvpsdk.so!

You can either do something like LD_LIBRARY_PATH=$VPSDK_DIR ./greeter_bot or copy the .so file into the same directory as the executable and then make sure you modify the rpath and rebuild:

$ cargo rustc  --release -- -C link-args="-Wl,-rpath,."

About

Rust bindings for VPSDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages