I' think this will work for you:
Dim Speed, blnActive
Speed=1000 ' This is the time in milliseconds between changing colors
blnActive=True ' Indicates to start color change on Script Enter
'Called when L-click is released
Function Object_OnLButtonUp(x, y, dragged)
If Not dragged Then
If blnActive Then
blnActive=False
Object.KillTimer 1
ElseIf Not blnActive Then
blnActive=True
Object.SetTimer 1, Speed
End If
End If
End Function
'Called when the script is executed
Sub Object_OnScriptEnter
If blnActive Then Object.SetTimer 1, Speed
X = cint((system.WorkareaRight - object.width)/2)
Y = cint((system.WorkareaBottom - object.height)/2)
object.move X,Y '<== this will move your object directly into the center of your screen
End Sub
Sub Object_OnTimer1
'Store the current hue in variable
hueshift = Object.hue
'If current hue is equal to or greater than 255
'reset to 0
If hueshift => 255 Then
hueshift = 0
'If hue is not yet 255, keep adding
Else
hueshift = hueshift + 7
End If
'Set the object hue
object.hue = hueshift
End Sub
..of course all credit to Vad and SirSmiley