cinch-yadr 1.0.0-arm-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +24 -0
  3. data/README.md +83 -0
  4. data/lib/cinch-yadr.rb +43 -0
  5. metadata +48 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 49de9127002cf54822c008e7c7b6aeda0cf511ce
4
+ data.tar.gz: 91bc30643c7244e4f83387ff5003f81f5505dd9d
5
+ SHA512:
6
+ metadata.gz: 5cf992e824109c4776acb5afd39a07edcd38d125607aaed024def25a5ca7f09ea14f6aed3263cb51f6e2f2f73ae24182c570c4ec7913a598831d5b44ee2bb5f9
7
+ data.tar.gz: dee705ab3ae27c0c799d526cfdfe6714bd41b48d860baf89f90082f54df2ae104ffe70376923f6f35bdd71517b5f4ccf2e855f9922d2ffbffdbb676380e2ea8f
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org>
@@ -0,0 +1,83 @@
1
+ # cinch-yadr [![Build Status](https://travis-ci.org/Cinch-RPGPlugins/cinch-yadr.svg?branch=master)](https://travis-ci.org/Cinch-RPGPlugins/cinch-yadr)
2
+ **Y**et **A**nother **D**ice **R**oller for [Cinch][cinchrb]
3
+
4
+ ## Commands
5
+ ```
6
+ !roll $d%
7
+ !roll $D%
8
+ !roll d%
9
+ !roll D%
10
+ ```
11
+ This will produce a roll of a **%** sided die **$** times.
12
+ Note that the **$** (Number of Die to be Rolled) is optional
13
+
14
+ ```
15
+ !lazy
16
+ ```
17
+ This will produce a roll of 1D20.
18
+ This is for Lazy DM/GM's who want to roll a quick D20 but dont want to type out `!roll 1D20`
19
+
20
+ ```
21
+ !help
22
+ ```
23
+ This will output the available commands
24
+
25
+ ### Example Output:
26
+ The Cinch Bot will reply with 2 lines in the following format:
27
+ ```
28
+ <Bot Name>: <User Name> Result : <Total of all die rolled>
29
+ <Bot Name>: <User Name> Breakout: [Die1, Die2, Die3, ...]
30
+ ```
31
+ Notice that the "Breakout" replies with the largest results first and sorts them
32
+
33
+ ```
34
+ Player: !roll 3d10
35
+ cinch: Rolling 3d10's
36
+ cinch: Player Results : 19
37
+ cinch: Player Breakout: [10, 7, 2]
38
+ ```
39
+
40
+ ```
41
+ Player: !roll d10
42
+ cinch: Rolling D10
43
+ cinch: Player Result : 3
44
+ ```
45
+
46
+ ```
47
+ Player: !lazy
48
+ cinch: Rolling 1D20
49
+ cinch: Player Result : 7
50
+ ```
51
+
52
+ ```
53
+ Player !help
54
+ cinch: !roll <rolls>d<sides> - Rolls <sides> die <rolls> times
55
+ cinch: !lazy - Rolls one D20
56
+ cinch: !help - Shows this Message
57
+ ```
58
+
59
+ ## Example Usage
60
+
61
+ ```ruby
62
+
63
+ require 'cinch'
64
+ require 'cinch-yadr'
65
+
66
+ bot = Cinch::Bot.new do
67
+ configure do |c|
68
+ c.server = 'irc.freenode.org'
69
+ c.nick = 'DieRollerBot'
70
+ c.channels = ['#cinch-bots']
71
+ c.plugins.plugins = [Yadr]
72
+ end
73
+ end
74
+ bot.start
75
+
76
+ ```
77
+
78
+ ## Dependencies
79
+ [Cinch][cinchrb]
80
+ [Dice-Bag][dicelib]
81
+
82
+ [cinchrb]: https://github.com/cinchrb/cinch
83
+ [dicelib]: https://github.com/syntruth/Dice-Bag
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+ require 'cinch'
3
+ require 'dicebag'
4
+
5
+ # Class: Yadr
6
+ # Purpose: Yet Another Dice Roller
7
+ # Location: https://github.com/bbourqu/cinch-yadr
8
+ #:nodoc:
9
+ class Yadr
10
+ include Cinch::Plugin
11
+
12
+ on :message, /roll (\d?{1,2}[dD]\d{1,2})/ do
13
+ :roll
14
+ end
15
+ on :message, /lazy/ do
16
+ :lazyroll
17
+ end
18
+ on :message, /help/ do
19
+ :execute
20
+ end
21
+
22
+ def roll(m, format)
23
+ m.reply "Rolling #{format} for", true
24
+ dice = DiceBag::Roll.new(format)
25
+ result = dice.result()
26
+ tally = result.sections[0].tally()
27
+ m.reply "Total : #{result}", true
28
+ m.reply "Breakout: #{tally}", true if tally.length > 1
29
+ end
30
+
31
+ def lazyroll(m)
32
+ m.reply 'Rolling 1D20'
33
+ dice = DiceBag::Roll.new('1d20')
34
+ result = dice.result()
35
+ m.reply "Result : #{result}", true
36
+ end
37
+
38
+ def execute(m)
39
+ m.reply '!roll <rolls>d<sides> - Rolls <sides> die <rolls> times'
40
+ m.reply '!help - Shows this Message'
41
+ m.reply '!lazy - Rolls 1D20'
42
+ end
43
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cinch-yadr
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: arm-linux
6
+ authors:
7
+ - Brett Bourquin
8
+ - Chase Hallsted
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-01-30 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Yet Another Dice Roller for Cinch
15
+ email:
16
+ - brett@bourqu.in
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - LICENSE
22
+ - README.md
23
+ - lib/cinch-yadr.rb
24
+ homepage: https://github.com/bbourqu/cinch-yadr
25
+ licenses:
26
+ - UNLICENSE
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.9.3
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.2.2
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: Yet Another Dice Roller for Cinch
48
+ test_files: []