Author Topic: timers.starttimer  (Read 2353 times)

superjer2000

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
timers.starttimer
« on: July 09, 2013, 07:44:11 pm »
I can't seem to get the timers.starttimer method to work properly.  The script evaluator keeps complaining about the number of arguments.  Log is below:

Date:     7/9/2013
Time:     8:39:51 PM
Severity: Error
Source:   MasterService
Computer: SERVERPC
Context Type: Script
Context Name: rule 'Voice Control'
Description:
An error occurred while executing the script rule 'Voice Control'.
ScriptEvaluatorException: No overload for method 'timers.StartTimer' takes '2' arguments.

CodecoreTechnologies.Elve.DriverFramework.Scripting.ScriptEvaluatorException: No overload for method 'timers.StartTimer' takes '2' arguments.
   at Common.ScriptEvaluator.ScriptEvaluator.objectMemberAndArrayMember()
   at Common.ScriptEvaluator.ScriptEvaluator.postIncrementDecrement()
   at Common.ScriptEvaluator.ScriptEvaluator.factor()
   at Common.ScriptEvaluator.ScriptEvaluator.multiplicative()
   at Common.ScriptEvaluator.ScriptEvaluator.additive()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseShift()
   at Common.ScriptEvaluator.ScriptEvaluator.relational()
   at Common.ScriptEvaluator.ScriptEvaluator.equality()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseAnd()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseExclusiveOr()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseInclusiveOr()
   at Common.ScriptEvaluator.ScriptEvaluator.logicalAnd()
   at Common.ScriptEvaluator.ScriptEvaluator.logicalOr()
   at Common.ScriptEvaluator.ScriptEvaluator.variableAssignment()
   at Common.ScriptEvaluator.ScriptEvaluator.evaluateBlock()
   at Common.ScriptEvaluator.ScriptEvaluator.ifKeyword()
   at Common.ScriptEvaluator.ScriptEvaluator.tryKeyword()
   at Common.ScriptEvaluator.ScriptEvaluator.newKeyword()
   at Common.ScriptEvaluator.ScriptEvaluator.objectMemberAndArrayMember()
   at Common.ScriptEvaluator.ScriptEvaluator.postIncrementDecrement()
   at Common.ScriptEvaluator.ScriptEvaluator.factor()
   at Common.ScriptEvaluator.ScriptEvaluator.multiplicative()
   at Common.ScriptEvaluator.ScriptEvaluator.additive()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseShift()
   at Common.ScriptEvaluator.ScriptEvaluator.relational()
   at Common.ScriptEvaluator.ScriptEvaluator.equality()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseAnd()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseExclusiveOr()
   at Common.ScriptEvaluator.ScriptEvaluator.bitwiseInclusiveOr()
   at Common.ScriptEvaluator.ScriptEvaluator.logicalAnd()
   at Common.ScriptEvaluator.ScriptEvaluator.logicalOr()
   at Common.ScriptEvaluator.ScriptEvaluator.variableAssignment()
   at Common.ScriptEvaluator.ScriptEvaluator.evaluateBlock()
   at Common.ScriptEvaluator.ScriptEvaluator.evaluate(ScriptParser parser, ScriptVariableCollection variables, GlobalFunctionEvaluatorDelegate globalFunctionEvaluator, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(ScriptParser parser, ScriptVariableCollection variables, GlobalFunctionEvaluatorDelegate globalFunctionEvaluator, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(String s, ScriptPosition position, ScriptVariableCollection variables, GlobalFunctionEvaluatorDelegate globalFunctionEvaluator, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(String s, ScriptVariableCollection variables, GlobalFunctionEvaluatorDelegate globalFunctionEvaluator, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(String s, ScriptVariableCollection variables, GlobalFunctionEvaluatorDelegate globalFunctionEvaluator, ScriptObjectTypeInfoCollection objectInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.EvaluateNow(String s, ScriptVariableCollection variables, GlobalFunctionEvaluatorDelegate globalFunctionEvaluator, ScriptObjectTypeInfoCollection objectInfos)
   at MasterService.ScriptRunner.RunNow(String scriptName, String script, ScriptVariableCollection extraScriptVariables, Boolean throwError)
Location in script: line 15, column 9.

   timers.StartTimer("ReminderTimer",60);
        ^


superjer2000

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: timers.starttimer
« Reply #1 on: July 09, 2013, 07:53:06 pm »
Never mind - it seems you need to use timespan() with this method now.  The documentation doesn't reflect this.  For others that run into this try:

ts = newtimespan(0,0,60);
timers.starttimer("TestTimer",ts);