Warning Posted January 5, 2011 Posted January 5, 2011 Hi, i wated to do an auto-config program for metin2. Yes, i readed the " Game Bots and Automation" Topic. IT IS NOT CHANGING NOTHING IN-GAME. IT ISN'T AUTOMATISE THE GAME. IT IS NOT HACK OR BOT. It's just a config creator. I think it isn't count bot/hack. So. I did the GUI and opened/closed the file at every change. But when I try to run the program I isn't do nothing. I press the button, it shows the Msgbox but the datas aren't changed. Why? expandcollapse popup#include <GUIConstantsEx.au3> msgbox(32, "m2 Auto-Config", "Metin2 Fast-Config" & @CRLF & "Ha a játékkal gond van a configolás után akkor kattints a !Bug! gombra!" & @CRLF & " " & @CRLF & "Készítette: [Unc3nZureD]™") $check = FileExists(@ScriptDir & "\metin2.cfg") $game = ProcessExists("metin2client.bin") If $game > 0 Then MsgBox(0,"M2 Fast-Config""Kérlek lépj ki a játékból!") exit 0 EndIf If $check = 0 Then Msgbox(0,"M2 Auto-Config", "Please copy me to the root folder of your m2!") exit 0 EndIf $GUI = GUICreate("M2 Config", 200, 265) $B1 = GUICtrlCreateButton("Őskori-PC",0,0,200,30) $B2 = GUICtrlCreateButton("Hétköznapi játékos",0,35,200,30) $B3 = GUICtrlCreateButton("FPS Huszár [Normal]",0,70,200,30) $B4 = GUICtrlCreateButton("FPS Huszár [Széles]",0,105,200,30) $B5 = GUICtrlCreateButton("Biztosági mentés",0,160,200,30) $B6 = GUICtrlCreateButton("Mentés visszállítása",0,195,200,30) $B7 = GUICtrlCreateButton("W-T-F -> !Bug!",0,230,200,30) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $B1 $m2 = FileOpen(@ScriptDir & "\metin2.cfg") FileWrite($m2, "WIDTH 640" & @CRLF & "HEIGHT 480" & @CRLF & "BPP 16" & @CRLF & "FREQUENCY 56" & @CRLF & "SOFTWARE_CURSOR 1" & @CRLF & "VISIBILITY 1" & @CRLF & "SOFTWARE_TILING 2" & @CRLF & "SHADOW_LEVEL 0" & @CRLF & "MUSIC_VOLUME 0" & @CRLF & "VOICE_VOLUME 0" & @CRLF & "GAMMA 1" & @CRLF & "WINDOWED 0" & @CRLF & "USE_DEFAULT_IME 0") FileClose($m2) msgbox(0,"M2 Fast-Config", "Az új beállításaid érvénybe léptek! Most már elindíthatod a játékot!") Case $B2 $m2 = FileOpen(@ScriptDir & "\metin2.cfg") FileWrite($m2, "WIDTH 1024" & @CRLF & "HEIGHT 768" & @CRLF & "BPP 32" & @CRLF & "FREQUENCY 72" & @CRLF & "SOFTWARE_CURSOR 0" & @CRLF & "VISIBILITY 2" & @CRLF & "SOFTWARE_TILING 2" & @CRLF & "SHADOW_LEVEL 1" & @CRLF & "MUSIC_VOLUME 3" & @CRLF & "VOICE_VOLUME 2" & @CRLF & "GAMMA 3" & @CRLF & "WINDOWED 0" & @CRLF & "USE_DEFAULT_IME 0") FileClose($m2) msgbox(0,"M2 Fast-Config", "Az új beállításaid érvénybe léptek! Most már elindíthatod a játékot!") Case $B3 $m2 = FileOpen(@ScriptDir & "\metin2.cfg") FileWrite($m2, "WIDTH 1280" & @CRLF & "HEIGHT 1024" & @CRLF & "BPP 32" & @CRLF & "FREQUENCY 75" & @CRLF & "SOFTWARE_CURSOR 0" & @CRLF & "VISIBILITY 3" & @CRLF & "SOFTWARE_TILING 1" & @CRLF & "SHADOW_LEVEL 2" & @CRLF & "MUSIC_VOLUME 5" & @CRLF & "VOICE_VOLUME 5" & @CRLF & "GAMMA 5" & @CRLF & "WINDOWED 0" & @CRLF & "USE_DEFAULT_IME 1") FileClose($m2) msgbox(0,"M2 Fast-Config", "Az új beállításaid érvénybe léptek! Most már elindíthatod a játékot!") Case $B4 $m2 = FileOpen(@ScriptDir & "\metin2.cfg") FileWrite($m2, "WIDTH 1360" & @CRLF & "HEIGHT 768" & @CRLF & "BPP 32" & @CRLF & "FREQUENCY 75" & @CRLF & "SOFTWARE_CURSOR 0" & @CRLF & "VISIBILITY 3" & @CRLF & "SOFTWARE_TILING 1" & @CRLF & "SHADOW_LEVEL 2" & @CRLF & "MUSIC_VOLUME 5" & @CRLF & "VOICE_VOLUME 5" & @CRLF & "GAMMA 5" & @CRLF & "WINDOWED 0" & @CRLF & "USE_DEFAULT_IME 1") FileClose($m2) msgbox(0,"M2 Fast-Config", "Az új beállításaid érvénybe léptek! Most már elindíthatod a játékot!") Case $B5 FileCopy(@ScriptDir & "\metin2.cfg", @ScriptDir & "\Backup.dat") msgbox(0,"M2 Fast-Config", "Biztonsági mentés elkészítve!") Case $B6 $bup = FileExists(@ScriptDir & "\Backup.dat") If $bup = 0 Then Msgbox(64, "M2 Auto-Config", "Még nem készítettél biztonsági mentést!") EndIf If $bup = 1 Then FileDelete(@ScriptDir & "\metin2.cfg") FileCopy(@ScriptDir & "\Backup.dat", @ScriptDir & "\metin2.cfg") msgbox(0,"M2 Fast-Config", "Biztonsági mentés betöltve!") EndIf Case $B7 $m2 = FileOpen(@ScriptDir & "\metin2.cfg") FileWriteLine($m2, 17) FileWrite($m2, "SOFTWARE_TILING 1") Msgbox(64, "M2 Fast-Config", "A bugot megpróbáltam kijavítani. Most próbáld újraindítani a játékot!") EndSwitch WEnd Can any1 Find any error in the source? Any idea? Thanks every help!
Mat Posted January 5, 2011 Posted January 5, 2011 You have a syntax error on line 9:MsgBox(0,"M2 Fast-Config""Kérlek lépj ki a játékból!") should be MsgBox(0,"M2 Fast-Config", "Kérlek lépj ki a játékból!")FileOpen opens in READ mode by default, and you are trying to WRITE to it. Set the second parameter to 1 or 2 depending on what you are trying to do. Alternatively just use the file name (You are only doing a couple of operations before closing so the difference in negligible.You are not closing the opened file in the last case statement.Unfortunately I can't check much more than that, as I don't have the game. You seem to be mixing languages up though bit of english here and there, and a the rest in Hungarian... AutoIt Project Listing
Warning Posted January 5, 2011 Author Posted January 5, 2011 (edited) Ok, i will try to fix the problems. I hope it will work Edit: I fixed the read mode to Write! Works, thanks And about the lang. : LoL I forgot the laguage Usally i very usally use english laguage so sometimes i'm mixing the languages Originally I'm hungarian. Edited January 5, 2011 by Warning
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now