summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-08-22 09:52:10 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2011-08-22 09:52:10 +0100
commit8e4acb8e54bfbd355766db3f3660c068d4e3e591 (patch)
tree52e03d407606594aa8e2662924fac803d220dbc6 /main.py
parent4868a3ce5efcfb5b14c2863d6890e489a6fb4b2c (diff)
downloadmanamarket-8e4acb8e54bfbd355766db3f3660c068d4e3e591.tar.gz
manamarket-8e4acb8e54bfbd355766db3f3660c068d4e3e591.tar.bz2
manamarket-8e4acb8e54bfbd355766db3f3660c068d4e3e591.tar.xz
manamarket-8e4acb8e54bfbd355766db3f3660c068d4e3e591.zip
Improve the !info message, when no items are being sold.
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.py b/main.py
index 41f5059..a6c5a03 100755
--- a/main.py
+++ b/main.py
@@ -102,7 +102,7 @@ def process_whisper(nick, msg, mapserv):
mapserv.sendall(whisper(nick, "Your current access level is 0."))
elif int(user.get('accesslevel')) > 0:
mapserv.sendall(whisper(nick, "Your current access level is " + user.get('accesslevel') + "."))
- mapserv.sendall(whisper(nick, "Your have the following items for sale:"))
+ items_for_sale = False
for elem in sale_tree.root:
if elem.get('name') == nick:
if time.time() - float(elem.get('add_time')) > config.relist_time:
@@ -112,8 +112,16 @@ def process_whisper(nick, msg, mapserv):
msg += elem.get("uid") + "] " + elem.get("amount") + " [@@" + elem.get("itemId") + "|" + \
ItemDB.getItem(int(elem.get("itemId"))).name + "@@] for " + elem.get("price") + "gp each"
+
+ if items_for_sale == False:
+ mapserv.sendall(whisper(nick, "Your have the following items for sale:"))
+ items_for_sale = True
+
mapserv.sendall(whisper(nick, msg))
+ if items_for_sale == False:
+ mapserv.sendall(whisper(nick, "Your have no items for sale."))
+
money = int(user.get('money'))
mapserv.sendall(whisper(nick, "You have " + str(money) + "gp to collect."))
stall_msg = "You have " + str(int(user.get('stalls')) - int(user.get('used_stalls'))) + " free slots."