diff options
author | Livio Recchia <recchialivio@libero.it> | 2020-04-05 14:52:49 +0200 |
---|---|---|
committer | Livio Recchia <recchialivio@libero.it> | 2020-04-05 14:52:49 +0200 |
commit | 19a25076dcddb4c1219909cf7572b85e9b4d4a2a (patch) | |
tree | cc25d204a50d85292eb518a08256e4bb5b953983 /plugins/shop.py | |
parent | 2d6470e55dee3cb70f5ac41923792371d6674b3c (diff) | |
download | manachat-19a25076dcddb4c1219909cf7572b85e9b4d4a2a.tar.gz manachat-19a25076dcddb4c1219909cf7572b85e9b4d4a2a.tar.bz2 manachat-19a25076dcddb4c1219909cf7572b85e9b4d4a2a.tar.xz manachat-19a25076dcddb4c1219909cf7572b85e9b4d4a2a.zip |
Trying to fix something like setting files.
Diffstat (limited to 'plugins/shop.py')
-rwxr-xr-x[-rw-r--r--] | plugins/shop.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/plugins/shop.py b/plugins/shop.py index 44c5db8..be66cea 100644..100755 --- a/plugins/shop.py +++ b/plugins/shop.py @@ -7,6 +7,7 @@ import chatbot import logicmanager import status import badge +import random from net.inventory import get_item_index from net.trade import reset_trade_state from utils import encode_str, extends @@ -67,6 +68,20 @@ def cleanup(): s.index = 0 s.start_time = 0 +sell_greetings = [ + "Hi {0}! Welcome to my shop!", + "Hey {0}, wanna something?", + "Let\'s do business!", + "Yeah! Spend your money here!", + "Shop here {0}, yes!", +] + +buy_greetings = [ + "Okay! Let's see what you've got to sell!", + "Hmm? Something interesting to trade?", + "Hey {0}, I'm not going to buy garbage!", + "Uh? Sorry I was\'t listening.", +] # ========================================================================= def selllist(nick, message, is_whisper, match): @@ -75,10 +90,14 @@ def selllist(nick, message, is_whisper, match): if nick in nobuy: mapserv.cmsg_chat_message("Special prize for you, " + nick + "!") time.sleep(5) + else: + answer = random.choice(sell_greetings) + mapserv.cmsg_chat_message(answer.format(nick)) + + time.sleep(5) # ~ return # Support for 4144's shop (Sell list) data = '\302\202B1' - for id_, (price, amount) in selling.iteritems(): index = get_item_index(id_) if index < 0: @@ -99,7 +118,9 @@ def selllist(nick, message, is_whisper, match): def buylist(nick, message, is_whisper, match): if not is_whisper: return - + answer = random.choice(buy_greetings) + mapserv.cmsg_chat_message(answer.format(nick)) + time.sleep(5) # Support for 4144's shop (Sell list) data = '\302\202S1' |