forked from ScriptB3ast/razor-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_Hiding.py
37 lines (28 loc) · 1.23 KB
/
train_Hiding.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
'''
Author: TheWarDoctor95
Other Contributors:
Last Contribution By: TheWarDoctor95 - April 12, 2019
Description: Trains Hiding to its skill cap
'''
hidingTimerMilliseconds = 10200
from Scripts.glossary.colors import colors
def TrainHiding():
'''
Trains Hiding to its skill cap
'''
if Player.GetSkillValue( 'Hiding' ) == Player.GetSkillCap( 'Hiding' ):
Player.HeadMessage( colors[ 'green' ], 'Your Hiding is already at its skill cap!' )
return
Misc.SendMessage( 'Beginning Hiding training', colors[ 'cyan' ] )
Player.UseSkill( 'Hiding' )
# Skill cooldown is 10,000 ms, but adding an extra 200 ms in case of latency issues
Timer.Create( 'hidingTimer', hidingTimerMilliseconds )
# while skill can increase and player is not dead
while not Player.IsGhost and Player.GetSkillValue( 'Hiding' ) < Player.GetSkillCap( 'Hiding' ):
if not Timer.Check( 'hidingTimer' ):
# Cooldown has finished, we can use the skill again and reset the timer
Player.UseSkill( 'Hiding' )
Timer.Create( 'hidingTimer', hidingTimerMilliseconds )
Player.HeadMessage( colors[ 'green' ], 'Congratulations! Your Hiding is now at its skill cap!' )
# Start Hiding training
TrainHiding()