-
Notifications
You must be signed in to change notification settings - Fork 2
/
Train_blacksmith.py
133 lines (124 loc) · 4.41 KB
/
Train_blacksmith.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
'''
0.0 - 50.0 producete Dagger
50.1 - 64.5 producete Mace
64.6 - 74.3 producete Cutlass
74.4 - 86.7 producete Kryss
86.8 - 95.3 producete Short Spear
95.4 - 106.4 producete Plate Gorget
106.5 - 108.9 producete Plate Gloves
109.0 - 116.3 producete Plate Arms
116.4 - 118.8 producete Plate Legs
118.9 - 120.0 producete Plate Armor
'''
gorgetID=0x1413
glovesID=0x1414
armsID=0x1410
legsID=0x1411
armorID=0x1415
tinkerID = 0x1EB8
cassaLavoro=0x40066CA7
martelloID=0x0FB5
ingotID = 0x1BF2
gumpSmelta=14
gumpTools=8
gumpMartello=100
gumpTinkerTool=23
gumpPlateGorget=65 #fino a 106.4
gumpPlateGloves=58 #fino a 108.9
gumpPlateArms=51 #fino a 116.3
gumpPlateLegs=72 #fino a 118.8
gumpPlateArmor=79 #120
cassaLingotti=0x404A31F2
def makeMartello():
xcassaLavoro = Items.FindBySerial(cassaLavoro)
if Items.BackpackCount(martelloID, -1)<2:
Items.UseItemByID(tinkerID,-1) #usa il tinker tool
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 8) # tools
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 100) # martello
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 0) # close
Misc.Pause(100)
for item in Player.Backpack.Contains:
if item.ItemID == martelloID:
Items.Move(item, cassaLavoro, 0)
Misc.Pause(1000)
def makeTinkerTool():
if Items.BackpackCount(tinkerID, -1)<2:
Items.UseItemByID(tinkerID,-1) #usa il tinker tool
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 8) # tools
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 23) # tinkertool
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 0) # close
Misc.Pause(100)
def rifornisci():
cassaLingottiX = Items.FindBySerial(cassaLingotti)
for item in cassaLingottiX.Contains:
if item.ItemID == ingotID:
if item.Hue == 0x0000:
Items.Move(item, Player.Backpack, 500)
Misc.Pause(1000)
def Crafta(gumpID):
Items.UseItemByID(martelloID,-1)#mar
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 1)#metalarmor
Gumps.WaitForGump(949095101, 10000)
Journal.Clear()
while True:
if (Player.Weight > Player.MaxWeight - 80):
break
if (int(((Items.GetPropStringList(Player.Backpack)[2].split('/', 1)[0]))[10:])>120):
break
if(Items.BackpackCount(ingotID, 0)<500):
rifornisci()
if (Journal.Search("You have worn out your tool!") or (Journal.Search("That container cannot") )):
Items.UseItemByID(martelloID,-1)#mar
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 1)#metalarmor
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, gumpID)
Gumps.WaitForGump(949095101, 10000)
Gumps.SendAction(949095101, 0)#exit
def Smelta(oggettoID):
xcassaLavoro = Items.FindBySerial(cassaLavoro)
Items.UseItemByID(martelloID,-1)#mar
Gumps.WaitForGump(949095101, 10000)
for item in xcassaLavoro.Contains:
if item.ItemID == oggettoID:
Gumps.SendAction(949095101, 14)
Target.WaitForTarget(10000, False)
Target.TargetExecute(item)#gorget
Misc.Pause(200)
Gumps.SendAction(949095101, 0)
109.0 - 116.3
def main():
rifornisci()
while Player.GetSkillValue("Blacksmith")>=95.4 and Player.GetSkillValue("Blacksmith")<106.4:
makeMartello()
makeTinkerTool()
Crafta(gumpPlateGorget)
Smelta(gorgetID)
while Player.GetSkillValue("Blacksmith")>=106.5 and Player.GetSkillValue("Blacksmith")<108.9:
makeMartello()
makeTinkerTool()
Crafta(gumpPlateGloves)
Smelta(glovesID)
while Player.GetSkillValue("Blacksmith")>=109 and Player.GetSkillValue("Blacksmith")<116.3:
makeMartello()
makeTinkerTool()
Crafta(gumpPlateArms)
Smelta(armsID)
while Player.GetSkillValue("Blacksmith")>=116.3 and Player.GetSkillValue("Blacksmith")<118.8:
makeMartello()
makeTinkerTool()
Crafta(gumpPlateLegs)
Smelta(legsID)
while Player.GetSkillValue("Blacksmith")>=118.8 and Player.GetSkillValue("Blacksmith")<120:
makeMartello()
makeTinkerTool()
Crafta(gumpPlateArmor)
Smelta(armorID)
main()