Jump to content

Invicore

Active Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Invicore

  1. ConsoleWrite("started: " & @CRLF) $locxal = 150 For $i = 0 to $locxal Progress($i, $locxal) Sleep(50) Next Func Progress($now, $all) Local $Progress = Int($now / ($all / 50)) $part1 = _StringRepeat(Chr(219), $Progress) $part2 = _StringRepeat(Chr(177), 50 - $Progress) ConsoleWrite(@CR & "processing files: " & $part1 & $part2 & " " & (($Progress <> 50) ? $Progress*2 & "%" : "DONE!")) EndFunc this is what I ended up with, thanks to @Zedna im not sure make it a function is good or not (i need it many times so I think this way its better)
  2. thank you looks like this is exact thing I was looking to
  3. its not a good way to do it, because its only print text in new line I want a way to create a progress bar and change it in one line for example in c++ I can print a line, and after that go few character back with \r and rewrite it
  4. Hi, I want to know its possible to create a progressbar for a for loop inside of CUI without using anything like ProgressOn and etc? I mean I want it to be completely in CUI interface and not use any GUI element in it thanks
  5. @TheXman yes because I need to use lzo1c_1_compress() (looks like here is my problem... although lzo have lzo1c_1_compress() too but I don't know why its make my program crash) the C# snippet save the compressed buffer in dst byte[] dst = new byte[src.Length + src.Length / 64 + 16 + 3 + 4]; I'm also doing the same thing, I'm passing the pointer of compressed buffer to the dllcall Local $OutputLen = $inputSize + $inputSize / 64 + 16 + 3 + 4 Local $tCom = DllStructCreate("BYTE[" & $OutputLen & "]") also for this function I don't need the return value from function itself at all yes you right you and RTFC right about that too right again this time Im passing a ptr of uint to function in my first code autoit will exit when it comes too dllcall, so I cant check @error so at the end I changed my code Func _lzo1cCom($handle, $buffer) Local $inputSize = BinaryLen($buffer) Local $_data = DllStructCreate("BYTE[" & $inputSize & "]") DllStructSetData($_data, 1, $buffer) Local $OutputLen = $inputSize + $inputSize / 64 + 16 + 3 + 4 Local $tCom = DllStructCreate("BYTE[" & $OutputLen & "]") Local $compressedSize = DllStructCreate("UINT") Local $_workMemory = DllStructCreate("BYTE[" & 16384 * 4 & "]") DllCall($handle, "INT:cdecl", "lzo1x_1_compress", _ ;~ maybe add other lzo type here later "ptr", DllStructGetPtr($_data), _ ;~ src data that I want to compress "uint", $inputSize, _ ;~ size of src data "ptr", DllStructGetPtr($tCom), _ ;~ buffer for compressed data "ptr", DllStructGetPtr($compressedSize), _ ;~ compressed file size "ptr", DllStructGetPtr($_workMemory)) ;~ working memory If @error Then Return _ErrorCheck(@error) EndIf EndFunc now its working without any problem... but still I cant use lzo1c_1_compress() (its give me same error code as past even with new changes) maybe there is some problem with dll itself
  6. I just find out LZO depends on the VC++ Redistributable library msvcr100.dll Im not sure if problem coming from this or not
  7. sorry but I cant understand what you mean with I don't see a work memory ptr being parsed in your AutoIt call there is 2 ptr in my dllcall, one is the pointer to input data that I want to compress and other is pointer that compressed data store in
  8. I tested that too, but result was the same AutoIt3.exe ended.rc:-1073741819
  9. yes my dll is 64Bit I test if Im running Scite in 64bit mode with MsgBox(4096, '64bit.', @AutoItX64) and yes it was running in 64bit mode
  10. Hi, I'm trying to use dllcall on lzo dll for compress files inside of my program But I have not succeeded yet LZO decompress work without any problem, but when I try to compress a file autoit give me this error every time AutoIt3.exe ended.rc:-1073741819 I know I'm calling function right (I hope), but I don't know why its not working here is my code Func _lzo1cCom($handle, $buffer) Local $inputSize = BinaryLen($buffer) Local $_data = DllStructCreate("BYTE[" & $inputSize & "]") DllStructSetData($_data, 1, $buffer) Local $OutputLen = $inputSize + $inputSize / 64 + 16 + 3 + 4 Local $tCom = DllStructCreate("BYTE[" & $OutputLen & "]") Local $compressedSize = 0 $compressedBuffer = DllCall($handle, "INT", "lzo1c_1_compress", _ "ptr", DllStructGetPtr($_data), _ ;~ src data that I want to compress "uint", $inputSize, _ ;~ size of src data "ptr", DllStructGetPtr($tCom), _ ;~ buffer for compressed data "int*", $compressedSize) ;~ compressed file size EndFunc here is c# code that working without any problem private const string LzoDll64Bit = @"lib64\lzo2_64.dll"; [DllImport(LzoDll64Bit)] private static extern int lzo1x_1_compress(byte[] src, int src_len, byte[] dst, ref int dst_len, byte[] wrkmem); private byte[] _workMemory = new byte[16384L * 4]; public byte[] Compress(byte[] src) { byte[] dst = new byte[src.Length + src.Length / 64 + 16 + 3 + 4]; int outlen = 0; lzo1x_1_compress(src, src.Length, dst, ref outlen, _workMemory); byte[] ret = new byte[outlen + 4]; Array.Copy(dst, 0, ret, 0, outlen); byte[] outlenarr = BitConverter.GetBytes(src.Length); Array.Copy(outlenarr, 0, ret, outlen, 4); return ret; } my code isn't competed yet (because of this error I'm not able to continue) I dont know what Im doing wrong thanks for help
  11. its just for showing my problem, in full code converted string save into a txt file (utf8-bom) thank you, I understand, look like my only option is to only convert it as ascii, or maybe its possible to find this kind of character when using BinaryToString? can you please tell me how many character are looks like this (I mean ascii code is different then utf8), maybe I can put some exception, like $S = "" $Str = "" Do $Str &= $S $S = FileRead($File, 1) If $S == 0xB4 then $S = 0xC2B4 Until $S = 0 btw I use above code to read null-terminated strings
  12. Hi I dont know why, but BinaryToString cant convert 0xB4 to string in utf8 mode I mean when I use this code to convert 0xB4 to utf8 it cant and just give me � ConsoleWrite(BinaryToString("0xB4",4) & @CRLF) but when I convert it to ascii, its convert it without any problem ConsoleWrite(BinaryToString("0xB4",1) & @CRLF) and give me " ´ " can anyone help me and tell what I'm doing wrong? thanks
  13. Im using this UDF MetroGUI (by BBs19) to create a simple gui for my program (and Also Im using onevent mode) as you maybe know this UDF support a Side menu (that open from L2R) I want to know its possible to add multi form into a single gui (window) and switch between them by clicking on button in Side menu?
  14. thank you, I search a little more and found this code In this post DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) GUICtrlSetStyle($Progress1, BitOr($GUI_SS_DEFAULT_PROGRESS, $PBS_SMOOTH)) GUICtrlSetColor(-1, 0xff0000) ; Red GUICtrlSetBkColor(-1, 0x000000) ; Black with it, its possible to change color of both background and bar itself
  15. Hi I want to change background and foreground color of Progress bar that I created with GUICtrlCreateProgress I found this piece of code in this forum, this code only change progressBar foreground color to blue $Progress1 = GUICtrlCreateProgress(25, 150, 350, 26) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Progress1), "wstr", 0, "wstr", 0) GUICtrlSetStyle($Progress1, BitOr($GUI_SS_DEFAULT_PROGRESS, $PBS_SMOOTH)) its possible to for example change background color to black and foreground to red thanks
  16. Hi, I want to know what is best way to read a file in binary mode (File size is 15MB at max) (I need to be able to move and read in file freely) Currently I tried FileRead with file handle, but its speed will slow down after some time (I think becuse it get further in file) also I tried to first read all file and then read Binary File byte by Byte with BinaryMid, But it was even more slower what can I do for achieve More speed?
  17. I do not think my words were wrong or vague, And I said only what was needed to say as I said before output of this program use for create Localization MOD For cyberPunk2077 game that all
  18. Not at all, This script has nothing to do with the game itself It can only extract and import local files, and script itself doesn't do any interaction with game (game process, game server and ...)
  19. OK In official CD Project site there is a section about mods and modding tool, here is what it say Link: https://cdprojektred.com/en/fan-content --> SECTION 3 > C.Mods as you can see it said it ok to create software that modifies or works with our games – e.g. changing the UI or adding new mechanics ( and its exactly what my tool gonna do)
  20. I mean there is nothing wrong with what I want to do There is no problem in any way, also there is nothing illegal about it I just wanted to know how can I speed up reading file in binary mode And look where we are now😂
  21. no its a modding tool for game files (my script are only for local files and dont automation anything about game), and its dont have anything to do with serever and etc also as you maybe know cd project team are fully ok with modding, they even share some modding tool for working with game files
  22. its a tool for extract string from localization file of cyberpunk and then import them back
  23. I uploaded file example here and here Binary.au3 Binary.rar
  24. Oh sorry, I get it now I need to read binary file to get some information from it script need those information to create new file with edited strings In other word I get data from original file, and use them to create new file - btw why I cant edit my posts?
  25. I had create two script 1. for extract string from a file 2. Import exported strings back first script work perfectly without any problem second one also work (its still need work), but slow as hell (imagine it take like 30 min for import all strings) I think its because the way I read binary file (I test it with TimerInit())
×
×
  • Create New...