Disable Low Batt Notifications - 8525, TyTN, MDA Vario II, JasJam ROM Development

Hey guys,
I thought i would post this here. Its a mortscript i wrote to automaticlly dismiss the Low Battery notification when your battery goes under 20%.
It works best if you do the mod here http://forum.xda-developers.com/showthread.php?t=331288 and then untick popup message/vibrate etc in 'sounds and notifications'.
Code:
#
# NOLBATT.mscr - Monitors notifications and keeps deleting active registry key for low battery
#
# initialize variables
Delete = FALSE
LowBattID = "{A877D663-239C-47A7-9304-0D347F580408}"
# start notification check loop
While ( 1 )
# check the registry for any notifications
If ( RegValueExists( "HKLM", "System\State\Shell\Notifications\Active", "CLSID" ) )
# make sure it's low batt
CLSID = RegRead( "HKLM", "System\State\Shell\Notifications\Active\", "CLSID" )
If ( CLSID eq LowBattID )
Delete = True
EndIf
Else
Delete = False
EndIf
# Delete Active notification for Low battery
# the OS turns it off whenever there is a new notification.
If ( Delete )
RegDeletekey ( "HKLM", "System\State\Shell\Notifications\Active", TRUE, TRUE )
EndIf
# wait 5 seconds
Sleep( 5000 )
EndWhile
Any thoughts on how to make it more efficient etc are appreciated. There is a 'batterypercentage' option in mortscript that could perhaps be utilised to start the script at a certain percentage.

Related

Playing DOS Games in X1 using DOSBOX

Hello guys,
Earlier, I thought of playing old dos games in X1 using DOSBOX.
Some of my favorite DOS games was
Heretic
Descent
Dave
Skyroads
Commander Keen
and specially Lemmings!!
All of them can be found in DOSGAMESARCHIVE.com
Anyway, my problem is .. SPEED.
So I thought maybe we could help each other to make things faster specially on 3D games.
here's my dosbox config
PHP:
# This is the configurationfile for DOSBox 0.73.
# Lines starting with a # are commentlines.
# They are used to (briefly) document the effect of each option.
[sdl]
# fullscreen: Start dosbox directly in fullscreen.
# rotateright: Alternate screen rotation.
# mapperfile: File used to load/save the key/event mappings from.
# kbdtoolbar: First toolbar.
# gametoolbar: Second toolbar.
# settoolbar: Third toolbar. Note: frameskip and cycles values are drawn there.
# usescancodes: Avoid usage of symkeys, might not work on all operating systems.
# sensitivity: Mouse sensitivity.
# touchpadmouse: Emulate mouse with stylus moves on screen. Can fix mouse behavior in games that expect only relative mouse movement.
# clickms: When in touchpad mode, left-click is sent after single-tap. This sets the delay in milliseconds between emulated mouse button down and up events.
# rightclickdelay: Touchpad mode. If you tap and hold stylus for this milliseconds, right-click will be send instead of left. 0 to disable.
# dpadmouse: Emulate mouse with D-Pad. Make sure to set corresponding mapper values for this to work. Up, down, left and right keys are autorotated.
# forcetoolbar: Sometimes where's no space on screen to fit even a part of toolbar. This forces it to display. Also a key and a zone can be set for toggling.
# forcetransparent: Forced toolbar area, overlapping active screen part will be semitransparent.
# forcezone: X, Y, width and height of 'force toolbar display' tapzone. No spaces please. See also hand_force_tlbr setting in mapper.txt
# forceheight: Forced toolbar will have this height.
fullscreen=true
rotateright=true
mapperfile=mapper.txt
kbdtoolbar=toolbar.dbk
gametoolbar=game.dbk
settoolbar=set.dbk
usescancodes=false
sensitivity=200
touchpadmouse=false
clickms=50
rightclickdelay=700
dpadmouse=true
forcetoolbar=true
forcetransparent=true
forcezone=0,0,10,5
forceheight=52
[dosbox]
# language: Select another language file.
# machine: The type of machine tries to emulate.
# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe.
# captures: Directory where things like wave, midi, screenshot get captured.
# memsize: Amount of memory DOSBox has in megabytes.
# This value is best left at its default to avoid problems with some games,
# though few games might require a higher value.
# There is generally no speed advantage when raising this value.
language=
machine=svga_s3
captures=capture
memsize=72
[render]
# frameskip: How many frames DOSBox skips before drawing one.
# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended,the scaler will be used even if the result might not be desired.
# Possible values: qvga, vga.
frameskip=4
aspect=false
scaler=vga
[cpu]
# core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
# Possible values: full, dynamic, simple.
# cputype: CPU Type used in emulation. auto is the fastest choice.
# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow.
# cycles: Amount of instructions DOSBox tries to emulate each millisecond. Setting this value too high results in sound dropouts and lags. Cycles can be set in 2 ways:
# 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.
# (Example: fixed 4000)
# 'max' will allocate as much cycles as your computer is able to handle
#
# Possible values: fixed, max.
# cycleup: Amount of cycles to increase/decrease with keycombo.
# cycledown: Setting it lower than 100 will be a percentage.
core=full
cputype=auto
cycles=max
cycleup=500
cycledown=500
[mixer]
# nosound: Enable silent mode, sound is still emulated though.
# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.
# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716.
# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged.
# Possible values: 2048, 4096, 8192, 1024, 512, 256.
# prebuffer: How many milliseconds of data to keep on top of the blocksize.
nosound=false
rate=8000
blocksize=2048
prebuffer=10
[sblaster]
# sbtype: Type of sblaster to emulate.
# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, none.
# sbbase: The IO address of the soundblaster.
# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.
# irq: The IRQ number of the soundblaster.
# Possible values: 7, 5, 3, 9, 10, 11, 12.
# dma: The DMA number of the soundblaster.
# Possible values: 1, 5, 0, 3, 6, 7.
# hdma: The High DMA number of the soundblaster.
# Possible values: 1, 5, 0, 3, 6, 7.
# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.
# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.
# Possible values: auto, cms, opl2, dualopl2, opl3, none.
# oplemu: Provider for the OPL emulation. compat or old might provide better quality (see oplrate as well).
# Possible values: default, compat, fast, old.
# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).
# Possible values: 22050, 49716, 44100, 48000, 32000, 16000, 11025, 8000.
sbtype=sbpro1
sbbase=220
irq=7
dma=1
hdma=5
sbmixer=true
oplmode=auto
oplemu=fast
oplrate=8000
[speaker]
# pcspeaker: Enable PC-Speaker emulation.
# pcrate: Sample rate of the PC-Speaker sound generation.
# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716.
# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.
# Possible values: auto, on, off.
# tandyrate: Sample rate of the Tandy 3-Voice generation.
# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716.
# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).
pcspeaker=true
pcrate=8000
tandy=auto
tandyrate=8000
disney=true
[joystick]
# joysticktype: Type of joystick to emulate: auto (default), none,
# 2axis (supports two joysticks),
# 4axis (supports one joystick, first joystick used),
# 4axis_2 (supports one joystick, second joystick used),
# fcs (Thrustmaster), ch (CH Flightstick).
# none disables joystick emulation.
# auto chooses emulation depending on real joystick(s).
# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.
# timed: enable timed intervals for axis. (false is old style behaviour).
# autofire: continuously fires as long as you keep the button pressed.
# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.
# buttonwrap: enable button wrapping at the number of emulated buttons.
joysticktype=auto
timed=true
autofire=false
swap34=false
buttonwrap=true
[dos]
# xms: Enable XMS support.
# ems: Enable EMS support.
# umb: Enable UMB support.
# keyboardlayout: Language code of the keyboard layout (or none).
xms=true
ems=true
umb=true
keyboardlayout=auto
[autoexec]
# Lines in this section will be run at startup.
mount c "\Storage Card\DOSDrive\emu"
#imgmount c "\Storage Card\DOSDrive\EMU\Win98\W98.IMG" -t hdd -fs fat -size 512,63,16,518
C:
please wait .. uploading sample videos ..
Dos Game Dave
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
http://www.youtube.com/watch?v=2L3x2_JY1O0
Dos Game Heretic + Turbo Basic 1.0 and Turbo C++
Part 1 - http://www.youtube.com/watch?v=xWi5YcwHkU4 - HERETIC
Part 2 - http://www.youtube.com/watch?v=QFiP2KmUm3I - Turbo Basic
Part 3 - http://www.youtube.com/watch?v=MQmmq-P9BXI - Turbo C++
reserved section for download links
my problem is messed up keys ie. left right up down
but so far i only tried faceoff (hockey) maybe i need to try some newer game
yeap. I hope every one can share their thoughts.
tried nhl94 runs slow as hell keys are messed up and lacking "ALT", "ALT_gr" keys
tried to edit mapper.txt but no success with keys
tried to fine tune dosbox.conf no major progress made
heretic and hexen have been released native for pocketpc
lemmings too
that's counter progressive but I accept that.
anyway, I still want to have a possibility to make DOSBOX fast when playing games.
that's counter progressive but I accept that.
anyway, I still want to have a possibility to make DOSBOX fast when playing games.
this is the best what i have made so far
dosbox runs great gameplay on faceoff is quite smooth (some video lag)
Code:
# This is the configurationfile for DOSBox 0.73.
# Lines starting with a # are commentlines.
# They are used to (briefly) document the effect of each option.
[sdl]
# fullscreen: Start dosbox directly in fullscreen.
# rotateright: Alternate screen rotation.
# mapperfile: File used to load/save the key/event mappings from.
# kbdtoolbar: First toolbar.
# gametoolbar: Second toolbar.
# settoolbar: Third toolbar. Note: frameskip and cycles values are drawn there.
# usescancodes: Avoid usage of symkeys, might not work on all operating systems.
# sensitivity: Mouse sensitivity.
# touchpadmouse: Emulate mouse with stylus moves on screen. Can fix mouse behavior in games that expect only relative mouse movement.
# clickms: When in touchpad mode, left-click is sent after single-tap. This sets the delay in milliseconds between emulated mouse button down and up events.
# rightclickdelay: Touchpad mode. If you tap and hold stylus for this milliseconds, right-click will be send instead of left. 0 to disable.
# dpadmouse: Emulate mouse with D-Pad. Make sure to set corresponding mapper values for this to work. Up, down, left and right keys are autorotated.
# forcetoolbar: Sometimes where's no space on screen to fit even a part of toolbar. This forces it to display. Also a key and a zone can be set for toggling.
# forcetransparent: Forced toolbar area, overlapping active screen part will be semitransparent.
# forcezone: X, Y, width and height of 'force toolbar display' tapzone. No spaces please. See also hand_force_tlbr setting in mapper.txt
# forceheight: Forced toolbar will have this height.
fullscreen=true
rotateright=true
mapperfile=mapper.txt
kbdtoolbar=toolbar.dbk
gametoolbar=game.dbk
settoolbar=set.dbk
usescancodes=false
sensitivity=200
touchpadmouse=true
clickms=50
rightclickdelay=700
dpadmouse=true
forcetoolbar=true
forcetransparent=false
forcezone=0,0,10,5
forceheight=12
[dosbox]
# language: Select another language file.
# machine: The type of machine tries to emulate.
# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe.
# captures: Directory where things like wave, midi, screenshot get captured.
# memsize: Amount of memory DOSBox has in megabytes.
# This value is best left at its default to avoid problems with some games,
# though few games might require a higher value.
# There is generally no speed advantage when raising this value.
language=
machine=svga_s3
captures=capture
memsize=32
[render]
# frameskip: How many frames DOSBox skips before drawing one.
# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended,the scaler will be used even if the result might not be desired.
# Possible values: qvga, vga.
frameskip=3
aspect=false
scaler=vga
[cpu]
# core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
# Possible values: full, dynamic, simple.
# cputype: CPU Type used in emulation. auto is the fastest choice.
# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow.
# cycles: Amount of instructions DOSBox tries to emulate each millisecond. Setting this value too high results in sound dropouts and lags. Cycles can be set in 2 ways:
# 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.
# (Example: fixed 4000)
# 'max' will allocate as much cycles as your computer is able to handle
# Possible values: fixed, max.
# cycleup: Amount of cycles to increase/decrease with keycombo.
# cycledown: Setting it lower than 100 will be a percentage.
core=full
cputype=auto
cycles=max
cycleup=500
cycledown=500
[mixer]
# nosound: Enable silent mode, sound is still emulated though.
# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.
# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716.
# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged.
# Possible values: 2048, 4096, 8192, 1024, 512, 256.
# prebuffer: How many milliseconds of data to keep on top of the blocksize.
nosound=false
rate=8000
blocksize=2048
prebuffer=10
[sblaster]
# sbtype: Type of sblaster to emulate.
# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, none.
# sbbase: The IO address of the soundblaster.
# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.
# irq: The IRQ number of the soundblaster.
# Possible values: 7, 5, 3, 9, 10, 11, 12.
# dma: The DMA number of the soundblaster.
# Possible values: 1, 5, 0, 3, 6, 7.
# hdma: The High DMA number of the soundblaster.
# Possible values: 1, 5, 0, 3, 6, 7.
# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.
# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.
# Possible values: auto, cms, opl2, dualopl2, opl3, none.
# oplemu: Provider for the OPL emulation. compat or old might provide better quality (see oplrate as well).
# Possible values: default, compat, fast, old.
# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).
# Possible values: 22050, 49716, 44100, 48000, 32000, 16000, 11025, 8000.
sbtype=sbpro1
sbbase=220
irq=7
dma=1
hdma=5
sbmixer=true
oplmode=auto
oplemu=fast
oplrate=8000
[speaker]
# pcspeaker: Enable PC-Speaker emulation.
# pcrate: Sample rate of the PC-Speaker sound generation.
# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716.
# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.
# Possible values: auto, on, off.
# tandyrate: Sample rate of the Tandy 3-Voice generation.
# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716.
# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).
pcspeaker=true
pcrate=8000
tandy=auto
tandyrate=8000
disney=true
[joystick]
# joysticktype: Type of joystick to emulate: auto (default), none,
# 2axis (supports two joysticks),
# 4axis (supports one joystick, first joystick used),
# 4axis_2 (supports one joystick, second joystick used),
# fcs (Thrustmaster), ch (CH Flightstick).
# none disables joystick emulation.
# auto chooses emulation depending on real joystick(s).
# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.
# timed: enable timed intervals for axis. (false is old style behaviour).
# autofire: continuously fires as long as you keep the button pressed.
# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.
# buttonwrap: enable button wrapping at the number of emulated buttons.
joysticktype=none
timed=true
autofire=false
swap34=false
buttonwrap=true
[dos]
# xms: Enable XMS support.
# ems: Enable EMS support.
# umb: Enable UMB support.
# keyboardlayout: Language code of the keyboard layout (or none).
xms=true
ems=true
umb=true
keyboardlayout=auto
[autoexec]
# Lines in this section will be run at startup.
mount c "\Storage Card\"
c:
hi
Nullstring said:
Dos Game Dave
http://www.youtube.com/watch?v=2L3x2_JY1O0
Dos Game Heretic + Turbo Basic 1.0 and Turbo C++
Part 1 - http://www.youtube.com/watch?v=xWi5YcwHkU4 - HERETIC
Part 2 - http://www.youtube.com/watch?v=QFiP2KmUm3I - Turbo Basic
Part 3 - http://www.youtube.com/watch?v=MQmmq-P9BXI - Turbo C++
Click to expand...
Click to collapse
whether it will work for htc hd2
indycar said:
my problem is messed up keys ie. left right up down
but so far i only tried faceoff (hockey) maybe i need to try some newer game
Click to expand...
Click to collapse
I'm not sure about the X1, but on the LG Fathom, you just need to edit MAPPER.TXT in the DOSBOX folder and swap key_up, key_down etc
- so I think I'm right in saying that you need to swap
key_up <> key_right
key_down <> key_left
key_left <> key_up
key_right <> key_down
I know this post is from a while back, but I just want to post that for anyone looking. I am going to use Windows Mobile as long as I can and I hope others will continue to use it too!

Removing Facebook HTC Data

Is there a way to easily remove the facebook tags on contacts in outlook? it's the stuff that says :
<HTCData><!-- Please do not modify -->
<Facebook>id:xxxxxx/friendof:xxxxxxxxxxx</Facebook>
</HTCData>
Thanks!
Yes PLEASE? I don't use a Sense ROM anymore and this is annoying!
I don't even have this phone anymore. Maybe I will write something to do this for us.
HTC tag removal in contact notes!
I just sat down on my break and created this code to strip out the HTC tags from the contact notes:
Code:
Sub HTCbGone()
Dim objContactsFolder As Outlook.MAPIFolder
Dim objContacts As Outlook.Items
Dim objContact As Object
Dim StartPos As Integer
Dim EndPos As Integer
Dim iCount As Integer
' Specify with which contact folder to work
Set objContactsFolder = _
Session.GetDefaultFolder(olFolderContacts)
Set objContacts = objContactsFolder.Items
iCount = 0
' Process the changes
For Each objContact In objContacts
If TypeName(objContact) = "ContactItem" Then
StartPos = InStr(objContact.Body, "<HTCData>")
EndPos = InStr(objContact.Body, "</HTCData>") + 10
If StartPos > 0 Then
If StartPos = 1 Then
If Len(EndPos) > EndPos + 1 Then
objContact.Body = Mid(objContact.Body, EndPos + 1)
Else
objContact.Body = ""
End If
Else
If Len(EndPos) > EndPos + 1 Then
objContact.Body = Left(objContact.Body, StartPos = 1)
Else
objContact.Body = Left(objContact.Body, StartPos - 1) & Mid(objContact.Body, EndPos + 1)
End If
End If
iCount = iCount + 1
objContact.Save
End If
End If
Next
' Display the results
MsgBox "Number of contacts updated:" & Str$(iCount), , _
"HTCbGone Finished"
' Clean up
Set objContact = Nothing
Set objContacts = Nothing
Set objContactsFolder = Nothing
End Sub
To run this, I opened Outlook. Selected Macro(s) from the Tools pull-down menu (or press [ALT+F8]). Created a new Macro called HTCbGone and pasted this code over everything. Then I just ran it.
Use at your own risk.
Happy scripting,
GinoRP
THANK YOU!!!! (I only type in all caps 2 or 3 times a year) If HTC was a person I would kick him in the teeth because of what they have done to my 500+ contacts in my Microsoft Exchange account.
How could the people at HTC justify code that puts notes on contacts only invisible to a HTC device and visible everywhere else?? How could they think that would annoy no one? Blows my effing mind.
Kinda thanks but for me it did not work.
I made and run the macro.
Then I noticed some things got lost though!
Before I began I made a copy of the contacts folder in Outlook (recommended!).
I used the "modified" tab to see what contacts where changed when.
There was an extra URL in the note position for a contact which I put there earlier today.
After running the macro the Facebook data was gone but so was the URL.
Because it changed many contacts I did not bother to look further if other things gotten lost but rather just emptied the folder and restored from backup folder.
I am do work with DB and such but did not find anything special in the script which could explain my output.
Sorry to bring up a dead thread, but is there a way to do this without outlook?
i am still interested as well- can anyone come up with a better way not using outlook?
Remove HTC Notes Using CSV
DeMiNe0 said:
Sorry to bring up a dead thread, but is there a way to do this without outlook?
Click to expand...
Click to collapse
I was trying to figure out this very same thing and came across this thread in my searching. I also don't look Outlook, but I found a really simple, quick, and effective way to manually get rid of all those pesky HTC notes in under five minutes, for those that don't use Outlook:
1) Go into the contacts view in Gmail
2) Click the "More" dropdown box and select "Export"
3) Ensure that the "All Contacts" option is selected, choose the "Outlook CSV format," and export
4) After the file downloads, open it up in Excel (or your choice spreadsheet program)
5) Find the column labeled "Notes," and then just scroll down and clear all the cells with HTC data in them
6) Save the file, ensuring it is still in CSV format
7) Back in your Google Contact Manager, delete all your contacts
NOTE: Before deleting your contacts you will want to export a Google CSV file of all your contacts for backup. You can also the "More > Restore" feature to go back to a previous point in time if something goes wrong.​8) Import the CSV file you saved in step 6
That's it! Your contact book should be restored to the exact way it was, minus the obnoxious HTC data. With 1,000+ contacts, I was able to do this in about two minutes. Again, be sure you have backups of your contacts or know how to use Google's Restore contacts feature in case something goes wrong, but this should work simply enough. Also, I just selected all the cells in the Notes column and cleared all their data, but if you have any notes saved for any of your contacts, you'll want to scroll through the spreadsheet file and be sure you only delete cells with HTC data.
I hope this helps!
---------- Post added at 01:09 AM ---------- Previous post was at 12:52 AM ----------
You should also be aware that this method may cause you to lose your contacts photos, as well as any joined contacts you have in your Android address book. However, if you want to attach your contacts Facebook photos permanently to their Google contact entry (something HTC's method did not do), you should check out this tool; in just a couple clicks, you can have all those photos matched up again and restored:
[I can't post links yet, but just Google "Facebook Google Contact Sync" and click on the first return. It is a great little tool made by a dev called "Heart of Angel."]
mredmond2012 said:
I was trying to figure out this very same thing and came across this thread in my searching. I also don't look Outlook, but I found a really simple, quick, and effective way to manually get rid of all those pesky HTC notes in under five minutes, for those that don't use Outlook:
1) Go into the contacts view in Gmail
2) Click the "More" dropdown box and select "Export"
3) Ensure that the "All Contacts" option is selected, choose the "Outlook CSV format," and export
4) After the file downloads, open it up in Excel (or your choice spreadsheet program)
5) Find the column labeled "Notes," and then just scroll down and clear all the cells with HTC data in them
6) Save the file, ensuring it is still in CSV format
7) Back in your Google Contact Manager, delete all your contacts
NOTE: Before deleting your contacts you will want to export a Google CSV file of all your contacts for backup. You can also the "More > Restore" feature to go back to a previous point in time if something goes wrong.​8) Import the CSV file you saved in step 6
That's it! Your contact book should be restored to the exact way it was, minus the obnoxious HTC data. With 1,000+ contacts, I was able to do this in about two minutes. Again, be sure you have backups of your contacts or know how to use Google's Restore contacts feature in case something goes wrong, but this should work simply enough. Also, I just selected all the cells in the Notes column and cleared all their data, but if you have any notes saved for any of your contacts, you'll want to scroll through the spreadsheet file and be sure you only delete cells with HTC data.
I hope this helps!
---------- Post added at 01:09 AM ---------- Previous post was at 12:52 AM ----------
You should also be aware that this method may cause you to lose your contacts photos, as well as any joined contacts you have in your Android address book. However, if you want to attach your contacts Facebook photos permanently to their Google contact entry (something HTC's method did not do), you should check out this tool; in just a couple clicks, you can have all those photos matched up again and restored:
[I can't post links yet, but just Google "Facebook Google Contact Sync" and click on the first return. It is a great little tool made by a dev called "Heart of Angel."]
Click to expand...
Click to collapse
In addition to the thanks button, I think you deserve a "thanks" post. This was so useful and in addition to removing that HTC garbage, I removed all the other data I found unnecessary.
Remove With a Simple Java Program, If you know Java
Ozark_8125 said:
Is there a way to easily remove the facebook tags on contacts in outlook? it's the stuff that says :
<HTCData><!-- Please do not modify -->
<Facebook>id:xxxxxx/friendof:xxxxxxxxxxx</Facebook>
</HTCData>
Thanks!
Click to expand...
Click to collapse
I know I am too late to reply this post but I actually searched a solution today and found this post where some one also had same issue.
Using gdata java api I wrote a small program to remove notes from all of your contacts. Maximum 800 (Congifurable) Here is the Java Program :
Code:
import java.net.URL;
import com.google.gdata.client.Query;
import com.google.gdata.client.contacts.ContactsService;
import com.google.gdata.data.PlainTextConstruct;
import com.google.gdata.data.TextContent;
import com.google.gdata.data.contacts.ContactEntry;
import com.google.gdata.data.contacts.ContactFeed;
/**
* This is a test template
*/
public class ContactNotesCleaner {
public static String feedUrlString = "https COLON SLASH SLASH www DOT google DOT com SLASH m8 SLASH feeds SLASH contacts SLASH default SLASH full";
public static void main(String[] args) throws Exception {
// Create a new Contacts service
ContactsService myService = new ContactsService(<Any App Name>);
myService.setUserCredentials(<Your Gmail Id>, <Your Password>);
updateAllContacts(myService);
}
public static void updateAllContacts(ContactsService myService) throws Exception {
URL feedUrl = new URL(feedUrlString);
Query myQuery = new Query(feedUrl);
myQuery.setMaxResults(800);
ContactFeed resultFeed = myService.query(myQuery, ContactFeed.class);
// Print the results
System.out.println(resultFeed.getTitle().getPlainText());
for (ContactEntry entry : resultFeed.getEntries()) {
if (entry.getContent() != null) {
updateNotesContent(myService, entry);
}
}
}
private static void updateNotesContent(ContactsService myService, ContactEntry entry) throws Exception {
TextContent textContent = (TextContent) entry.getContent();
if (textContent.getContent() != null) {
String plainText = textContent.getContent().getPlainText();
if (plainText != null && plainText.startsWith("<HTCData>")) {
String newPlainText = "";
textContent.setContent(new PlainTextConstruct(newPlainText.trim()));
entry.setContent(textContent);
URL editUrl = new URL(entry.getEditLink().getHref());
ContactEntry contactEntry = myService.update(editUrl, entry);
System.out.println(entry.getName().getFullName().getValue() + " " + "Updated: " + contactEntry.getUpdated().toString());
}
}
}
}
I have executed the above program and tested it. You need gdata lib files:
gdata-media-1.0.jar
gdata-client-meta-1.0.jar
gdata-contacts-3.0.jar
gdata-client-1.0.jar
gdata-contacts-meta-3.0.jar
gdata-core-1.0.jar
guava-14.0.1.jar
gdataplugin.jar -- I am not sure what this jar does, even if it is required or not.
This is a bit complex for some users to run a java program, this way you will not loose the chat invites and other important information of your contact.
Note: Even if I have tested above program 10 times, I would not give any guaranty it will work for you.
- CAM
cmehta82 said:
I know I am too late to reply this post but I actually searched a solution today and found this post where some one also had same issue.
Using gdata java api I wrote a small program to remove notes from all of your contacts. Maximum 800 (Congifurable) Here is the Java Program
Click to expand...
Click to collapse
Your Java program worked!
I attached all the required libraries in a .zip-file. Include them in your Java project and copy the code from cmehta82 post above.
Replace <Your Gmail Id> with your emailadress:
Replace <Your Password> with your application specific password, generated at https://accounts.google.com/b/0/IssuedAuthSubTokens#accesscodes
Replace the feed URL string with https://www.google.com/m8/feeds/contacts/default/full
Can't JOIN contacts if HTCData exists in notes field
I wrote up my solution to this problem a little bit here thanks to the this forum thread above.
http://androidforums.com/samsung-ga...tcdata-exists-in-notes-field.html#post5968115
Python script to remove HTCData
Used to be a HTC phone user and it really messed up my contacts with the XML data. I am using a Mac and have written a Python script to get rid of the HTCData tag.
I posted the script here: http://kongjinjie.wordpress.com/2013/10/29/remove-htcdata-from-apple-contacts/
I don't know if this works on other OS, only tested on my Mac. I hope it helps!
EDIT:
Do not use this for those who setup Sync to Google. After running this script, it doesn't seeem to initiate a sync to Google. Anyone knows how to force a sync to Google? Is there a timestamp I can change to identify the latest version?
cmehta82 said:
I know I am too late to reply this post but I actually searched a solution today and found this post where some one also had same issue.
Using gdata java api I wrote a small program to remove notes from all of your contacts. Maximum 800 (Congifurable) Here is the Java Program :
Code:
import java.net.URL;
import com.google.gdata.client.Query;
import com.google.gdata.client.contacts.ContactsService;
import com.google.gdata.data.PlainTextConstruct;
import com.google.gdata.data.TextContent;
import com.google.gdata.data.contacts.ContactEntry;
import com.google.gdata.data.contacts.ContactFeed;
/**
* This is a test template
*/
public class ContactNotesCleaner {
public static String feedUrlString = "https COLON SLASH SLASH www DOT google DOT com SLASH m8 SLASH feeds SLASH contacts SLASH default SLASH full";
public static void main(String[] args) throws Exception {
// Create a new Contacts service
ContactsService myService = new ContactsService(<Any App Name>);
myService.setUserCredentials(<Your Gmail Id>, <Your Password>);
updateAllContacts(myService);
}
public static void updateAllContacts(ContactsService myService) throws Exception {
URL feedUrl = new URL(feedUrlString);
Query myQuery = new Query(feedUrl);
myQuery.setMaxResults(800);
ContactFeed resultFeed = myService.query(myQuery, ContactFeed.class);
// Print the results
System.out.println(resultFeed.getTitle().getPlainText());
for (ContactEntry entry : resultFeed.getEntries()) {
if (entry.getContent() != null) {
updateNotesContent(myService, entry);
}
}
}
private static void updateNotesContent(ContactsService myService, ContactEntry entry) throws Exception {
TextContent textContent = (TextContent) entry.getContent();
if (textContent.getContent() != null) {
String plainText = textContent.getContent().getPlainText();
if (plainText != null && plainText.startsWith("<HTCData>")) {
String newPlainText = "";
textContent.setContent(new PlainTextConstruct(newPlainText.trim()));
entry.setContent(textContent);
URL editUrl = new URL(entry.getEditLink().getHref());
ContactEntry contactEntry = myService.update(editUrl, entry);
System.out.println(entry.getName().getFullName().getValue() + " " + "Updated: " + contactEntry.getUpdated().toString());
}
}
}
}
I have executed the above program and tested it. You need gdata lib files:
gdata-media-1.0.jar
gdata-client-meta-1.0.jar
gdata-contacts-3.0.jar
gdata-client-1.0.jar
gdata-contacts-meta-3.0.jar
gdata-core-1.0.jar
guava-14.0.1.jar
gdataplugin.jar -- I am not sure what this jar does, even if it is required or not.
This is a bit complex for some users to run a java program, this way you will not loose the chat invites and other important information of your contact.
Note: Even if I have tested above program 10 times, I would not give any guaranty it will work for you.
- CAM
Click to expand...
Click to collapse
P1nGu1n_ said:
Your Java program worked!
I attached all the required libraries in a .zip-file. Include them in your Java project and copy the code from cmehta82 post above.
Replace <Your Gmail Id> with your emailadress:
Replace <Your Password> with your application specific password, generated at https://accounts.google.com/b/0/IssuedAuthSubTokens#accesscodes
Replace the feed URL string with https://www.google.com/m8/feeds/contacts/default/full
Click to expand...
Click to collapse
Where do you configure the app name and password?>
ginorp said:
I just sat down on my break and created this code to strip out the HTC tags from the contact notes:
Code:
Sub HTCbGone()
Dim objContactsFolder As Outlook.MAPIFolder
Dim objContacts As Outlook.Items
Dim objContact As Object
Dim StartPos As Integer
Dim EndPos As Integer
Dim iCount As Integer
' Specify with which contact folder to work
Set objContactsFolder = _
Session.GetDefaultFolder(olFolderContacts)
Set objContacts = objContactsFolder.Items
iCount = 0
' Process the changes
For Each objContact In objContacts
If TypeName(objContact) = "ContactItem" Then
StartPos = InStr(objContact.Body, "<HTCData>")
EndPos = InStr(objContact.Body, "</HTCData>") + 10
If StartPos > 0 Then
If StartPos = 1 Then
If Len(EndPos) > EndPos + 1 Then
objContact.Body = Mid(objContact.Body, EndPos + 1)
Else
objContact.Body = ""
End If
Else
If Len(EndPos) > EndPos + 1 Then
objContact.Body = Left(objContact.Body, StartPos = 1)
Else
objContact.Body = Left(objContact.Body, StartPos - 1) & Mid(objContact.Body, EndPos + 1)
End If
End If
iCount = iCount + 1
objContact.Save
End If
End If
Next
' Display the results
MsgBox "Number of contacts updated:" & Str$(iCount), , _
"HTCbGone Finished"
' Clean up
Set objContact = Nothing
Set objContacts = Nothing
Set objContactsFolder = Nothing
End Sub
To run this, I opened Outlook. Selected Macro(s) from the Tools pull-down menu (or press [ALT+F8]). Created a new Macro called HTCbGone and pasted this code over everything. Then I just ran it.
Use at your own risk.
Happy scripting,
GinoRP
Click to expand...
Click to collapse
Sorry for this reply in this old thread, but you might lose data running the VBA code from GinoRP. I found a lot of small mistakes.
Here is the corrected code. You can run it multiple times if there is more than one <HTCData> tag in a specific contact.
Code:
Sub HTCbGone()
Dim objContactsFolder As Outlook.MAPIFolder
Dim objContacts As Outlook.Items
Dim objContact As Object
Dim StartPos As Integer
Dim EndPos As Integer
Dim iCount As Integer
' Specify with which contact folder to work
Set objContactsFolder = _
Session.GetDefaultFolder(olFolderContacts)
Set objContacts = objContactsFolder.Items
iCount = 0
' Process the changes
For Each objContact In objContacts
If TypeName(objContact) = "ContactItem" Then
StartPos = InStr(objContact.Body, "<HTCData>")
EndPos = InStr(objContact.Body, "</HTCData>") + 10
If StartPos > 0 Then
If StartPos = 1 Then
If Len(objContact.Body) > EndPos + 1 Then
objContact.Body = Mid(objContact.Body, EndPos)
Else
objContact.Body = ""
End If
Else
If Len(objContact.Body) = EndPos - 1 Then
objContact.Body = Left(objContact.Body, StartPos - 1)
Else
objContact.Body = Left(objContact.Body, StartPos - 1) & Mid(objContact.Body, EndPos)
End If
End If
iCount = iCount + 1
objContact.Save
End If
End If
Next
' Display the results
MsgBox "Number of contacts updated:" & Str$(iCount), , _
"HTCbGone Finished"
' Clean up
Set objContact = Nothing
Set objContacts = Nothing
Set objContactsFolder = Nothing
End Sub

MortScripts to toggle settings

This thread is dedicated to MortScripts that we use to change settings. Most of these can be stand alone scripts, but I got started creating this thread based on CHTS needing WMLongLife to change from Automatic to GSM radio profile. I found that WMLL seemed to eat up battery life in my old Fuze. I tried a script or two from the MortScript examples thread, but they did not work for me. I'll be posting various scripts that I use during my profile changes in CHTS, but I will in such a way that if you do not use CHTS you can still use the scripts.
Another purpose of this thread is to make these scripts available to those who for one reason or another the default programs in CHTS do not work and perhaps the script will. An example is sound profile changing to Automatic was not available so I added a script to do it for me. The feature had been turned off since it did not work in all phones. In a coming version I believe it will be back. The beta test works in my Fuze.
The hope of this thread is to help those that use CHTS to get some of the features that may not work on their phone through MortScripts instead. Also, as a place to share these "TOGGLE" switch scripts for others to be able to use outside CHTS.
I am trying to write scripts that do not use programs outside windows mobile. The hope is that they can be used in as many phones and ROMs as possible. An example is the first form of my Band_Changer used a program in CHTS and I reworked it to not require that program.
Radio toggle between Automatic (2G & 3G) and GSM (2G only): Post #2
Switch Sound Profile: Post #3
Auto time zone toggle: Post #5 and Post #8
Toggle Backlight: Post #14
Toggle Screen Rotation: Post #15
Toggle between Active Sync and Mass Storage: Post #16
Toggle Voice Command: Post #17
Radio toggle between Automatic (2G & 3G) and GSM (2G only)
This script calls the main script with the argument required based on your current profile to switch the profile to the other.
Code:
# Band_Toggle.mscr
opmode = RegRead( "HKLM","Software\OEM\UMTS","OpMode")
opmode = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName" & OpMode + 1)
If(opmode eq "Auto")
key = "g"
Else
key = "a"
EndIf
CallScript("\storage card\scripts\Band_Changer.mscr", key)
# CallScript("\windows\Band_Changer.mscr", key)
I test the script in my storage card, but when I use it for CHTS I would have it in \windows folder.
This is the main script:
Code:
# Band_Changer.mscr
If(NOT FileExists("\Windows\CMBandSwitching.exe"))
Message("You must have CMBandSwitching.exe installed in windows folder.^NL^^NL^Script will exit now.", "ERROR")
Exit
EndIf
key = argv[1]
key = (key eq "a")?"Auto":"GSM"
opmode = RegRead( "HKLM","Software\OEM\UMTS","OpMode")
opmode = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName" & OpMode + 1)
network1 = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName1" )
network2 = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName2" )
network3 = RegRead( "HKLM","Software\OEM\PhoneSetting\NetworkType","ItemName3" )
If(key ne OpMode)
If(key eq network1)
key = 1
ElseIf(key eq network2)
key = 2
ElseIf(key eq network3)
key = 3
Else
EndIf
Call("switcher")
EndIf
Sub switcher
Global(key)
SendSpecial(126) # Data disconnect
i=0
ForEach xvariable in regSubkeys("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections")
i+=1
enable[i] = RegRead("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections" \ xvariable, "Enabled")
EndForEach
Sleep(500)
ForEach xvariable in regSubkeys("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections")
RegWriteDWord("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections" \ xvariable, "Enabled", 0)
EndForEach
Sleep(500)
Run("\Windows\CMBandSwitching.exe")
If(ScreenHeight() eq 640)
Y1 = 160 # 1st button which is Auto on my Fuze 163
Y2 = 245 # 2nd button which is GSM on my Fuze 244
Y3 = 315 # 3rd button which is WCDMA on my Fuze 314
Y4 = 610 # Done button on my Fuze 608
X4 = 135 # Done button on my Fuze 134
Y5 = 460 # Done button on my Fuze 460
X5 = 125 # Done button on my Fuze 125
ElseIf(ScreenHeight() eq 800)
Y1 = 150 # 1st button which is Auto on HD2 150
Y2 = 200 # 2nd button which is GSM on HD2 200
Y3 = 305 # 3rd button which is WCDMA on HD2 305
Y4 = 750 # Done button on HD2 750
X4 = 110 # Done button on HD2 110
Y5 = 480 # Done button on HD2 480
X5 = 110 # Done button on HD2 110
EndIf
While(NOT WndActive("Band"))
Sleep(50)
EndWhile
If(key eq 1)
MouseClick("Band", ScreenWidth()*0.25, Y1) # 1st button
ElseIf(key eq 2)
MouseClick("Band", ScreenWidth()*0.25, Y2) # 2nd button
Else
MouseClick("Band", ScreenWidth()*0.25, Y3) # 3rd button
EndIf
Sleep(150)
SendSpecial(112) # Done
Sleep(500)
i=0
ForEach xvariable in regSubkeys("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections")
i+=1
RegWriteDWord("HKLM", "Comm\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections" \ xvariable, "Enabled", enable[i])
EndForEach
Sleep(20000)
If(NOT Connected())
Connect("The Internet")
EndIf
EndSub
If you do not have a 480 x 640 or 480 x 800 phone or if this does not work for you please try this script to get me the points I need to improve this script.
Code:
# PickPoints.mscr
Run("\Windows\CMBandSwitching.exe")
WaitForActive("Band", 10)
Sleep(300)
SleepMessage( 2, "Select center of first (top) Network Type choice after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput1 = "^NL^First:^NL^X1 = " & aMouse[1] &"^NL^Y1 = " & aMouse[2]
SleepMessage( 2, "Select center of second (middle) Network Type choice after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput2 = "^NL^Second:^NL^X2 = " & aMouse[1] &"^NL^Y2 = " & aMouse[2]
SleepMessage( 2, "Select center of third (bottom) Network Type choice after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput3 = "^NL^Third:^NL^X3 = " & aMouse[1] &"^NL^Y3 = " & aMouse[2]
Sleep(300)
MouseClick("Band", aMouse[1], aMouse[2])
Sleep(300)
SleepMessage( 2, "Select center of Done button after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput4 = "^NL^Done:^NL^X4 = " & aMouse[1] &"^NL^Y4 = " & aMouse[2]
Sleep(300)
MouseClick("Band", aMouse[1], aMouse[2])
Sleep(1500)
SleepMessage( 2, "Select center of OK button after this screen closes." )
Sleep(300)
aMouse = ScreenshotClick()
sMSGOutput5 = "^NL^OK:^NL^X5 = " & aMouse[1] &"^NL^Y5 = " & aMouse[2]
SleepMessage( 2, "Select center of Cancel button after this screen closes." )
Sleep(3000)
WriteFile("\band_click.txt", "Screen width: " & ScreenWidth() & "^NL^Screen height: " & ScreenHeight() & sMSGOutput1 & sMSGOutput2 & sMSGOutput3 & sMSGOutput4 & sMSGOutput5)
Message("Please send me these data. They are saved in root directory \band_click.txt^NL^")
Remove the .txt from the end of the script files.
Switch Sound Profile
These scripts call the main script with the argument for the profile you want.
Code:
# Sound_Automatic.mscr
CallScript("\Windows\Sound_Profile.mscr", "Automatic")
Code:
# Sound_Normal.mscr
CallScript("\Windows\Sound_Profile.mscr", "Normal")
Code:
# Sound_Silent.mscr
CallScript("\Windows\Sound_Profile.mscr", "Silent")
Code:
# Sound_Vibrate.mscr
CallScript("\Windows\Sound_Profile.mscr", "Vibrate")
This is the main script:
Code:
# Sound_Profile.mscr
# Change Sound Profile based on argument used to call this script from
# a short script in the form:
# CallScript("\Windows\Sound_Profile.mscr", "Automatic")
mode=argv[1]
If(mode EQ "Automatic")
RegWriteString("HKCU", "ControlPanel\Profiles", "ActiveProfile", "Automatic")
SendMessage("", 1156, 0, 0)
ElseIf(mode EQ "Normal")
RegWriteString("HKCU", "ControlPanel\Profiles", "ActiveProfile", "Normal")
SendMessage("", 1156, 0, 0)
ElseIf(mode EQ "Silent")
SendMessage("", 1156, 3, 0)
ElseIf(mode EQ "Vibrate")
SendMessage("", 1156, 2, 0)
Else
EndIf
In CHTS profile switching I use the Execute/Kill App(s) section with the executable as \windows\mortscript.exe and the argument one of these four:
\Windows\Sound_Profile.mscr Automatic
\Windows\Sound_Profile.mscr Normal
\Windows\Sound_Profile.mscr Silent
\Windows\Sound_Profile.mscr Vibrate
Remove the .txt from the end of the script files.
This isn't written as a toggle, but these scripts will turn off or on the auto-time zone sync option in phone settings. Turning it off helps to keep active sync from running all the time.
Code:
#Auto time zone off
RegWriteDWord("HKLM","\Drivers\BuiltIn\RIL","NITZEnable",0)
Code:
#Auto time zone on
RegWriteDWord("HKLM","\Drivers\BuiltIn\RIL","NITZEnable",1)
Auto time zone toggle
Thanks Farmer Ted
It is easy enough to create a toggle.
Code:
If(RegRead("HKLM","\Drivers\BuiltIn\RIL","NITZEnable"))
RegWriteDWord("HKLM","\Drivers\BuiltIn\RIL","NITZEnable",0) #Auto time zone off
Else
RegWriteDWord("HKLM","\Drivers\BuiltIn\RIL","NITZEnable",1) #Auto time zone on
EndIf
Thx RoryB... toggle features are good... if you can store all here.. it must be a good base to share with communauty !
great job my friend! especially after the long test time in beta group to fulfill different device's needs.
this is the perfect extension for the post-run-scripts while profile switching.
I'm looking forward to much more of this scripts, which can be used.
Thanx also in name of all CHTS-users
Micha
RoryB said:
Thanks Farmer Ted
It is easy enough to create a toggle.
Click to expand...
Click to collapse
Cool, that was a lot simpler than if I'd done it, lol. Here's the same script, with message boxes to let you know what the setting is.
Code:
If(RegRead("HKLM","\Drivers\BuiltIn\RIL","NITZEnable"))
RegWriteDWord("HKLM","\Drivers\BuiltIn\RIL","NITZEnable",0) #Auto time zone off
Message("Active Sync under control")
Else
RegWriteDWord("HKLM","\Drivers\BuiltIn\RIL","NITZEnable",1) #Auto time zone on
Message("Active Sync running wild")
EndIf
LOL I love a sense of humor.
I updated post #2 for the Band Changer because I have been getting failed to connect or dialed modem not answering error messages.
RoryB said:
I updated post #2 for the Band Changer because I have been getting failed to connect or dialed modem not answering error messages.
Click to expand...
Click to collapse
Made another tweak to stop data connection first.
Updated Post #2 for Band_Changer.mscr. It seems to run a little faster.
On Band_Changer I realized that
Code:
Y1 = 150 # 1st button which is Auto on HD2 150
Y2 = 215 # 2nd button which is GSM on HD2 200
Y3 = 300 # 3rd button which is WCDMA on HD2 305
works in my phone too. So I would not need to check the screen size, but I am running Energy ROM that is a WVGA with tweaks to work on my VGA. I need to get some pick point data from anyone who uses a true VGA ROM in their phone to confirm the points for it. Also, a screen shot of CMBandSwitcher.exe would help a lot.
If CMBandSwitcher.exe has the same screen size for WVGA and VGA phones I will be able to reduce the code some more.
Toggle Backlight
From http://forum.xda-developers.com/showpost.php?p=2018165&postcount=239
Code:
#toggle backlight between max and one-from-minimum (on trinity at least)
CurrentBright = RegRead( "HKCU", "ControlPanel\Backlight", "Brightness" )
If (CurrentBright = 1)
SetBacklight (100, 5)
Else
SetBacklight (1, 1)
EndIf
Toggle Screen Rotation
From http://forum.xda-developers.com/showpost.php?p=2832605&postcount=929
Code:
If (regread("HKLM", "System\GDI\ROTATION", "ANGLE") eq 0)
Rotate (90)
Else
Rotate (0)
Endif
Toggle between Active Sync and Mass Storage
From http://forum.xda-developers.com/showpost.php?p=5078802&postcount=2552
Code:
usb = RegRead ( "HKLM", "Drivers\USB\FunctionDrivers", "DefaultClientDriver" )
If ( usb eq "RNDIS" )
Run ( "\Windows\USBSetting.exe" )
Sleep ( 200 )
SendSpecial ( "Down" )
Sleep ( 50 )
SendSpecial ( "CR" )
Sleep ( 50 )
SendOK
ElseIf ( usb eq "Mass_Storage_Class" )
Run ( "\Windows\USBSetting.exe" )
Sleep ( 200 )
SendSpecial ( "Up" )
Sleep ( 50 )
SendSpecial ( "CR" )
Sleep ( 50 )
SendOK
EndIf
Toggle Voice Command
I only use Voice Command when I am driving so I toggle it off when I am not driving to save battery drain.
Code:
ShowWaitCursor
If( ProcExists( "VoiceCmd.exe" ) )
Kill( "VoiceCmd.exe" )
PlaySound( "Stopping" )
HideWaitCursor
SleepMessage( 2, "Voice Command^NL^^NL^Stopped", "Voice Command Toggle" )
Delete( "\Windows\Startup\Voice Command.lnk" ) # so it will not restart after a soft reset
else
Run( "\Program Files\Voice Command\VoiceCmd.exe" )
PlaySound( "Starting" )
HideWaitCursor
SleepMessage( 2, "Voice Command^NL^^NL^Started", "Voice Command Toggle" )
Endif
Sad to go
My Fuze no longer works. I currently have a loner Infuse 4G, but do not know what I will end up with.
I will not be able to continue development of Mortscripts, etc.
Sorry to go, but it has been fun.
I'll keep watching to see if anything comes up I need to respond to.

[Q]Bash scripting

Hey XDA, question, been usig bash for god nows how long, definately not new to it/linux,
basis for my question is, i built a huge ass config-based script (reads from default of 5 cfgs, to infinite..) t
o work as init.d, with way to many options
So many it actually gets annoying using root explorer to edit em all, & tracking em all down xD (generated..)
So i built a dynamic menu script to define it (everything in it changes dynamicly depending on config + current displayed info)
With the lack of text functions on droid its getting annoying xD lmao, so yesterday when i got off work i sat down & rebuilt it from scratch
Only took about n hour, its not to big, but now im stuck on a big issue with droid trying to add option for color
On linux its easy (just tput that **** xD), Android, almost got it, but unless i am filling the menu, color wont stick
Meaning, if i color parts of the menu (borders, text, etc. ) thenhide the keyboard, color returns to default
My question is simply, is there a bash native way to force color?
Script is here if you want a reference
http://pastebin.com/DXq1ny4P
Main config:
http://pastebin.com/q6CziJNi
Advanced config:
http://pastebin.com/0LruDMWc
(Configs MUST be in SRC/Menus from script)
Configs have functio ns removed to use as example..
excuse the crudeness & "unusual" method for scriptig xD its a WiP..
Only had about an hour or so on it
That color function is NOWHERE near mt final, its just a tmp untill
I can get full color working,
Full (so far) is:
Code:
Sf_Out() # Allows multiple variables to be parsed
# during echo, while keeping a simple layout
# $1 = Color ends after echo? [0|1]
# $2 = Remove newline on echo [0|1]
# $3 = FiP (in progress, bold text) [N/A]
# $4 = Foreground color
# $5 = Background color
# $6 = Actual text
# Command is parsed by following layout
# 'Sf_Out 0 0 0 {$4} {$5} "text"'
{
Ec="-e"
tmp=$1; # Specifify if color should end after echo
tmp=$2; # Should we remove newline on echo
tmp=$3; # FiP
U="$6" # Actual text of echoline
case "$1" in
1)Ad="FixCl;";;
*)Ad=;;
esac;case "$2" in
1|y)Ec="-en";;
esac;case "$3" in
1)FiP=;;
*)FiP=;;
esac;
W="$(case "$4" in
0)echo "30";;
1)echo "31";;
2)echo "32";;
3)echo "33";;
4)echo "34";;
5)echo "35";;
6)echo "36";;
7)echo "37";;
*)echo "37";;
esac)"
V="$(case "$5" in
0)echo "40m";;
1)echo "41m";;
2)echo "42m";;
3)echo "43m";;
4)echo "44m";;
5)echo "45m";;
6)echo "46m";;
7)echo "47m";;
*)echo "47m";;
esac)";
echo $Ec "\e[$M;$V""$6"
if [ "$Ad" == 1 ];then FixCl;Ad=;fi
}
dblChk() {
Ok=;Dc="$1";Fb="$2";Op="$3";V1="$4";V2="$5"
for k in `seq $V1 $V2`;
do
if [ "$Dc" == "$k" ];then export "$Op"="$k";else export "$Op"="$Fb";Ok=1;fi
done
}
I have a few more to update aswell, as i said, its constantly changing atm, & wont stabilize untill i can either get
This working, or give up, lol,
Side note, if anyone knows where i can get a tput binary, can u lemme know? Lol i coulda had this done in 30min xD
ok, on the way home on the bus, got 15 min, 10 min in, got a new echo prompt, & better explanation of my issue.
Heres my new function:
Code:
Sf_UI()####################################################
#
# Usage:
# Sf_UI <A> <B> <C> <D> "{TEXT}"
#
# Where <$> is:
# A - Color is line only [1|0]
# B - Remove newline from end of echo [1|0]
# C - Bold or underline? [0-none|1-bold|2-underline]
# D - Text color [0|1|2|3|4|5|6|7]
# E - background color [0|1|2|3|4|5|6|7]
###########################################################
{ Fx=;A=$1;B=$2;C=$3;D=$4;E=$5
case "$1" in
1)Fx=1;;
0)Fx=0;;
*)Fx=;;
esac;case "$2" in
1)Var="-ne";;
*)Var="-e";;
esac;case "$3" in
1)Bd=1;;
2)Bd=4;;
*)Bd=0;;
esac;
# Grab our colors..
FgC="$(case "$4" in
1)echo "31";;
2)echo "32";;
3)echo "33";;
4)echo "34";;
5)echo "35";;
6)echo "36";;
7)echo "37";;
*)echo "37";;
esac)"
BgC="$(case "$5" in
0)echo "40";;
1)echo "41";;
2)echo "42";;
3)echo "43";;
4)echo "44";;
5)echo "45";;
6)echo "46";;
7)echo "47";;
*)echo "47";;
esac)";case "$Fx" in
1)echo $Var "\e[$B;$(echo $FgC)m""\e[$(echo $BgC)m""$6""\e[0m";;
*)echo $Var "\e[$B;$(echo $FgC)m""\e[$(echo $BgC)m""$6";;
esac
}
Which when used in either 'Sf_UI 0 0 0 color1 color2' fills colorspace
'Sf_UI 1 0 0 color1 color2' outputs a newline with standard text afterwords, you get the idea..
In terminal,
Outputs results of pic1&2, pic3 is same prompt & keyboard down.

[Q]Refreshing Zooper from SL4A

I've got a Zooper module that I'm using to control the lights in my apartment. I'm calling SL4A scripts from Zooper that call an API running on a webserver to toggle the lights. I'm using wget with #SEX# in zooper to query the status of the lights off my server.
The problem I'm having is that I can't update the widget after the lights toggle. I did just start playing with it today, but I'm not seeing any means to do this from SL4A.
I'm using Python in SL4A.
Edit: I tried sending an intent to Zooper to set an unused variable from SL4A, though I don't think it's sending right.
Code:
activity = 'org.zooper.zw.action.TASKERVAR'
extras = {}
extras['org.zooper.zw.tasker.var.extra.STRING_VAR'] = '#Ta#'
extras['org.zooper.zw.tasker.var.extra.STRING_TEXT'] = 'a'
extras['org.zooper.zw.tasker.var.extra.INT_VERSION_CODE'] = '1'
packagename = 'org.zooper.zw'
classname = 'org.zooper.zw.tasker.var.extra.BUNDLE'
intent = droid.makeIntent(activity, None, None, extras, None, packagename, classname).result
droid.sendBroadcastIntent(intent)

Categories

Resources