You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Essentials/AutoCommand.cs
+33-18Lines changed: 33 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ public class AutoCommand : ViewModel
31
31
privatestring_name;
32
32
privatefloat_triggerRatio;
33
33
privatedouble_triggerCount;
34
+
privatebool_isRunning;
34
35
35
36
[XmlIgnore]
36
37
publicboolCompleted{get;set;}
@@ -57,18 +58,6 @@ public string Name
57
58
set=>SetValue(ref_name,value);
58
59
}
59
60
60
-
//[Display(Name = "Scheduled Time", GroupName = "Schedule", Description = "Sets a time of day for this command to be run. Format is HH:MM:SS. MUST use 24 hour format! Will be reset to zero if Interval is set.")]
61
-
[Display(Visible=false)]
62
-
publicstringScheduledTime
63
-
{
64
-
get=>_scheduledTime.ToString();
65
-
set
66
-
{
67
-
_scheduledTime=TimeSpan.Parse(value);
68
-
OnPropertyChanged();
69
-
}
70
-
}
71
-
72
61
[Display(Order=2,Description="Sets an interval/Time for this command to be repeated. Format is HH:MM:SS.")]
73
62
publicstringInterval
74
63
{
@@ -79,7 +68,6 @@ public string Interval
79
68
OnPropertyChanged();
80
69
if(CommandTrigger==Trigger.Timed)
81
70
{
82
-
//ScheduledTime = TimeSpan.Zero.ToString(); //I hate myself for this **FIXED!!!***
83
71
_nextRun=DateTime.Now+_interval;
84
72
}
85
73
@@ -157,6 +145,7 @@ public void Update()
157
145
158
146
if(_currentStep<Steps.Count)return;
159
147
_currentStep=0;
148
+
_cTokenSource?.Dispose();
160
149
_nextRun=_trigger==Trigger.Scheduled
161
150
?DateTime.Now.Date+_interval+TimeSpan.FromDays(1)
162
151
:_nextRun=DateTime.Now+_interval;
@@ -204,26 +193,53 @@ public override string ToString()
204
193
}
205
194
}
206
195
196
+
privateCancellationTokenSource_cTokenSource;
207
197
208
198
/// <summary>
209
199
/// Runs the command and all steps immediately, in a new thread
[Display(Name="Cut Game Tags",GroupName="Client Join Tweaks",Order=8,Description="Cuts mods and blocks limits from matchmaking server info. Prevents from 'error downloading session settings'.")]
0 commit comments