forked from ScriptB3ast/razor-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
train_AnimalLore.py
39 lines (30 loc) · 1.38 KB
/
train_AnimalLore.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
'''
Author: TheWarDoctor95
Other Contributors:
Last Contribution By: TheWarDoctor95 - March 14, 2019
Description: Uses the selected target to train Animal Lore to its cap
'''
from Scripts.glossary.colors import colors
animalLoreTimerMilliseconds = 1200
# Select what to run Animal Lore on
animalLoreTarget = Target.PromptTarget( 'Select animal to train on' )
Mobiles.Message( animalLoreTarget, 52, 'Selected for animal lore training' )
def TrainAnimalLore():
'''
Trains Animal Lore with the selected target
'''
global animalLoreTarget
Timer.Create( 'animalLoreTimer', 1 )
targetStillExists = Mobiles.FindBySerial( animalLoreTarget )
while targetStillExists != None and not Player.IsGhost and Player.GetRealSkillValue( 'Animal Lore' ) < Player.GetSkillCap( 'Animal Lore' ):
if not Timer.Check( 'animalLoreTimer' ):
Player.UseSkill( 'Animal Lore' )
Target.WaitForTarget( 2000, True )
Target.TargetExecute( animalLoreTarget )
Timer.Create( 'animalLoreTimer', animalLoreTimerMilliseconds )
if targetStillExists == None:
Player.HeadMessage( colors[ 'red' ], 'Selected target for animal lore is gone' )
elif Player.GetRealSkillValue( 'Animal Lore' ) >= Player.GetSkillCap( 'Animal Lore' ):
Player.HeadMessage( colors[ 'green' ], 'Animal Lore training complete!' )
# Start Training
TrainAnimalLore()