Page 2 of 2 FirstFirst 12
Results 21 to 36 of 36
  1. #21  
    Quote Originally Posted by westronic View Post
    And, of course, the more often you check for the registry change the greater the performance hit on the device, right?

    All these scripts that run continuously have that issue.
    Well my idea is that this script would get kicked off from the MyVibe.mscr only when it detects an active call and ends when the call is answered. I wasn't planning on having two scripts with loops constantly running on the device. The trick is how to do that without stopping the calling script. I'll reveal my secret if it works.
  2. #22  
    Quote Originally Posted by hannip View Post
    Well my idea is that this script would get kicked off from the MyVibe.mscr only when it detects an active call and ends when the call is answered. I wasn't planning on having two scripts with loops constantly running on the device. The trick is how to do that without stopping the calling script. I'll reveal my secret if it works.
    I look forward to it.

    Could we do something like:

    MyVibe calls KillVibe upon detecting an incoming call.
    KillVibe kills MyVibe upon state change from "incoming call" (Will this really stop a vibration in mid-vibration?).
    KillVibe re-starts MyVibe
    KillVibe ends (or maybe MyVibe kills KillVibe when MyVibe first starts up?)

    I can see some potential recursive call issues , perhaps, but it might work and would be a better, more generic, solution than my solution above.

    I think, ideally, we'd have some state-monitoring code that calls other scripts when appropriate to avoid having to have multiple always-on scripts, but that is really another project. It would require some new standards on coding and a high level of cooperation to have something like this, but could have an excellent payoff in terms of performance.

    In the end, maybe we'll have a suite of products all tied together where you decide which ones you want to have actively running all from some central control panel or something.

    Hmmm... I'm getting way off-topic. This is a discussion for another thread.
  3.    #23  
    Quote Originally Posted by westronic View Post
    I have another feature enhancement based upon my wife's input when she heard the vibrate going off when I answered the phone. I suggest the program stop the vibrations as soon as the phone call is no longer "incoming."

    If I've done this correctly, it will vibrate, then check to see that the phone call is still incoming, then vibrate again, then check again, then vibrate again - thus it will stop after the current vibration when a call comes in. The current code will vibrate all three times no matter what else happens as nothing can interrupt the vibration sequence once it begins, and this can be rather annoying to a caller.

    I've tested this and it seems to work correctly - that is, the vibrate no longer continues after answering the phone, even if answering on the first vibrate in the series.

    If someone could figure out how to detect a keypress, then you could do the same thing for that. A keypress check could be done to stop any more vibrations, checking the same time as the second and third check for incoming phone status.

    BTW: I do not know how to interrupt a vibration, so it's probably best not to set too long a "long" vibrate so as not to annoy your callers.

    This is probably not the most efficient code, but you could do something like:

    Code:
    #Incoming Call
    
    # Read Variables from INI File
    VibrateShort = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateShort")
    VibrateLong = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateLong")
    VibrateStyle = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateStyle")
    VibrateActive = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateActive")
    
    While(1)
    While(VibrateActive = 1)
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    
    If (x AND 65536)
    	If ((VibrateStyle=1) or (VibrateStyle=2) or (VibrateStyle=3))
    		Vibrate(VibrateShort)
    	Else
    		Vibrate(VibrateLong)
         	EndIf
    	Sleep(100)		
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
         		If ((VibrateStyle=1) or (VibrateStyle=2))
    			Vibrate(VibrateShort)
    		Else
    			Vibrate(VibrateLong)
         		EndIf
    		Sleep(100)
    		x = RegRead( "HKLM", "System\State\Phone", "Status" )
    		If (x AND 65536)
         			If ((VibrateStyle=2) or (VibrateStyle=3))
    				Vibrate(VibrateShort)
    			Else
    				Vibrate(VibrateLong)
         			EndIf
    		EndIf
    	EndIf
    EndIf
    
    Sleep (1000)
    EndWhile
    Sleep(1000)
    EndWhile
    This would be my basic approach as well, break it up so that it checks the status before each vibrate to determine if it should or not. Since it's in the same while loop I don't think there would be any greater performance hit then there is today with the existing code, but maybe...westronic, how did this work out for you?
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  4. #24  
    Wow, this is neat. So when the phone starts ringing I kick off a monitor thread to watch when the phone is answered and then call Vibrate(0) to stop the current vibrate. It works well, but the monitor thead doesn't always start in time to stop the first vibrate if you answer quickly, but once it starts it will stop the vibrate cold.

    No killing of scripts involved during this experiment.

    The secret was to kick off another script without the caller waiting for it to finish. To do that I used the Run command to call MortScript.exe to start the monitor script. The caller can then continue to run at the same time!

    Here are my mods.

    Code:
    #Incoming Call
    
    # Read Variables from INI File
    VibrateShort = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateShort")
    VibrateLong = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateLong")
    VibrateStyle = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateStyle")
    VibrateActive = IniRead(SystemPath("ScriptPath")\"TreoVibe.ini", "Settings", "VibrateActive")
    
    monitorStarted=FALSE
    
    While(1)
    While(VibrateActive = 1)
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    
    If (x AND 65536)
    
         # start the monitor thread if not already running
         If (NOT monitorStarted)
             monitorStarted=TRUE
             Run ("\Program Files\MortScript\MortScript.exe", """\Program Files\TreoVibe\MonitorThread.mscr""")
             # sleep 1 second to let the thread start before the vibrates begin
             Sleep(1000)
         EndIf
    
         If (VibrateStyle=1)
    	Vibrate(VibrateShort)
    	Sleep(100)
            x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateShort)
    	   Sleep(100)
               x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateLong)
    	   EndIf
    	EndIf
         EndIf
    
         If (VibrateStyle=2)
    	Vibrate(VibrateShort)
    	Sleep(100)
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateShort)
    	   Sleep(100)
    	   x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateShort)
    	   EndIf
    	EndIf
         EndIf
    
         If (VibrateStyle=3)
    	Vibrate(VibrateShort)
    	Sleep(100)
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateLong)
    	   Sleep(100)
    	   x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateShort)
    	   EndIf
    	EndIf
         EndIf
    
         If (VibrateStyle=4)
    	Vibrate(VibrateLong)
    	Sleep(100)
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateLong)
    	   Sleep(100)
    	   x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateLong)
    	   EndIf
    	EndIf
         EndIf
    Else
         monitorStarted=FALSE
    EndIf
    
    Sleep (1000)
    EndWhile
    
    Sleep(1000)
    EndWhile

    Code:
    # Monitors an incoming Call to see when it is answered then kills the current vibrate.
    
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    
    If (NOT (x AND 65536))
       # Call must've been answered before this script got going
       Exit
    EndIf
    
    # limit the loop to 30 seconds as a safeguard
    maxLoopCount = 120
    count = 0
    
    While ( 1 )
    
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    If (NOT (x AND 65536))
       # turn off vibrate
       Vibrate(0)
       Exit
    EndIf
    
    count = count + 1
    If ( count >= maxLoopCount )
       Exit
    EndIf
    
    # sleep for a quarter second
    Sleep (250)
    EndWhile

    Oops, I have hard coded paths in my mods. Those will need to be changed. Damn standards.
    I think I'll play with this some more. I don't want the vibrates to start until the monitor is running. Let me think up how to do interprocess communication with MortScript. hehe
    Last edited by hannip; 03/10/2007 at 06:06 PM. Reason: bug in original version kept thread from starting
  5. #25  
    Quote Originally Posted by scottymomo View Post
    This would be my basic approach as well, break it up so that it checks the status before each vibrate to determine if it should or not. Since it's in the same while loop I don't think there would be any greater performance hit then there is today with the existing code, but maybe...westronic, how did this work out for you?
    It seems to work well. Next up is to try Hannip's mods - without any additional embedded checks like I did above.
  6. #26  
    Quote Originally Posted by westronic View Post
    It seems to work well. Next up is to try Hannip's mods - without any additional embedded checks like I did above.
    Hmmm.. I quit for now. Some issues.

    I'm back to what I modified. Ths works very well, though it does leave open the fact that it will not interrupt a long vibrate - which could be an issue if someone set a very long one.
  7. #27  
    Well made some changes to keep the vibrates from starting until the monitor thread was started. It does work, but when an incoming call starts there is just too much going on and the thread can't stop the vibe fast enough. If you answer the call right away it doesn't seem to help, but if you didn't catch it for a few vibes then it works fine. This is my final result and to standards. I'll leave it for you guys to decide whether it's enough improvement to include. At any rate it was a fun experiment and proves that scripts can kick off threads.

    Code:
    #Incoming Call
    
    # read script path
    myPath = SystemPath("ScriptPath")
    
    # if there is a MortScript in myPath use it, else use shared MortScript
    If ( FileExists( myPath \ "MortScript.exe" ) )
       mortPath = myPath
    Else
       mortPath = SystemPath("ScriptExe")
    EndIf
    
    # Read Variables from INI File
    VibrateShort = IniRead( myPath \ "TreoVibe.ini", "Settings", "VibrateShort")
    VibrateLong = IniRead( myPath \ "TreoVibe.ini", "Settings", "VibrateLong")
    VibrateStyle = IniRead( myPath \ "TreoVibe.ini", "Settings", "VibrateStyle")
    VibrateActive = IniRead( myPath \ "TreoVibe.ini", "Settings", "VibrateActive")
    
    monitorStarted=FALSE
    
    While(1)
    While(VibrateActive = 1)
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    
    
    If (x AND 65536)
    
       # start the monitor thread if not already running
       If (NOT monitorStarted)
           monitorStarted=TRUE
    
           # set the TreoVibe IPC file
           WriteFile( myPath \ "TreoVibe.ipc", "wait")       
           Run ( mortPath \ "MortScript.exe", """" & myPath \ "MonitorThread.mscr""")
       EndIf
    
        If ( ReadFile( myPath \ "TreoVibe.ipc" ) eq "startVibes" )
         If (VibrateStyle=1)
    	Vibrate(VibrateShort)
    	Sleep(100)
            x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateShort)
    	   Sleep(100)
               x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateLong)
    	   EndIf
    	EndIf
         EndIf
    
         If (VibrateStyle=2)
    	Vibrate(VibrateShort)
    	Sleep(100)
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateShort)
    	   Sleep(100)
    	   x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateShort)
    	   EndIf
    	EndIf
         EndIf
    
         If (VibrateStyle=3)
    	Vibrate(VibrateShort)
    	Sleep(100)
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateLong)
    	   Sleep(100)
    	   x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateShort)
    	   EndIf
    	EndIf
         EndIf
    
         If (VibrateStyle=4)
    	Vibrate(VibrateLong)
    	Sleep(100)
    	x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	If (x AND 65536)
    	   Vibrate(VibrateLong)
    	   Sleep(100)
    	   x = RegRead( "HKLM", "System\State\Phone", "Status" )
    	   If (x AND 65536)
    	      Vibrate(VibrateLong)
    	   EndIf
    	EndIf
         EndIf
       EndIf
    Else
         monitorStarted=FALSE
    EndIf
    
    Sleep (1000)
    EndWhile
    
    Sleep(1000)
    EndWhile

    Code:
    # Monitors an incoming Call to see when it is answered then kills the current vibrate.
    
    # read script path
    myPath = SystemPath("ScriptPath")
    
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    
    If (NOT (x AND 65536))
       # Call must've been answered before this script got going
       WriteFile( myPath \ "TreoVibe.ipc", "vibeTooLate")
       Exit
    EndIf
    
    # limit the loop to 30 seconds as a safeguard
    maxLoopCount = 150
    count = 0
    
    # tell the caller to start the vibes
    WriteFile( myPath \ "TreoVibe.ipc", "startVibes")
    
    While ( 1 )
    
    x = RegRead( "HKLM", "System\State\Phone", "Status" )
    If (NOT (x AND 65536))
       # turn off vibrate
       Vibrate(0)
       WriteFile( myPath \ "TreoVibe.ipc", "vibeStopped")
       Exit
    EndIf
    
    count = count + 1
    If ( count >= maxLoopCount )
       WriteFile( myPath \ "TreoVibe.ipc", "vibeBailed")
       Exit
    EndIf
    
    # sleep for a quarter second
    Sleep (200)
    EndWhile
    Last edited by hannip; 03/11/2007 at 09:57 AM. Reason: works better starting vibes right before the loop
  8.    #28  
    TreoVibe 1.5 updated in the first post, includes new code from westronic for stopping vibration once the call is connected and uses the new install/uninstall scripts and ScriptIcons.dll
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  9. #29  
    Any chance this could also work for SMS notifications? When they come in with a long ring tone it vibrates itself to death.

    (I notice this thread has been dormant for a while, is there another program for vibe control, or another thread i didn't find?)
    Cheers
  10.    #30  
    possibly...will look into it
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  11. #31  
    scottymomo, i installed treovibe, set my vibrates and enabled it but im still getting these very long vibrates. any suggestions???
  12. #32  
    Howdy!

    I installed treovibe with great glee on my 700wx since I hate the vibrate pattern.

    When I reboot the phone (with the treovibe "activate on reboot" setting) it gives me an error: "the file myvibe cannot be opened either it is not signed with a trusted certificate or one of its components cannot be found. reinstall"

    oh yeah, and even when enabled, an incoming call gives the one long vibrate as it always has.

    Any ideas?

    Thanks

    Joe
  13.    #33  
    are you on WM 6 or still 5. Never seemed to work right for me after I upgraded my 750 to WM6 so I stopped using it myself

    ..regarding the error on reboot, try going into the treovibe directory and click the mortscript.exe file. Reboot and see if it occurs again.
  14. #34  
    Now listen up guys! This is the surest way to get this thing to work. I installed the TreoVibe on my Touch Diamond WM 6.1. There are a few intricate steps you need to follow after installation. Firstly you also need to have a registry editor like regedit installed on your device. After installation of TreoVibe, go to Settings - Sounds & Notifications and select the ringtone you like then select "Vibrate" in Ring Type. Cick Ok. You are done here. Next open the registry editor. Go to HKCU/Control Panel/Sounds/RingTone0.Here you go into Script and type apv1w3r. Now this script means Activate ringtone, vibrate for 1 second, wait for 3 seconds and repeat. Next you open TreoVibe, and select whichever style you prefer. Hit Enable.
    And you are done! Your phone now vibrates in pulse and in sync with the ringtone!
  15. #35  
    it doesn't work...each time i randomly change the Ring type in "sounds and notifications", the CATEGORY value in regedit remains as RING...and the SCRIPT value remains as AV0PW3R...vibration is continuous and annoying
  16. cwiekol's Avatar
    Posts
    1 Posts
    Global Posts
    2 Global Posts
    #36  
    Hi there,
    could you help me with that script? It doesn't work with my treo pro! I've installed it and configured and also did what anand wrote, but it still doesn't work for me. This continuous vibration would be soon for me the reason to throw away this beautiful telephone!!

    PLEASE, help me!!
Page 2 of 2 FirstFirst 12

Posting Permissions