The script was designed to control another object. You should have 3 objects (slider_bar, slider_button, and whatever object you want to change the color.) Just change the instances of "test_object" to the name of your main object:
Dim left_pos
Dim right_pos
Sub Object_OnScriptEnter
left_pos=0
right_pos=255
desktopx.object("test_object").hue = object.Left
End Sub
Sub Object_OnDrag(mousex,mousey,newposx,newposy)
Object.top = Object.top
If newposx < left_pos Then Object.left=left_pos
If newposx > right_pos Then Object.left=right_pos
desktopx.object("test_object").hue= object.Left
End Sub
Alternatively you don't have to use a slider. You could have just one button. Here's a simpler version of a script I used recently. It shifts the hue when you click or hold down the button. Just change the name of the target object:
'Called when L-click is pressed
Function Object_OnLButtonDown(x,y)
Object.SetTimer 2, 10
End Function
Sub Object_OnTimer2
increment = 2 '--Set How much to shift the hue
Set obj = DesktopX.Object("target") '--Set Name of target object
If obj.Hue < 255 Then
obj.Hue = obj.Hue + increment
Else
obj.Hue = 0
End If
End Sub
'Called when L-click is released
Function Object_OnLButtonUp(x, y, dragged)
object.KillTimer 2
End Function