[Windows Mobile Themes] Sir.John:
All sorts of tiny mortscripts...

A collection of rather simple, yet probably useful MortScripts, which can be used as well as serve as some sort of self-studying learning tutorial. Anyways: Enjoy :-)

############

get_icon_position-function.mscr

No script, but more of a function for fellow mortscripters to evaluate the screen and icon number in IPT where a given mortscript resides.

I wrote this in order to get rid of the neccessity to ask the user to specify "nScreen" and "nIcon". Instead this function, when called, crawls through icons.xml and evaluates the position of the screen and icon where a string you can specify resides.

Set the variable my_scriptname to a string of your choice. This can be a *.mscr file as well as an icon name. (ATTENTION: this is case-sensitive) Then a function called "get_icon_position" is called and stores the value of the screen in question in variable "screen_no" and "icon_no" respectively, which you can set to nScreen, nIcon or whatever.

For some reason this script works, but I have to admit, I had no expierience with LOOPS (with scripting at all for that matter) whatsoever, so I wasn't always completely sure of what I was doing here *LOL* It was quite a long way reading other scripts, of try and error. Hence, such curious value settings like screen_no = -2 for a start.

So if anyone of you scripting-wizards wants to take the time to cleanup my code: your very welcome to ;-)

As this all sounds a bit academic, I'll provide an example use:

Let's say, you have holdemdoggs battery script running and placed the icon on the second screen, as first icon of the second row on a screen with 3 icons per row (see bold no.):

1 2 3

4 5 6

7 8 9

-----

B B B

To set up the function, provide

my_scriptname = "battery.mscr"

as "search-string". When you run the function now it will set the following variable = values

screen_no = 1

icon_no = 3

As IPT starts counting screens and icons with "0" these numbers will correspond with the ones to set as n0Screen and n0Icon for the battery script running on IPT 1.2 an up

Just coming to think of a limitation, that this function still has.

ATTENTION: currently this will not work if the icon resides in the bottom bar.

############

sjBattery ver. 001

A rather different Battery approach, intended especially for old devices with weak batteries. This script is not run periodically but on demand only. Hence, it does not stay in memory and only costs energy and memory when executed.

If executed the script pops up a message for 3 seconds stating the battery left in percent.

As you only need to execute the script (no "chi-chi"), you can perfectly link to it from any icon based launcher using a static battery icon

############

sjMirror ver. 001

When I noticed that there are companies out there that actually CHARGE for an application they call shaving mirror, I decided to script it in case somebody wants / needs it.

sjMirror is a little mortscript that enables the front camera for a one time start of the camera application, and sets everything back to normal (aka backside camera) after use.

Hence, you have a tiny but somewhat neat one-click pocket/shaving mirror application, that does no lasting changes to the registry.

Requirements

well, obiviously a second/front camera on yoour device ;-)

How it works

-> the script sets your front camera as default,

-> starts the camera application and waits till it's loaded

-> sets your normal camera as default again, while camera app is still open

-> and exists

So you can use your front camera as long as you have the application open, but as soon as you close it and restsart it again it'll have your back camera re-enabled.

ver.001 should be the first, stable and last version of that script *lol*

############

sjReset version 0.1

A tiny script to reset your device. You can configure whether you want to be asked before restarting or whether your pocketpc soft-resets without any prior notice. Alter Variable "sure" (0/1) in the script to whatever you favour.

############

ENJOY!

John