forked from ScriptB3ast/razor-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource_smelting.py
56 lines (43 loc) · 1.49 KB
/
resource_smelting.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
'''
Author: TheWarDoctor95
Other Contributors:
Last Contribution By: TheWarDoctor95 - March 22, 2019
Description: Smelts all ore into ingots
'''
enableSmeltFromPet = True
from Scripts.glossary.items.ores import ores
from Scripts.glossary.colors import colors
from Scripts import config
messages = [
'You smelt the ore removing the impurities and put the metal in your backpack.',
'You burn away the impurities but are left with less useable metal.',
'You skillfully extract extra metal out of the ore pile.'
]
def SmeltAllInMobile( mobile ):
'''
Smelts all raw ore in the target mobiles backpack
'''
global ores
Journal.Clear()
for ore in ores:
oreStack = Items.FindByID( ores[ ore ].itemID, -1, mobile.Backpack.Serial )
while oreStack != None:
Items.UseItem( oreStack )
Misc.Pause( config.dragDelayMilliseconds )
oreStack = Items.FindByID( ores[ ore ].itemID, -1, mobile.Backpack.Serial )
def Smelt():
'''
Smelts all raw ore into ingots
'''
global enableSmeltFromPet
if enableSmeltFromPet:
pet = Target.PromptTarget( 'Select pet the ore is stored in' )
if pet == None:
Misc.SendMessage( 'Could not find pet! Will attempt to smelt any ore in your backpack.', 1100 )
else:
pet = Mobiles.FindBySerial( pet )
SmeltAllInMobile( pet )
SmeltAllInMobile( Player )
Player.HeadMessage( colors[ 'green' ], 'Done smelting!' )
# Start smelting
Smelt()