forked from ScriptB3ast/razor-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_Veterinary.py
64 lines (48 loc) · 2.3 KB
/
train_Veterinary.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
'''
Author: TheWarDoctor95
Other Contributors:
Last Contribution By: TheWarDoctor95 - April 19, 2019
Description: Uses bandages on a pet's ghost to train Veterinary
'''
from Scripts.config import targetClearDelayMilliseconds
from Scripts.glossary.items import FindBandage
from Scripts.glossary.colors import colors
def TrainVeterinary():
'''
Trains Veterinary to the skill cap
'''
if Player.GetRealSkillValue( 'Veterinary' ) == Player.GetSkillCap( 'Veterinary' ):
Misc.SendMessage( 'You\'ve already maxed out Veterinary!', colors[ 'green' ] )
return
bandages = FindBandage( Player.Backpack )
if bandages == None:
Misc.SendMessage( 'No bandages to train with', colors[ 'red' ] )
return
ghost = Target.PromptTarget( 'Select ghost to train on' )
Mobiles.Message( ghost, colors[ 'cyan' ], 'Selected for Veterinary training' )
Journal.Clear()
while not Player.IsGhost and Player.GetRealSkillValue( 'Veterinary' ) < Player.GetSkillCap( 'Veterinary' ):
# Clear any previously selected target and the target queue
Target.ClearLastandQueue()
# Wait for the target to finish clearing
Misc.Pause( targetClearDelayMilliseconds )
Items.UseItem( bandages )
Target.WaitForTarget( 2000, True )
Target.TargetExecute( ghost )
# Wait for a journal entry to come up stating that the bandage application has finished
while not ( Journal.SearchByType( 'You are able to resurrect the creature.', 'Regular' ) or
Journal.SearchByType( 'You fail to resurrect the creature', 'Regular' ) ):
if Journal.SearchByType( 'The pet\'s owner must be nearby to attempt the resurrection.', 'Regular' ):
Misc.SendMessage( 'The pet\'s owner left, cannot continue training Veterinary', colors[ 'red' ] )
return
Misc.Pause( 100 )
Journal.Clear()
bandages = FindBandage( Player.Backpack )
if bandages == None:
Misc.SendMessage( 'Ran out of bandages to train with', colors[ 'red' ] )
return
Misc.Pause( 50 )
if Player.GetRealSkillValue( 'Veterinary' ) == Player.GetSkillCap( 'Veterinary' ):
Misc.SendMessage( 'Veterinary training complete!', colors[ 'green' ] )
# Start Veterinary training
TrainVeterinary()