Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dim strtt 'debug string
- TimeSneaker 'find an unused object and use it's timer for fast solenoid updates
- Sub TimeSneaker()
- dim ii
- for each ii in getelements
- 'debug.print TypeName(ii)
- if typename(ii) = "Trigger" then 'Find a 'trigger' object
- On Error Resume Next
- If Not Isobject(GetRef(ii.name & "_Timer")) Or Err Then 'if the object's timer isn't already in use... (case-safe I think)
- Err.Clear
- ii.TimerInterval = 1 : ii.TimerEnabled = 1
- executeglobal "Sub " & ii.name & "_" & "Timer" & " : " & "UpdateChgSol" & " : End Sub"
- strtt = "Sub " & ii.name & "_" & "Timer" & " : " & "UpdateChgSol" & " : End Sub" 'debug
- exit sub
- end if
- end if
- Next
- End Sub
- Sub UpdateChgSol() 'copied from main loop. Comment out the chgsol stuff in main loop.
- dim ChgSol
- if UseSolenoids then ChgSol = Controller.ChangedSolenoids
- dim tmp, idx, nsol, solon, ii
- If Not IsEmpty(ChgSol) Then
- For ii = 0 To UBound(ChgSol)
- nsol = ChgSol(ii, 0)
- tmp = SolCallback(nsol)
- solon = ChgSol(ii, 1)
- If solon > 1 Then solon = 1
- 'SolMe(chgsol)
- If UseModSol Then
- If solon <> SolPrevState(nsol) Then
- SolPrevState(nsol) = solon
- If tmp <> "" Then Execute tmp & vpmTrueFalse(solon+1)
- End If
- tmp = SolModCallback(nsol)
- If tmp <> "" Then Execute tmp & " " & ChgSol(ii, 1)
- Else
- If tmp <> "" Then Execute tmp & vpmTrueFalse(solon+1)
- End If
- Next
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement