Please combine these two vbscripts..............

Friday, June 27, 2008 by superman | Discussion: DesktopX

Hi my sweet uncles, aunties, brothers, sisters & friends.......

Please mention how to combine these two scripts............

One by Vad_M and second by SirSmiley....

1..Adjusting position of a desktopx object so that it remains at center for every resolution..
Link: https://forums.wincustomize.com/316412
Script:

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


2..Auto changing hue or color......
Link: https://forums.wincustomize.com/315915
Script:

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
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

'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 1
End Sub


Thank you very much ...I have no idea....Hope you have......Please help me.......
Thanks & +3 karma in advance................
Bye

(Thread moved by admin)

bilbo1930
Reply #1 Friday, June 27, 2008 4:07 AM
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
superman
Reply #2 Friday, June 27, 2008 8:20 AM
Thank you very much and you too deserve some credit.......at least for combining these
Thanks again.......

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01