IRC bot for HW pinging with the Dream Cheeky Thunder missile launcher.
The bot was tested on ruby 2.0.0-p643, but it should work with other versions. It uses libusb for the USB communication and cinch as the IRC client.
gem install hwpinghwping [options]The bot uses ./config.yml as a configuration file, which is automatically saved upon exit. An alternative configuration file can be specified with the -c/--config-file argument.
The default settings are those:
---
nick: hwping
server: irc.freenode.net
port: 6667
channels: # an array of channels to listen without the beginning # symbol
- hwping-test
auth_nicks: # an array of nicks to obey
targets: # a hash in {nick => [x, y]} format specifying the possible targets
webcam:
path: /tmp # the folder where the image will be savedhwping <nick>- fire a rocket at <nick> when he has been set as a target and is present in the channel's user list
help- displays a help textsnap- creates a snapshot with the attached webcamera and returns with its URLpanorama- creates a panorama with the attached webcamera and returns with its URLfire- fires a rocketreset- resets the launcher into the default position (bottom-left)position- returns the actual position of the rocket launcher<direction> <ms>- rotates the launcher into the given direction (up, down, left, right) for the given millisecondstarget list- displays the list of the available targetstarget get <nick>- displays the coordinates of <nick>target del <nick>- deletes the coordinates of <nick>target set <nick>- sets the coordinates of <nick> to the actual positiontarget set <nick> <X> <Y>- sets the coordinates of <nick> to right(X), up(Y)
- Listen to a nick other than
hwping - High-precision timer for better positioning
- Event-based solution instead of threads
- Add a superuser to modify the list of authorized users during runtime
This project is released under the GPLv2 license.
The launcher code in lib/hwping/launcher.rb was inspired by robhurring/thunder.