Created
July 16, 2021 03:35
-
-
Save JuniorDjjr/1b8abb1706e409e16ccb0e92393935ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCRIPT_START | |
{ | |
LVAR_INT hFile iModel iModelLastNotExist iModelFirstNotExist i pBuffer bLastIdExists iItemsCount iNewLineEach bInsertCount iNotExistsCounter iTotalNotExists bInsertFinalTotal iStartID iFinalID | |
READ_INT_FROM_INI_FILE "CLEO\Generate Free IDs List.ini" "Settings" "StartID" (iStartID) | |
READ_INT_FROM_INI_FILE "CLEO\Generate Free IDs List.ini" "Settings" "FinalID" (iFinalID) | |
READ_INT_FROM_INI_FILE "CLEO\Generate Free IDs List.ini" "Settings" "NewLineEach" (iNewLineEach) | |
READ_INT_FROM_INI_FILE "CLEO\Generate Free IDs List.ini" "Settings" "InsertCount" (bInsertCount) | |
READ_INT_FROM_INI_FILE "CLEO\Generate Free IDs List.ini" "Settings" "InsertFinalTotal" (bInsertFinalTotal) | |
IF iFinalID < 1 | |
PRINT_STRING_NOW "~r~Fail to load 'Generate Free IDs List.ini'" 5000 | |
TERMINATE_THIS_CUSTOM_SCRIPT | |
ENDIF | |
WHILE TRUE | |
WAIT 0 | |
IF TEST_CHEAT GENEFREE | |
OPEN_FILE "Free IDs List.txt" 0x7477 hFile | |
GET_LABEL_POINTER Buffer pBuffer | |
iModel = iStartID | |
bLastIdExists = TRUE | |
iNotExistsCounter = 0 | |
iTotalNotExists = 0 | |
WHILE iModel <= iFinalID | |
IF NOT IS_MODEL_AVAILABLE iModel | |
IF bLastIdExists = TRUE | |
iModelFirstNotExist = iModel | |
bLastIdExists = FALSE | |
ENDIF | |
iModelLastNotExist = iModel | |
++iNotExistsCounter | |
++iTotalNotExists | |
ELSE | |
IF bLastIdExists = FALSE | |
IF iModelLastNotExist = iModelFirstNotExist | |
STRING_FORMAT pBuffer "%i, " (iModelFirstNotExist) | |
ELSE | |
IF bInsertCount = TRUE | |
STRING_FORMAT pBuffer "%i-%i(%i), " (iModelFirstNotExist iModelLastNotExist iNotExistsCounter) | |
ELSE | |
STRING_FORMAT pBuffer "%i-%i, " (iModelFirstNotExist iModelLastNotExist) | |
ENDIF | |
ENDIF | |
WRITE_STRING_TO_FILE hFile $pBuffer | |
IF iNewLineEach > 0 | |
++iItemsCount | |
IF iItemsCount >= iNewLineEach | |
WRITE_MEMORY pBuffer 2 0x000A FALSE | |
WRITE_STRING_TO_FILE hFile $pBuffer | |
iItemsCount = 0 | |
ENDIF | |
ENDIF | |
bLastIdExists = TRUE | |
iNotExistsCounter = 0 | |
ENDIF | |
ENDIF | |
++iModel | |
ENDWHILE | |
IF bInsertFinalTotal = TRUE | |
WRITE_MEMORY pBuffer 2 0x000A FALSE | |
WRITE_STRING_TO_FILE hFile $pBuffer | |
STRING_FORMAT pBuffer "Total Free IDs: %i " (iTotalNotExists) | |
WRITE_STRING_TO_FILE hFile $pBuffer | |
PRINT_FORMATTED_NOW "'Free IDs List.txt' generated! %i free ids." 3000 iTotalNotExists | |
ELSE | |
PRINT_STRING_NOW "'Free IDs List.txt' generated!" 3000 | |
ENDIF | |
ENDIF | |
ENDWHILE | |
} | |
SCRIPT_END | |
Buffer: | |
DUMP | |
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | |
ENDDUMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment