Welcome to DS Homebrew!

Hope you enjoy your visit............

Jazzier Suite 1.2

Posed on 2009-09-05 23:26:02

Author: Gareth Bennett

Jazzier Pitch 1.2 is almost ready for release; hopefully 2 weeks will be the release date.

Comments on Jazzier Suite 1.2 (6)

Access Power Management and Scheduler VBScript

Posed on 2009-08-11 00:14:00

Author: Gareth Bennett

I like listening to music/pod casts when I am going to sleep. However, I don't like leaving my computer on all night.

I needed a script to do the following:-

  • Switch my Monitor off
  • Shutdown the Computer after (x) amount of time

Here is the Complete Code, all you need to change is (Hour) and (Min):-

Option Explicit

Dim objShell, Hour, Min, strPowerManagement, strShutdown

Hour = 0
Min  = 0

strPowerManagement = CStr(Hour) & ":" & CStr(Min)
strShutDown = CStr(Hour) & ":" & CStr(Min + 1)

Set ObjShell = CreateObject("WScript.Shell")
objShell.run "powercfg.exe /X 1 /N /monitor-timeout-ac 1"

Rem Sheduled Tasks
objShell.run "AT " & strPowerManagement & " powercfg.exe /X 1 /N /monitor-timeout-ac 0"
objShell.run "AT " & strPowerManagement & " powercfg.exe /X 1 /N /disk-timeout-ac 0"
objShell.run "AT " & strPOwerManagement & " powercfg.exe /X 1 /N /standby-timeout-ac 0"
objShell.run "AT " & strShutdown & " shutdown.exe -s"

Set ObjShell = nothing

Here is what the full script does in brief:-

  • Chanages the Mointor Setting in Power-Management to Switches off the monitor in 1 minute.
  • Schedules the commands to set Power-Management back to setting I like.
  • Schedules the System to Shutdown, 1 minutes after the Power-Management schedule have been initiated.

Comments on Access Power Management and Scheduler VBScript (0)

Around The Clock

Posed on 2009-08-06 12:41:04

Author: Gareth Bennett

Here is my new hombrew game for the Nintendo DS. The game is called Around The Clock and is based on the classic darts pub game of the same title.

You must work your way around the board starting for 1 through to 20; then you must hit the outer bull, then the bull to finish.

There are three levels of difficulty:-

  • Easy, Singles (all singles from 1 to 20)
  • Medium, Doubles (all doubles from 1 to 20)
  • Hard, Trebles (all trebles from 1 to 20)

The dart will drop-out if you hit the metal on the dartboard, or the tip of the dart hits another dart.

[CONTROLS]

  • Cursors = To move dart
  • B = Throw Dart
  • X = Toggle music on/off

Watch the powerbar when throwing the dart as this will chage the trajectory of the dart.

You can submit your high scores online, the leaderboard is hosted on the homepage of http://www.dshomebrew.co.uk

download link

Download - Around The Clock

Comments on Around The Clock (0)

Get MP3 Duration

Posed on 2009-07-27 00:09:38

Author: Gareth Bennett

I am very glad to get this script working as I have been working on it all night. The script will read a directory full of MP3 files; and then output the filename and duration of each MP3 file into a CSV file.

The only thing you have to change in the script is the Path and File names. You obviously don't want your output file in the same folder as your MP3 files; as it will not be able to read the duration property of the CVS file.

Option Explicit

Const OPENFORREADING = 1
Const OPENFORWRITING = 2
Const OPENFORAPPENDING = 8

Const DURATION = 21

Public Sub CreateMp3TrackList()
	Dim objFSO, objFile, objTxtStream, objFsoFolder, objFiles
	Dim objShell, objShellFolder, objFolderItem
	Dim strFolder, strOutputFile, strTime, strName, strFileInfo, strGroup
		
	strFolder = "D:\MP3Files"
	strOutputFile = "D:\mp3list.csv"
		
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set objShell = CreateObject("Shell.Application")
	
	Set objShellFolder = objShell.Namespace(strFolder)
	Set objFsoFolder = objFSO.GetFolder(strFolder)

	Set objFiles  = objFsoFolder.Files
	Set objFsoFolder = nothing
	
	Set objTxtStream = objFSO.CreateTextFile(strOutputFile, True)
	
	For Each objFile in objFiles
		Set objFolderItem = objShellFolder.ParseName(objFile.Name)
  		strFileInfo = objShellFolder.GetDetailsOf(objFolderItem, DURATION)
		strName = objFile.Name
		strGroup = strName & "," & strFileInfo
		objTxtStream.WriteLine strGroup
		Set objFolderItem = nothing
	Next
		
	objTxtStream.Close
	
	Set objFile = Nothing
	Set objFiles = Nothing
	Set objTxtStream = Nothing
	Set objShellFolder = Nothing
	Set objShell = Nothing
	Set objFSO = Nothing
	
	MsgBox "Completed"
End Sub

CreateMp3TrackList()

Comments on Get MP3 Duration (0)

Convert CSV to XLS

Posed on 2009-07-25 19:41:15

Author: Gareth Bennett

I have recently been working on converting a CSV file to an XLS spreadsheet using a script rather than opening the CSV file in Excel, then re-saving as an XSL file.

To solve this task, I used the Microsoft Excel COM Object. Below are the properties of the method (Open) used to open a workbook:-

expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)

I am interested in the properties FileName, Format and Delimiter.

[Format] takes on 6 constant values:-

  1. Tabs
  2. Commas
  3. Spaces
  4. Semicolons
  5. Nothing
  6. Custom character

Here is the line of code to import a CSV file:-

objXL.WorkBooks.Open(FileName & ".csv",,,2)

I do not like using Comma's as delimiters as they tend to crop up in many forms of data. Instead by setting the format to Custom Character (6) and using a PIPE (|) as the delimiter there is less chance that columns of data won't fall out of sequence.

Here is the line of code to import a delimited file using the PIPE (|) as the delimiter:-

objXL.WorkBooks.Open(FileName & ".txt",,,6,,,,,"|")

Here is the complete VBScript to convert a CSV file to an XLS spreadsheet.


Option Explicit

Const FileName = "YourPathYourFileName"

'***********************************************************

DIM objXL, objWB

Set objXL = WScript.CreateObject ("Excel.Application")
Set objWB = objXL.WorkBooks.Open(FileName & ".csv",,,2)

objXL.DisplayAlerts = False

objWB.SaveAs FileName & ".xls"

objXL.Quit()

Set objWB = Nothing
Set objXL = Nothing

Comments on Convert CSV to XLS (0)

5 Dice

Posed on 2009-07-25 02:29:10

Author: Gareth Bennett

Here is my first game for the Nintendo DS. The game is called 5 Dice and is very similar to the game Yahtzee (only a couple of changes on the scoring).

Nintendo DS 5 Dice Screen Shot

The aim of the game is to get as many points as possible by rolling combinations of five dice. You can roll up to three times, possibly choosing to just roll some of the dice each time. After you roll, you choose which slot to score based on the combination rolled. Different combinations of dice earn points differently. You have the option to hold the dice on your 2nd and 3rd throw. If you don't meet the requirements for the combination you choose, you still have to score it on the score card.

The game ends when you have filled in all the slots on the score card.

  • Item, Scoring
  • Ones, Number of 1's occurring
  • Twos, Number of 2's occurring
  • Threes, Number of 3's occurring
  • Fours, Number of 4's occurring
  • Fives, Number of 5's occurring
  • Sixes, Number of 6's occurring
  • 3 of a kind, 3 dice the same
  • 4 of a kind, 4 dice the same
  • Full House, 2 of the same and 3 of the same, e.g. 11222, scores 26
  • Small Straight, 4 dice in sequence e.g. 1234, 3456, scores 28
  • Long Straight, 5 dice in sequence either, 12345 or 23456, scores 38
  • 5 Dice, 5 fives required, scores 42
  • All Dice, Adds up all dice

5 Dice also has Wifi enabled, so you are able to submit your highscores onto the leaderboard which is hosted on the homepage of this site.

Download Here

Comments on 5 Dice (3)