Simple AI Examples from LaMothe’s Book

The book “Tricks of the Game Programming Gurus” by Andre LaMothe, copyright 1994, has an interesting chapter on artifical intelligence. However, all the samples in the chapter are done up in C. I’ve redone them into VB just for the heck of it.There are 5 simple programs illustrating chasing, evasion, patterned movement, random movement, and a program that… Read More »

Autotype Combo Box

This code was taken from O’Neil. It searches a combo box as the user types. O’Neil’s code was modified to use the SendMessage API to search the combo box, which made it much faster. This is very fast, even with thousands of records in the combo box. Thank you O’Neil for the idea, and the well commented code!… Read More »

Freeze a computer!

Ever want to freeze a computer? Well, here is some code to do it. It manipulates the API ‘setparent’ Original Author: Brian Molidor Side Effects Well, Duh. your computer will freeze Code Public Declare Function SetParent Lib “user32” Alias “SetParent” (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Longfunction freeze_computer(frm as form)call SetParent(frm.hwnd, frm.hwnd)end function

fGetSystemInfo

MS stipulates that OS Version Info must be obtained “correctly” in their Windows2000 Application Specifications. This is the way.It also uses api’s to get the OS path, get the Windows Temp Dir and to generate a unique temp file name.This is a .BAS file with a Sub Main() so it should compile easily. It generates the info, writes… Read More »

fWait

Shells an app, then waits for that app to close before it continues processing. Original Author: Brian Cidern Inputs None — Assumptions Pseudo code:Uses API to get the OS dir (for 95/98/NT4/2000 compatability) and appends result with Notepad.exe. Shells Notepad, returning process id. fWait gets the app hdl and issues a Do Events until the exit code of the… Read More »

HTTPSafeString

Makes a string http querystring friendly by replacing all non-alpha and non-numeric characters with the appropriate hex code. Helpful when using the wininet API.example: “(Find This)” becomes “%28Find%20This%29” Original Author: Greg Tyndall Inputs Text as String Returns String Code Public Function HTTPSafeString(Text As String) As String  Dim lCounter As Long  Dim sBuffer As String  Dim sReturn As String    sReturn = Text    For lCounter =… Read More »

Game Editor/Hex input-output

This is a big update from the other editor I posted here. This inlcudes: A status Bar, which holds the tooltiptext, A Tab Strip, and updated use of the CommonDialog Control. In this code, you will find out how to convert an ASCII (from a file) string to Hex and then Decimal. Then convert the decimal back to… Read More »

AutoComplete Combo

Access-like AutoComplete of a dropdown combobox or a simple combo box based on what’s already in the list. Simple code but can handle backspace and delete and will finish the ‘complete’ on Enter keystroke or lost focus. Could easily be converted to a user control. Original Author: Dan Redding – Blue Knot Software Attachments File Uploaded Size CODE_UPLOAD34122152000.zip 9/3/2020… Read More »