From fd7a6b22300c7d480dd13e1cfd5ef96c5f07e80b Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 13 Sep 2012 09:05:03 +1200 Subject: [PATCH 1/5] Made .coin with no arguments work again --- plugins/coin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/coin.py b/plugins/coin.py index 5fdc906..22b64b2 100755 --- a/plugins/coin.py +++ b/plugins/coin.py @@ -9,7 +9,7 @@ def coin(inp, me=None): try: amount = int(inp) except ValueError: - return "Invalid input!" + amount = 1 if amount == 1: if getrandbits(1): From 80e58edc569c747b17aca0fdf50df0b7c5e5b539 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 13 Sep 2012 09:08:24 +1200 Subject: [PATCH 2/5] no this --- plugins/coin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/coin.py b/plugins/coin.py index 22b64b2..0a2c958 100755 --- a/plugins/coin.py +++ b/plugins/coin.py @@ -6,9 +6,12 @@ import random def coin(inp, me=None): "coin [amount] -- Flips [amount] of coins." - try: - amount = int(inp) - except ValueError: + if inp: + try: + amount = int(inp) + except (ValueError, TypeError): + return "Invalid input!" + else: amount = 1 if amount == 1: From 22543f220651d950afec933264ed04066aa66eca Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 13 Sep 2012 09:14:58 +1200 Subject: [PATCH 3/5] stupid stupid stupid --- plugins/coin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/coin.py b/plugins/coin.py index 0a2c958..607fe62 100755 --- a/plugins/coin.py +++ b/plugins/coin.py @@ -15,7 +15,7 @@ def coin(inp, me=None): amount = 1 if amount == 1: - if getrandbits(1): + if random.getrandbits(1): me("flips a coin and gets heads.") else: me("flips a coin and gets tails.") From 543811d0099d93591f9357a49eb6a1397966cae5 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 13 Sep 2012 09:19:21 +1200 Subject: [PATCH 4/5] FFFFFFFFFFFFFF --- plugins/coin.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/coin.py b/plugins/coin.py index 607fe62..d96c587 100755 --- a/plugins/coin.py +++ b/plugins/coin.py @@ -15,10 +15,6 @@ def coin(inp, me=None): amount = 1 if amount == 1: - if random.getrandbits(1): - me("flips a coin and gets heads.") - else: - me("flips a coin and gets tails.") me("flips a coin and gets %s." % random.choice(["heads", "tails"])) elif amount == 0: me("makes a coin flipping motion with its hands.") From 4836b324dfb858130106829ad471dd94a027fcf7 Mon Sep 17 00:00:00 2001 From: Neer Sighted Date: Tue, 18 Sep 2012 18:05:05 -0700 Subject: [PATCH 5/5] Fix README typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7862707..a5e27e9 100755 --- a/README.md +++ b/README.md @@ -111,11 +111,11 @@ The programs `daemon` or `screen` are recomended for the launcher to run optimal The developers of CloudBot run two CloudBots on [Espernet](http://esper.net). -They can both be found in [#CloudBot](irc://irc.esper.net/cloudbot "Connect via IRC to #CloudBot on irc.esper.net). +They can both be found in [#CloudBot](irc://irc.esper.net/cloudbot "Connect via IRC to #CloudBot on irc.esper.net"). **mau5bot** is the semi-stable bot, and runs on the latest stable development version of CloudBot. (mau5bot is running on **Ubuntu Server** *12.04* with **Python** *2.7.3*) -**neerbot** is currently running an outdated version of the develop branch. (neerbot is running on **Debian** *Wheezy/Testing* with **Python** *2.7.2*) +**neerbot** is unstable bot, and runs on the `HEAD` of the `develop` branch. (neerbot is running on **Debian** *Wheezy/Testing* with **Python** *2.7.2*) ## License