Samurize Scripts

Originally posted by Finn
well my work one now after playing with it a bit, well i like it :p



since its at work dropped the tv script..

and i can host scripts for anyone if they want, just drop me a mail

Can you tell me the calender script you used? as mine wont work

Thanks
 
Originally posted by Finn
I just used the one off of the samurize site, worked fine for me :confused:

So did I but it wont work for me :(

What did you need to change apart from the location of the .png in the .ini file?
 
Originally posted by dbappa
ok starting to get hang of this-but sily question-how do you get clock pic to show hands (moving)?

Add meter>Date/Time.
Draw Type>Analog.
Full Elipse, min/max values depending on the hand.

Down at the format box enter one of these:
%h - Gives hours.
Min: 0 Max: 12
%m - Gives minutes.
Min: 0 Max: 60
%s - Gives seconds.
Min: 0 Max: 60
 
Originally posted by -DT-
So did I but it wont work for me :(

What did you need to change apart from the location of the .png in the .ini file?


okay the script (dont think i changed anything but the line which decides the case which i changed to just capitalise the first letter rather than entire name

Code:
'************************************************************************
'*                  Arkkimaagi's SS Calendar (v2.0)
'*                    Acalendar.vbs for SS 0.81a
'************************************************************************

'Change these values to your liking
ShortMonth   = 99 ' How many chars of the month name is written
AlertRight   = ")" ' The right side of todays date gets this char. (One Char is minimum)
AlertLeft    = "(" ' The left sife of today date gets this char. (One Char is minimum)
NoAlertRight = " " ' The Right side of non todays date (One Char is minimum)
NoAlertLeft  = " " ' The Left side of non todays date (One Char is minimum)
ZeroLetter   = " " 'What letter to use as the leading Zero (One Char is minimum)
ZeroWeek     = " " 'What letter to use as the leading Zero in week numbers (One Char is minimum)

ColorTitle   = True 'Should TITLE name of current weekday be colored? (True/False)
ColorDate    = True 'Should current day DATE be colored? (True/False)
ColorWDayNum = True 'Should the current weekday NUMBER be colored? (True/False)

'Select colors for different sections
'1 = weekday black
'2 = weeknumber&dayname white
'3 = sunday blue
'4 = today red
TodayDate = 4 'current day color (default is 4, red)
AlertColor = 4 'current day alert color (default is 4, red)
TodayWDNum = 4 'current week number color (default is 4, red)
TodayWDName = 4 'current day title color (default is 4, red)

'My weeks begin from Monday and I want Sunday to be blue
'So I chose 0 for all the others and 3 for seventh day
'If you'r weeks begin from Sunday and you want sundays to
'be blue, select 3 for for first day and 0 for all the rest.
Day1Color = 0 'Select 0 for default, 1-4 for other colors
Day2Color = 0 'Select 0 for default, 1-4 for other colors
Day3Color = 0 'Select 0 for default, 1-4 for other colors
Day4Color = 0 'Select 0 for default, 1-4 for other colors
Day5Color = 0 'Select 0 for default, 1-4 for other colors
Day6Color = 0 'Select 0 for default, 1-4 for other colors
Day7Color = 3 'Select 0 for default, 1-4 for other colors

' There is FOUR different casings for the text
' lower      = low case of each char
' upper      = UPPER CASE OF EACH CHAR
' firstup    = Upper Case For The First Char In Each Word
' firstdown  = lOWER cASE fOR tHE fIRST cHAR iN eACH wORD
casing       = "firstup"


'************************************************************
'*  Changes from version 1.0:
'*
' Total Rewrite for Serious Samurize. You really should use this
' script instead of 1.0



'************************************************************
'*  Dont change anything below.
'*

dim Cd(52)

Cd(0) = 2 'first empty spot
Cd(1) = 2 'First weekday name
Cd(2) = 2
Cd(3) = 2
Cd(4) = 2
Cd(5) = 2
Cd(6) = 2
Cd(7) = 3 ' seventh weekday name

Cd(8) = 2 '1st week number
Cd(9) = 1
Cd(10) = 1
Cd(11) = 1
Cd(12) = 1
Cd(13) = 1
Cd(14) = 1
Cd(15) = 1

Cd(16) = 2 '2nd week number
Cd(17) = 1
Cd(18) = 1
Cd(19) = 1
Cd(20) = 1
Cd(21) = 1
Cd(22) = 1
Cd(23) = 1

Cd(24) = 2 '3d week number
Cd(25) = 1
Cd(26) = 1
Cd(27) = 1
Cd(28) = 1
Cd(29) = 1
Cd(30) = 1
Cd(31) = 1

Cd(32) = 2 '4th week number
Cd(33) = 1
Cd(34) = 1
Cd(35) = 1
Cd(36) = 1
Cd(37) = 1
Cd(38) = 1
Cd(39) = 1

Cd(40) = 2 '5th week number
Cd(41) = 1
Cd(42) = 1
Cd(43) = 1
Cd(44) = 1
Cd(45) = 1
Cd(46) = 1
Cd(47) = 1

Cd(48) = 2 '6th week number
Cd(49) = 1
Cd(50) = 1
Cd(51) = 1

'**************************************
'Coloring options end
'Actual code starts

If (Day1Color <> 0) Then
  for counter = 1 to 6
    temp = counter*8+1
    Cd(temp)=Day1Color
  next
End If
If (Day2Color <> 0) Then
  for counter = 1 to 6
    temp = counter*8+2
    Cd(temp)=Day2Color
  next
End If
If (Day3Color <> 0) Then
  for counter = 1 to 5
    temp = counter*8+3
    Cd(temp)=Day3Color
  next
End If
If (Day4Color <> 0) Then
  for counter = 1 to 5
    temp = counter*8+4
    Cd(temp)=Day4Color
  next
End If
If (Day5Color <> 0) Then
  for counter = 1 to 5
    temp = counter*8+5
    Cd(temp)=Day5Color
  next
End If
If (Day6Color <> 0) Then
  for counter = 1 to 5
    temp = counter*8+6
    Cd(temp)=Day6Color
  next
End If
If (Day7Color <> 0) Then
  for counter = 1 to 5
    temp = counter*8+7
    Cd(temp)=Day7Color
  next
'  ShowColor=Cd(temp)&" "&temp
'  exit function
End If

'Black
Function ShowColor1
  ShowColor1 = ShowColor(1)
End Function

'White
Function ShowColor2
  ShowColor2 = ShowColor(2)
End Function

'Blue
Function ShowColor3
  ShowColor3 = ShowColor(3)
End Function

'Red
Function ShowColor4
  ShowColor4 = ShowColor(4)
End Function

Function ShowMonth
  Today     = Now()    
  Month_    = Month(Today)
  ShowMonth = ChangeCase(Left(MonthName(Month_),ShortMonth))
End Function

Function ShowYear
  Today    = Now()
  ShowYear = Year(Today)
End Function

Function ShowColor(color)

  Today           = Now()
  Year_           = Year(Today)
  Month_          = Month(Today)
  WeekNumber_     = DateDiff("ww", Year_&"-01-01",Today,0,0)+1
  WeekDay_        = Weekday(Today, vbusesystem)
  WeekDayName_    = Left(WeekDayName(WeekDay_), 2)
  Day_            = Day(Today)
  FirstWeekMonth_ = DateDiff("ww", Year_&"-01-01",Year_&"-"&Month_&"-01",0,0)+1
  FirstDayWeek_   = Weekday(year_&"-"&Month_&"-01", vbusesystem)
  daysInMonth_    = Day(DateSerial(Year(today), Month(today)+1, 0) )
 
  ' The Weeknumbers For The Weeks in Current Month
  dim MW(6)
  MW(1) = Right(ZeroWeek&FirstWeekMonth_, 2)
  MW(2) = Right(ZeroWeek&FirstWeekMonth_+1, 2)
  MW(3) = Right(ZeroWeek&FirstWeekMonth_+2, 2)
  MW(4) = Right(ZeroWeek&FirstWeekMonth_+3, 2)
  MW(5) = Right(ZeroWeek&FirstWeekMonth_+4, 2)
  MW(6) = "  "
  If ( (daysInMonth_ > 29) AND (FirstDayWeek_ > 6) ) Then
    MW(6) = Right(ZeroWeek&FirstWeekMonth_+5, 2)
  ElseIf ( (daysInMonth_ > 30) AND (FirstDayWeek_ > 5) ) Then
    MW(6) = Right(ZeroWeek&FirstWeekMonth_+5, 2)
  End If

  ' The TITLE Names of Each WeekDay
  dim WD(8)
  WD(1) = ChangeCase(Left(WeekDayName(1, False, vbusesystem), 2))
  WD(2) = ChangeCase(Left(WeekDayName(2, False, vbusesystem), 2))
  WD(3) = ChangeCase(Left(WeekDayName(3, False, vbusesystem), 2))
  WD(4) = ChangeCase(Left(WeekDayName(4, False, vbusesystem), 2))
  WD(5) = ChangeCase(Left(WeekDayName(5, False, vbusesystem), 2))
  WD(6) = ChangeCase(Left(WeekDayName(6, False, vbusesystem), 2))
  WD(7) = ChangeCase(Left(WeekDayName(7, False, vbusesystem), 2))

  'get date data
  dim DP(37)

  'Colored weeknumbers code
  For counter = 0 to 5
    temp =  8+counter*8
    'If the weeknumbers are wanted colorized
    If (Cd(temp) = color) Then 
      
      'but then its the today weekday, and the color does not match
      If (((FirstWeekMonth_ + counter ) = WeekNumber_) AND (TodayWDNum <> color) AND (ColorWDayNum)) Then 
        temp = 1 + counter
        MW(temp) = "  "
      End If
      
    'now we do not want to color this number
    Else 
      
      'unless its this week and color matches
      If (((FirstWeekMonth_ + counter ) = WeekNumber_) AND (TodayWDNum = color) AND (ColorWDayNum)) Then
      Else
        temp = 1 + counter
        MW(temp) = "  "
      End If
      
    End If
  Next
  

  For counter = 1 to 7
    'If the weekTitles are wanted colorized
    If (Cd(counter) = color) Then 
      
      'but then its the today weekday, and the color does not match
      If ((WeekDay_ = Counter) AND (TodayWDName <> color) AND ColorTitle) Then 
        WD(WeekDay_) = "  "
      End If
      
    'now we do not want to color this title
    Else 
      
      'unless its this week and color matches
      If ((WeekDay_ = Counter) AND (TodayWDName = color) AND (ColorTitle)) Then
      Else
        WD(Counter) = "  "
      End If
      
    End If
  Next
  
  
  dim AA(37)
  temp = 1
  for counter = 1 to 5
    AA(temp)=8*counter+1
    AA(temp+1)=8*counter+2
    AA(temp+2)=8*counter+3
    AA(temp+3)=8*counter+4
    AA(temp+4)=8*counter+5
    AA(temp+5)=8*counter+6
    AA(temp+6)=8*counter+7
    temp=temp+7
  next
  AA(36)=49
  AA(37)=50
    
 
  for counter = 1 to 37
    aDate = counter - firstdayweek_ +1
    On Error Resume Next
    **** = DateValue(MonthName(Month_) & " " & aDate & ", " &Year_)
    If err.number <> 0 Then
      aDate = 0
    End If
    If aDate < 1 or aDate > 31 Then aDate = "  "
  
    If ((AlertColor = color) AND (Day_ = aDate)) Then
      addLeft=AlertLeft
      addRight=AlertRight
    Else
      addLeft=NoAlertLeft
      addRight=NoAlertRight
    End If  
  
  
    If (Cd(AA(counter)) = color) Then 

      temp = Right(ZeroLetter&aDate, 2)
    
      'but then its today
      If ((Day_ = aDate) AND (TodayDate <> color) AND ColorDate) Then 
        temp = "  "
      End If
      
    Else
      temp = "  "
    
      'but then its today
      If ((Day_ = aDate) AND (TodayDate = color) AND ColorDate) Then 
        temp = Right(ZeroLetter&aDate, 2)
      End If
    End If
    
    DP(counter) = addLeft & temp & addRight
  next
  
  ' Saving the data in a format
  nl = "%b"
  z1 = " "
  z2 = "  "
  
  'Formatting of the calendar
  ret = z2& z2& WD(1) &z2& WD(2) &z2& WD(3) &z2& WD(4) &z2& WD(5) &z2& WD(6) &z2& WD(7) & nl
  ret = ret & MW(1) &z1& DP(1) & DP(2) & DP(3) & DP(4) & DP(5) & DP(6) & DP(7) & nl
  ret = ret & MW(2) &z1& DP(8) & DP(9) & DP(10) & DP(11) & DP(12) & DP(13) & DP(14) & nl
  ret = ret & MW(3) &z1& DP(15) & DP(16) & DP(17) & DP(18) & DP(19) & DP(20) & DP(21) & nl
  ret = ret & MW(4) &z1& DP(22) & DP(23) & DP(24) & DP(25) & DP(26) & DP(27) & DP(28) & nl
  ret = ret & MW(5) &z1& DP(29) & DP(30) & DP(31) & DP(32) & DP(33) & DP(34) & DP(35) & nl
  ret = ret & MW(6) &z1& DP(36) & DP(37)

  ShowColor = ret
End Function

Function MoveItemHelp
  w = " WT "
  d = "[00]"
  n = "WN "
  nl = "%b"
  z2 = "    "
  temp =     "   "&w&w&w&w&w&w&w&nl
  temp = temp& n&d&d&d&d&d&d&d&nl
  temp = temp& n&d&d&d&d&d&d&d&nl
  temp = temp& n&d&d&d&d&d&d&d&nl
  temp = temp& n&d&d&d&d&d&d&d&nl
  temp = temp& n&d&d&d&d&d&d&d&nl
  temp = temp& n&d&d
  
  MoveItemHelp = temp
End Function

Function ChangeCase(Words)
  ChangeCase = UCase(words) ' This changes the case to upper incase CASING is spelled wrong!
  
  If casing  = "lower"     Then ChangeCase = LCase(words)
  If casing  = "upper"     Then ChangeCase = UCase(words)
  If casing  = "firstup"   Then ChangeCase = UCase(Mid(words,1,1)) & LCase(Mid(words,2,99))
  If casing  = "firstdown" Then ChangeCase = LCase(Mid(words,1,1)) & UCase(Mid(words,2,99))
End Function


and my ini file entries (you will need to change the numbers to fit in with your ini)

Code:
[Source 3]
Type=TActiveScriptCollector
ScriptName=acalenda.vbs
ScriptFunction=ShowColor4
Interval=10

[Output 3]
Type=TTextOutput
Text=%v
Color=FFFF0000
Align=0
FontName=Courier New
FontSize=10
FontStyle=[fsBold]
LineSpacing=4
NrOfDecimals=0
Left=999
Top=365
Right=1254
Bottom=500
AllowLink=0
Link=

[Source 4]
Type=TActiveScriptCollector
ScriptName=acalenda.vbs
ScriptFunction=ShowColor3
Interval=10

[Output 4]
Type=TTextOutput
Text=%v
Color=FF80FFFF
Align=0
FontName=Courier New
FontSize=10
FontStyle=[fsBold]
LineSpacing=4
NrOfDecimals=0
Left=999
Top=365
Right=1254
Bottom=490
AllowLink=0
Link=

[Source 5]
Type=TActiveScriptCollector
ScriptName=acalenda.vbs
ScriptFunction=ShowColor2
Interval=10

[Output 5]
Type=TTextOutput
Text=%v
Color=FFFFFFFF
Align=0
FontName=Courier New
FontSize=10
FontStyle=[fsBold]
LineSpacing=4
NrOfDecimals=0
Left=999
Top=365
Right=1254
Bottom=490
AllowLink=0
Link=



[Source 7]
Type=TActiveScriptCollector
ScriptName=acalenda.vbs
ScriptFunction=ShowMonth
Interval=30

[Output 7]
Type=TTextOutput
Text=%v
Color=FFFFFFFF
Align=0
FontName=Georgia
FontSize=12
FontStyle=[fsBold]
LineSpacing=1
NrOfDecimals=0
Left=1015
Top=330
Right=1147
Bottom=355
AllowLink=0
Link=



[Source 66]
Type=TActiveScriptCollector
ScriptName=acalenda.vbs
ScriptFunction=ShowColor1
Interval=10

[Output 66]
Type=TTextOutput
Text=%v
Color=FF0061C1
Align=0
FontName=Courier New
FontSize=10
FontStyle=[fsBold]
LineSpacing=4
NrOfDecimals=0
Left=999
Top=365
Right=1254
Bottom=500
AllowLink=0
Link=
 
Hi,

Are you using the BBC Weather script or the WeatherPlus script?

The weatherplus scripts needs you to run RefreshWeather.vbs every now and then to generate the xml file.

The BBC weather script needs a writefile to be performed every day.
 
Cheers! its always something simple!

My news automatically updates every 20 mins with the use of a hidden box which runs the writefile, ive now done the same to weather with another hidden box which is refreshing the weather xml every 60 mins. Sorted:D
 
Originally posted by Clerkin
i know i asked last night but when i have samurze running my cpu never drops below 25%, anyone know why cos its really bugging me

how much of the screen you drawing?

if you look at the config proggy there should be a red box around all the items, that shows the part that it has to draw each time, my first setup put stuff in the corners of the screen and it was slow as hell, now re-arranged things so its all in the same corner (minimising the size of the red box) and its MUCH quicker
 
finally got my webspace cleaned out to fit more stuff on:
samurize.jpg
 
Originally posted by Finn
how much of the screen you drawing?

if you look at the config proggy there should be a red box around all the items, that shows the part that it has to draw each time, my first setup put stuff in the corners of the screen and it was slow as hell, now re-arranged things so its all in the same corner (minimising the size of the red box) and its MUCH quicker

i think youve cracked it there, but how do i resize the red boxx
 
Hmm, the BBC Weather script that selekt0r posted yesterday doesn't seem to be updating unless I manually reload the config.

I have the writefile function set to run every 30 mins as the website is updated throughout the day with the current temp etc. This works as my temporary file (bbcweather.tmp) is always up to date.

I have set the various ret_weather functions in the config to run every 60 minutes, however it never updates. If I click Test Script in the editor it reads the .tmp file ok, but not when left to do it automatically.

Any ideas? All the other scripts (tv, news, etc.) update fine.


Andy.
 
I had exactly the same problem andy, nothing i could do fixed it. Which is why i am back on the weatherplus script which seems to work fine.

If anyone has a fix for the BBC weather script then please say, as i trust their forcasts more:D
 
Originally posted by Clerkin
i think ive found the problem, i copied someone else config file and there was some stuff off the screen, i think i got it all, anyway to make sure?

the red box is simply the smallest box that will fit around everything, you shrink it down by grouping everything together, and you can see the box on the config program so should be able to see if its going off the side of the design screen
 
Originally posted by Finn
the red box is simply the smallest box that will fit around everything, you shrink it down by grouping everything together, and you can see the box on the config program so should be able to see if its going off the side of the design screen

cheers mate ive sorted it, my cpu useage has dropped. :)

thanks a lot:)
 
has any1 got weather.cache.xml. the weatherplus script is loading it (as seen below), but i dont have it. that would probably explain why it keeps saying "not yet executed"

also where do i set my city code , ive been to the website to get it, but i cant see where the script is loading it from.


Code:
wDoc.load(SAMURIZE_DIRECTORY & "\Scripts\weather.cache.xml")
 
Back
Top Bottom