28.09.2012, 15:17
Quote:
|
I have written a code to help you
:Code:
@ECHO OFF
TITLE Compilation
:: Replace "Source.pwn" in the line below with the name of your Pawn script file.
SET FileName="Source.pwn"
(
ECHO.Option Explicit
ECHO.Dim Fso, Text, x
ECHO.ReDim Lines^(0^)
ECHO.Set Fso = CreateObject^("Scripting.FileSystemObject"^)
ECHO.Set Text = Fso.OpenTextFile^(%FileName%^)
ECHO.While Not Text.AtEndOfStream
ECHO. x = Text.Line - 1
ECHO. ReDim Preserve Lines^(x^)
ECHO. Lines^(x^) = Text.ReadLine^(^)
ECHO. If InStr^(Lines^(x^), "const BuildNumber = "^) = 1 Then
ECHO. Lines^(x^) = "const BuildNumber = " ^& CInt^(Mid^(Lines^(x^), 21, Len^(Lines^(x^)^) - 21^)^) + 1 ^& ";"
ECHO. End If
ECHO.Wend
ECHO.Text.Close^(^)
ECHO.Fso.DeleteFile^(%FileName%^)
ECHO.Set Text = Fso.CreateTextFile^(%FileName%^)
ECHO.For Each x In Lines
ECHO. Text.WriteLine^(x^)
ECHO.Next
ECHO.Text.Close^(^)
) > Modify.vbs
CSCRIPT //NOLOGO Modify.vbs
DEL Modify.vbs
PAWNCC %FileName%
PAUSE > NUL
Save this as a batch file and put it in the same folder of pawncc.exe .Then move your Pawn script file to that folder and add this to the top of it: pawn Code:
The value of that constant will be increased by 1 and the compilation will happen each time you run the batch file .I hope that I have helped . |
Here eat a virtual cookie :P
EDIT: Can you tell me what exactly you did.


:
.