[Windows Mobile Apps and Games] jpc073@gmail.com:
Updated Script

Ok, so after some more extensive testing I experienced some more SOD's in differing situations.

A) When I used the lockscreen w/ pincode

B) When I was on a phone call and the screen went off.

Becuase of this I did a little more research and have made a few additional changes to the Modified version of cls_'s script that I posted earlier. I got the Idea for some of the additions by taking a closer look at some of the ignored lines in the original script.

Now in addition to checking if the backlight is on as a condition, the script will also check if you are on a phone call and if your lockscreen is active (Like the "DispOn" value the values for the lockscreen and the phone may be Rom or Device specific and you may have to locate them in your registry and edit the script). I have been using this script all day today and no problem with SOD's. Additonally, in this script I added the ability for setting your startup speed in addition to a boost speed and the safe speed. The startup speed will check if you have it already set to automatically startup at a speed set in the program. If you have not set the program to run at startup the script will Overclock you to the startup speed. So at startup it puts me at 748 for 60 seconds. Then it throttles down to my boost speed of 729 and when it goes to sleep, I'm on a call, or the screen is locked it throttles down to 604. When I wake it up and unlock it it goes back to 729. I think we are getting closer and closer to a sudo dynamic clocking. Now if only I knew a way to calculate Idle time with a mortscript.

I have been running this version of the script all day w/o even using the 2nd script that is assigned to the power key and had no problems thus far. cls_ I have not had a chance to look at your new script with the reg_array added in, but it looks very interesting, I can't wait to see how it works.

;**********************************************************************
;Set your speed settings

;41=787
;40=768
;39=748
;38=729
;37=710
;36=691
;35=672
;34=652
;33=633
;32=614
;31=604
;30=576
;29=556
;28=537

Start=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "AutoPerformanceLevel")
Boost=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "BoostSpeed")
Safe=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "SafeSpeed")

If (Start<>0)
start_speed=Start
Else
start_speed=40
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "AutoPerformanceLevel", start_speed)
EndIf

If (Boost<>0)
boost_speed=Boost
Else
boost_speed=38
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "BoostSpeed", boost_speed)
EndIf

If (Safe<>0)
safe_speed=Safe
Else
safe_speed=31
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "SafeSpeed", safe_speed)
EndIf

;**********************************************************************
; Variables

; Phone call - supposed to be 2 when in call 4 when not in call.
reg_root_phn = "HKLM"
reg_key_phn = "System\State\Phone"
reg_val_phn = "Cellular System Available"

; Check existence of reg key
If ( NOT RegValueExists(reg_root_phn, reg_key_phn, reg_val_phn) )
BigMessage(reg_root_phn, reg_key_phn, reg_val_phn & " was not found!^NL^^NL^Exiting...", "OverClocking ERROR")
Exit
EndIf

; Lockscreen - will be 2 when locked
reg_root_lcs = "HKLM"
reg_key_lcs = "System\State"
reg_val_lcs = "Lock"

; Check existence of reg key
If ( NOT RegValueExists(reg_root_lcs, reg_key_lcs, reg_val_lcs) )
BigMessage(reg_root_lcs, reg_key_lcs, reg_val_lcs & " was not found!^NL^^NL^Exiting...", "OverClocking ERROR")
Exit
EndIf

; Backlight - will be 0 when screen is off, 1 when on
reg_root_bkl = "HKCU"
reg_key_bkl = "ControlPanel\BackLight"
reg_val_bkl = "DispOn"

; Check existence of reg key
If ( NOT RegValueExists(reg_root_bkl, reg_key_bkl, reg_val_bkl) )
BigMessage(reg_root_bkl \ reg_key_bkl \ reg_val_bkl & " was not found!^NL^^NL^Exiting...", "OverClocking ERROR")
Exit
EndIf
If (NOT (FileExists("\Windows\StartUp\Msm7kAutoCpuSpeed.lnk")))
RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", start_speed)
EndIf
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 2)

Sleep (60000)

;**********************************************************************
; Set the clock to the desired clock speed
While (1)
; Read registry keys
phn_value = RegRead(reg_root_phn, reg_key_phn, reg_val_phn)
lcs_value = RegRead(reg_root_lcs, reg_key_lcs, reg_val_lcs)
bkl_value = RegRead(reg_root_bkl, reg_key_bkl, reg_val_bkl)
cpu_overclocked = RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "OverClocked")

; Check if On Call, Screen Locked, or Screen off - if so, throttle to Safe Speed
If (((phn_value = 2) OR (lcs_value = 2) OR (bkl_value = 0)) AND (cpu_overclocked <> 0))
RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", safe_speed)
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 0)

; Screen is on, not on Call, not Locked - set CPU to Boost Speed :)
ElseIf (((phn_value <> 2) AND (lcs_value <> 2) AND (bkl_value <> 0)) AND (cpu_overclocked <> 1))
RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", boost_speed)
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 1)

Else
Sleep(1000)
EndIf
EndWhile
Exit