-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemAdder.py
33 lines (33 loc) · 1.19 KB
/
ItemAdder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
ItemFile = open("Items.txt", 'r')
EnchantmentFile = open("Enchantment.txt", 'r')
itemList = ItemFile.readlines();
enchantmentList = EnchantmentFile.readlines();
print(itemList);
ItemFile.close();
moreItems = 'y'
while True:
iType = input("Enchantment or Item? [E/I]: ")
itemName = input("What is the name of the item: ")
itemName = "'" + itemName + "'"
itemTarget = input("What is the target stat: ")
itemTarget = "'" + itemTarget + "'"
itemValue = input("What is the stat increase or decrease: ")
itemValue = "'" + itemValue + "'"
itemPrecent = input("Is the value a precent [T/F]: ")
itemPrecent = "'" + itemPrecent + "'"
item = itemName + itemTarget + itemValue + itemPrecent + '\n'
moreItems = input("Do you have more items[Y/N]: ")
if (iType == 'I'):
itemList.append(item)
else:
enchantmentList.append(item)
if (moreItems == 'N'):
break
ItemFile = open("Items.txt", 'w')
EnchantmentFile = open("Enchantment.txt", 'w')
itemList[0] = str(len(itemList) - 1) + '\n'
enchantmentList[0] = str(len(enchantmentList) - 1) + '\n'
ItemFile.writelines(itemList)
EnchantmentFile.writelines(enchantmentList)
ItemFile.close()
EnchantmentFile.close()