summaryrefslogtreecommitdiff
path: root/plugins/shop.py
diff options
context:
space:
mode:
authorLivio Recchia <recchialivio@libero.it>2020-04-08 06:37:08 +0200
committerLivio Recchia <recchialivio@libero.it>2020-04-08 06:37:08 +0200
commit8cf15f384f752f97df5749a39f4912ece3c4ed9e (patch)
treedfc2f80a816c4084bc7f8d7c06f82da1d0f119c2 /plugins/shop.py
parent610f3ea4f9414b79cc0678b44634344170edf1cf (diff)
downloadmanachat-8cf15f384f752f97df5749a39f4912ece3c4ed9e.tar.gz
manachat-8cf15f384f752f97df5749a39f4912ece3c4ed9e.tar.bz2
manachat-8cf15f384f752f97df5749a39f4912ece3c4ed9e.tar.xz
manachat-8cf15f384f752f97df5749a39f4912ece3c4ed9e.zip
Improved shop greeting message system
Diffstat (limited to 'plugins/shop.py')
-rwxr-xr-xplugins/shop.py43
1 files changed, 26 insertions, 17 deletions
diff --git a/plugins/shop.py b/plugins/shop.py
index cf8a113..adeb66f 100755
--- a/plugins/shop.py
+++ b/plugins/shop.py
@@ -18,8 +18,7 @@ from chat import send_whisper as whisper
__all__ = [ 'PLUGIN', 'init', 'shoplog', 'buying', 'selling' ]
-#nobuy = ['Manatauro', 'ManatauroMage', 'Manatauro Shop', 'kytty']
-nobuy = ['kirito123']
+nobuy = []
PLUGIN = {
'name': 'shop',
@@ -36,6 +35,31 @@ shoplog = logging.getLogger('ManaChat.Shop')
trade_timeout = 60
shop_admins = None
+# FIXME Put on a specified library
+def preloadArray(nfile):
+ try:
+ file = open(nfile, "r")
+ array=[]
+ for x in file.readlines():
+ x = x.replace("\n", "")
+ x = x.replace("\r", "")
+ array.append(x)
+ file.close()
+ return array
+ except:
+ print "preloadArray: File " + nfile + " not found!"
+
+sell_greetings = [
+ "Hi {0}! Welcome to my shop!",
+]
+
+buy_greetings = [
+ "Okay! Let's see what you've got to sell!",
+]
+
+sell_greetings = preloadArray("config/sellGreetings.txt")
+buy_greetings = preloadArray("config/buyGreetings.txt")
+
class s:
player = ''
@@ -68,21 +92,6 @@ 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):
if not is_whisper: