Jump to content

Brain Pain Fixer


KJohn
 Share

Recommended Posts

You can get BrainPain here at:

http://www.autoitscript.com/forum/index.php?app=downloads&showfile=105

Run the following code from the same folder containing BrainPain.au3 and all the source files will be updated so that it works.

Many thanks to mrbond007 for the excellent game!

#NoTrayIcon
If Not FileExists ("BrainPain.au3") Then
    MsgBox(0,"BrainPain Fixer Error","Please place this file in the same folder as BrainPain.au3.")
EndIf

$find = FileFindFirstFile ("Games\*.au3")
While 1
    $file = FileFindNextFile($find)
    If @error Then ExitLoop
    
    FileMove ("Games\" &$file, "Games\" &$file &".tmp")
    $read = FileOpen ("Games\" &$file &".tmp",0)
    $write = FileOpen ("Games\" &$file,2)
    While 1
        $line = FileReadLine($read)
        If @error Then ExitLoop
        FileWriteLine($write,$line)
        If $line <> "#include <GUIConstants.au3>" Then ContinueLoop
        FileWriteLine ($write,"#include <WindowsConstants.au3>"&@CRLF&"#include <EditConstants.au3>"&@CRLF&"#include <StaticConstants.au3>")
    WEnd
    FileClose($read)
    FileClose($write)
    FileDelete("Games\" &$file &".tmp")
WEnd

$file = "BrainPain.au3"
FileMove ($file, $file &".tmp")
$read = FileOpen ($file &".tmp",0)
$write = FileOpen ($file,2)
While 1
    $line = FileReadLine($read)
    If @error Then ExitLoop
    FileWriteLine($write,$line)
    If $line <> "#include <GUIConstants.au3>" Then ContinueLoop
    FileWriteLine ($write,"#include <WindowsConstants.au3>"&@CRLF&"#include <EditConstants.au3>"&@CRLF&"#include <StaticConstants.au3>")
WEnd
FileClose($read)
FileClose($write)
FileDelete($file &".tmp")
MsgBox(0,"BrainPain Fixer","The BrainPain source code has been updated to work with the latest version of AutoIt as of 11th July 2009.")
MsgBox(0,"Shameless Plug","Get DiskMax and neoSearch at koshyjohn.com. Well you got free code didn't you? Reading one line won't hurt.")
Link to comment
Share on other sites

Actually, if one of the mods just used this to update the code, rezip it and replace the file in the downloads section, people downloading that program will not get frustrated (there are 126 files to update!).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...