diff options
author | Dipesh Amin <yaypunkrock@gmail.com> | 2011-08-22 09:52:10 +0100 |
---|---|---|
committer | Dipesh Amin <yaypunkrock@gmail.com> | 2011-08-22 09:52:10 +0100 |
commit | 8e4acb8e54bfbd355766db3f3660c068d4e3e591 (patch) | |
tree | 52e03d407606594aa8e2662924fac803d220dbc6 /main.py | |
parent | 4868a3ce5efcfb5b14c2863d6890e489a6fb4b2c (diff) | |
download | manamarket-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-x | main.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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." |