Jump to content

kokoilie

Active Members
  • Posts

    20
  • Joined

  • Last visited

Recent Profile Visitors

237 profile views

kokoilie's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Obligatory: I'm not a professional at this, just hobbyist. If you can get the index of what you selected with _GUICtrlComboBox_GetCurSel($idComboBox) and if you have some identification other than name (preferably a number) you can compare that number to the other one and load the correct thumbnail. I'm currently writing a program that also lists people's names (to keep track of which characters belong to which player if I know their name because i suck at remembering such things) and I use SQLite database which requires to use an ID column I also use the same ID for the name of the thumbnail so I can just get it with GUICtrlSetImage($cthumbnail, "thumbnails/"&$return[8]&".bmp") where the array variable $return[8] contains the ID number in this example. Hope this helps.
  2. seems to me you forgot to #include <WindowsConstants.au3> isn't there a way to skip most of the OSI stages and send the raw data from webcam to reciever program that decodes it and is considered as virtual hardware?
  3. Seeing how many answers I got, I decided to try a different approach on the issue. Got happy with the "low tech" fix by making the checkbox 1st and using the arrow keys to navigate to and in the combo list. Here is how it looks now: #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Crypt.au3> Global $dir, $exe ;system Global $cstart, $cmanage, $clist, $cexe, $crealm, $ccheck, $cserv ;main gui Global $cadd1, $cadd2, $cremove1, $cremove2, $clist1, $clist2 ;acc manage gui Global $count, $counts, $i, $list, $acc, $realm, $serv, $f, $key, $acci, $passi, $pass, $bad ;internal $key = InputBox ("Decyption key", "Please input a incryption/decryption key.", "", "*M", 285, 180) If $key = "" Then Exit init() make_main_window () Func make_main_window () GUICreate ("Autologin",285 ,150) $ccheck = GUICtrlCreateCheckbox ("", 255, 35, 20, 20) $clist = GUICtrlCreateCombo ("", 10, 10, 265, 20) $cstart = GUICtrlCreateButton ("Start", 10, 35, 50, 20, 0x0001) $cmanage = GUICtrlCreateButton ("Manage Accs", 65, 35, 80, 20) $cexe = GUICtrlCreateButton ($exe, 150, 35, 100, 20) GUICtrlCreateLabel ("Realmlist content", 10, 65, 100, 20) $crealm = GUICtrlCreateInput ($realm, 10, 80, 265, 20) $cserv = GUICtrlCreateCombo ("", 10, 110, 265, 20) ;$ccheck = GUICtrlCreateCheckbox ("", 255, 35, 20, 20) main_params () GUISetState(@SW_SHOW) loop_main_window () EndFunc Func loop_main_window () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $cstart $read = GUICtrlRead ($cserv) ;If $read <> $realm Then ; If $realm = "Realmlist not found" Then start () ; $f = FileOpen ("data\engb\realmlist.wtf", 2) ; FileWrite ($f, "set realmlist "&$read) ; FileClose ($f) ;EndIf start () Case $cexe manageexe () Case $cmanage GUIDelete() make_acc_window () loop_acc_window () EndSwitch WEnd EndFunc Func make_acc_window () GUICreate ("Accounts and servers",285 ,150) $cadd1 = GUICtrlCreateButton ("Add", 10, 10, 50, 20) $cadd2 = GUICtrlCreateButton ("Add", 145, 10, 50, 20) $cremove1 = GUICtrlCreateButton ("Remove", 65, 10, 50, 20) $cremove2 = GUICtrlCreateButton ("Remove", 200, 10, 50, 20) $clist1 = GUICtrlCreateList ("", 10, 35, 130, 105) $clist2 = GUICtrlCreateList ("", 145, 35, 130, 105) acc_params () GUISetState(@SW_SHOW) EndFunc Func loop_acc_window () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE GUIDelete() init () make_main_window () Case $cadd1 $count += 1 $read = InputBox ("Add account", "Please input the account name", "", " M") IniWrite ("autologin.ini", "accs", $count, $read) GUICtrlSetData ($clist1, $read) $read = InputBox ("Add account", "Please input your password", "", "*M") $read = _Crypt_EncryptData($read, $key, $CALG_DES) IniWrite ("autologin.ini", "pass", $count, $read) IniWrite ("autologin.ini", "main", "c", $count) init () Case $cadd2 $counts += 1 $read = InputBox ("Add server", "Please input the realmlist address", "", " M") IniWrite ("autologin.ini", "servers", $counts, $read) IniWrite ("autologin.ini", "main", "s", $counts) GUICtrlSetData ($clist2, $read) init () Case $cremove1 $read = GUICtrlRead ($clist1) If $read = "" Then ContinueLoop For $i = 0 To ($count - 1) If $read = $acc[$i] Then ExitLoop EndIf Next $i += 1 IniDelete ("autologin.ini", "accs", $i) IniDelete ("autologin.ini", "pass", $i) $count -= 1 IniWrite ("autologin.ini", "main", "c", $count) GUICtrlSetData($clist1, "") If $count <> 0 Then For $i = 1 To $count GUICtrlSetData ($clist1, $acc[$i-1]) Next EndIf Case $cremove2 $read = GUICtrlRead ($clist2) If $read = "" Then ContinueLoop For $i = 0 To ($counts - 1) If $read = $serv[$i] Then ExitLoop EndIf Next $i += 1 IniDelete ("autologin.ini", "servers", $i) $counts -= 1 IniWrite ("autologin.ini", "main", "s", $counts) GUICtrlSetData($clist2, "") If $count <> 0 Then For $i = 1 To $counts GUICtrlSetData ($clist2, $serv[$i-1]) Next EndIf EndSwitch WEnd EndFunc Func acc_params () If $count <> 0 Then For $i = 1 To $count GUICtrlSetData ($clist1, $acc[$i-1]) Next EndIf If $counts <> 0 Then For $i = 1 To $counts GUICtrlSetData ($clist2, $serv[$i-1]) Next EndIf EndFunc Func start () HotKeySet ("{ESC}", "kill") HotKeySet ("{PAUSE}", "sent") $read = GUICtrlRead ($clist) If GUICtrlRead ($ccheck) = $GUI_CHECKED Then Run ($dir & $exe) For $i = 0 To ($count - 1) If $read = $acc[$i] Then ExitLoop EndIf Next $acci = $acc[$i] $passi = $pass[$i] While 1 Sleep (100) ;ToolTip ("Welcome " & $read & @CRLF & "Press {Pause} to login.") ;ToolTip ("Welcome " & $read & "(" & $i & ")" & @CRLF & "Press {Pause} to login.") ;ToolTip ("Welcome " & $acci & @CRLF & "Press {Pause} to login.") ToolTip ("Welcome " & $acci & " " & $passi & @CRLF & "Press {Pause} to login.") WEnd EndFunc Func manageexe () $file = FileOpenDialog ("Find WoW.exe", $dir, "wow.exe (*.exe)",3,"wow.exe") $array = StringSplit ($file, "\") $exe = $array[$array[0]] $file = StringTrimRight ($file, StringLen ($exe)) If $dir <> $file Then $dir = $file IniWrite ("autologin.ini", "main", "path", $dir) EndIf GUICtrlSetData ($cexe, $exe) IniWrite ("autologin.ini", "main", "exe", $exe) GUICtrlSetState ($cstart, $GUI_ENABLE) GUICtrlSetTip ($cexe, "") main_params () EndFunc Func init () If FileExists ("autologin.ini") = 0 Then FileOpen ("autologin.ini", 1) FileClose (1) FileSetAttrib("autologin.ini", "+H") EndIf $count = IniRead ("autologin.ini", "main", "c", 0) If $count > 0 Then Global $acc[$count],$cryp[$count],$pass[$count],$bad[$count] For $i = 1 To $count $acc[$i-1] = IniRead ("autologin.ini", "accs", $i, "") $cryp[$i-1] = IniRead ("autologin.ini", "pass", $i, "") Next For $i = 1 To $count $pass[$i-1] = BinaryToString (_Crypt_DecryptData ($cryp[$i-1], $key, $CALG_DES)) If $pass[$i-1] = "ÿÿÿÿ" Then $bad[$i-1] = True Else $bad[$i-1] = False EndIf Next EndIf $counts = IniRead ("autologin.ini", "main", "s", 0) If $counts > 0 Then Global $serv[$counts] For $i = 1 To $counts $serv[$i-1] = IniRead ("autologin.ini", "servers", $i, "") Next EndIf $dir = IniRead ("autologin.ini", "main", "path", @ScriptDir) $exe = IniRead ("autologin.ini", "main", "exe", "\wow.exe") $realm = FileRead ("data\engb\realmlist.wtf") If @error Then $realm = "Realmlist not found" EndIf EndFunc Func main_params () If FileExists ($exe) = 0 Then GUICtrlSetState ($ccheck, $GUI_UNCHECKED) GUICtrlSetState ($ccheck, $GUI_DISABLE) GUICtrlSetTip ($cexe, "Exe is missing, please click here to find new one.") EndIf If $count = 0 Then GUICtrlSetState ($cstart, $GUI_DISABLE) GUICtrlSetState ($clist, $GUI_DISABLE) ToolTip ("There are no accounts, click here to add.", 800, 420, "",1, 1) Else For $i = 1 To $count If $bad[$i-1] = False Then $list = $list & "|" & $acc[$i-1] Else $list = $list & "|" & $acc[$i-1] & "!" EndIf Next GUICtrlSetData($clist, $list);, $acc[0]) EndIf $list = "" If $counts = 0 Then GUICtrlSetState ($cserv, $GUI_DISABLE) Else For $i = 1 To $counts $list = $list & "|" & $serv[$i-1] Next GUICtrlSetData($cserv, $list, $serv[0]) EndIf EndFunc Func sent () Send ($acci & "{TAB}" & $passi & "{ENTER}") ToolTip ("") Exit EndFunc Func kill () ToolTip ("") Exit EndFunc the commented part near the top of the main loop (rows 35 to 40) is the next thing i should work on but it's a different topic. This script was meant to be for personal use but feel free to use it, might help you with games where you can login with more than 1 account and you don't/can't remember all the passwords.
  4. ok here it is #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Crypt.au3> Global $dir, $exe ;system Global $cstart, $cmanage, $clist, $cexe, $crealm, $ccheck, $cserv ;main gui Global $cadd1, $cadd2, $cremove1, $cremove2, $clist1, $clist2 ;acc manage gui Global $count, $counts, $i, $list, $acc, $realm, $serv, $f, $key, $acci, $passi, $bad ;internal $key = InputBox ("Decyption key", "Please input a incryption/decryption key.", "", "*M", 285, 180) If $key = "" Then Exit init() make_main_window () Func make_main_window () GUICreate ("Autologin",285 ,150) $clist = GUICtrlCreateCombo ("", 10, 10, 265, 20) $cstart = GUICtrlCreateButton ("Start", 10, 35, 50, 20, 0x0001) $cmanage = GUICtrlCreateButton ("Manage Accs", 65, 35, 80, 20) $cexe = GUICtrlCreateButton ($exe, 150, 35, 100, 20) GUICtrlCreateLabel ("Realmlist content", 10, 65, 100, 20) $crealm = GUICtrlCreateInput ($realm, 10, 80, 265, 20) $cserv = GUICtrlCreateCombo ("", 10, 110, 265, 20) $ccheck = GUICtrlCreateCheckbox ("", 255, 35, 20, 20) main_params () GUISetState(@SW_SHOW) loop_main_window () EndFunc Func loop_main_window () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $cstart $read = GUICtrlRead ($cserv) ;If $read <> $realm Then ; If $realm = "Realmlist not found" Then start () ; $f = FileOpen ("data\engb\realmlist.wtf", 2) ; FileWrite ($f, "set realmlist "&$read) ; FileClose ($f) ;EndIf start () Case $cexe manageexe () Case $cmanage GUIDelete() make_acc_window () loop_acc_window () EndSwitch WEnd EndFunc Func make_acc_window () GUICreate ("Accounts and servers",285 ,150) $cadd1 = GUICtrlCreateButton ("Add", 10, 10, 50, 20) $cadd2 = GUICtrlCreateButton ("Add", 145, 10, 50, 20) $cremove1 = GUICtrlCreateButton ("Remove", 65, 10, 50, 20) $cremove2 = GUICtrlCreateButton ("Remove", 200, 10, 50, 20) $clist1 = GUICtrlCreateList ("", 10, 35, 130, 105) $clist2 = GUICtrlCreateList ("", 145, 35, 130, 105) acc_params () GUISetState(@SW_SHOW) EndFunc Func loop_acc_window () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE GUIDelete() init () make_main_window () Case $cadd1 $count += 1 $read = InputBox ("Add account", "Please input the account name", "", " M") IniWrite ("autologin.ini", "accs", $count, $read) GUICtrlSetData ($clist1, $read) $read = InputBox ("Add account", "Please input your password", "", "*M") $read = _Crypt_EncryptData($read, $key, $CALG_DES) IniWrite ("autologin.ini", "pass", $count, $read) IniWrite ("autologin.ini", "main", "c", $count) init () Case $cadd2 $counts += 1 $read = InputBox ("Add server", "Please input the realmlist address", "", " M") IniWrite ("autologin.ini", "servers", $counts, $read) IniWrite ("autologin.ini", "main", "s", $counts) GUICtrlSetData ($clist2, $read) init () Case $cremove1 $read = GUICtrlRead ($clist1) If $read = "" Then ContinueLoop For $i = 0 To ($count - 1) If $read = $acc[$i] Then ExitLoop EndIf Next $i += 1 IniDelete ("autologin.ini", "accs", $i) IniDelete ("autologin.ini", "pass", $i) $count -= 1 IniWrite ("autologin.ini", "main", "c", $count) GUICtrlSetData($clist1, "") If $count <> 0 Then For $i = 1 To $count GUICtrlSetData ($clist1, $acc[$i-1]) Next EndIf Case $cremove2 $read = GUICtrlRead ($clist2) If $read = "" Then ContinueLoop For $i = 0 To ($counts - 1) If $read = $serv[$i] Then ExitLoop EndIf Next $i += 1 IniDelete ("autologin.ini", "servers", $i) $counts -= 1 IniWrite ("autologin.ini", "main", "s", $counts) GUICtrlSetData($clist2, "") If $count <> 0 Then For $i = 1 To $counts GUICtrlSetData ($clist2, $serv[$i-1]) Next EndIf EndSwitch WEnd EndFunc Func acc_params () If $count <> 0 Then For $i = 1 To $count GUICtrlSetData ($clist1, $acc[$i-1]) Next EndIf If $counts <> 0 Then For $i = 1 To $counts GUICtrlSetData ($clist2, $serv[$i-1]) Next EndIf EndFunc Func start () HotKeySet ("{ESC}", "kill") HotKeySet ("{PAUSE}", "sent") $read = GUICtrlRead ($clist) If GUICtrlRead ($ccheck) = $GUI_CHECKED Then Run ($dir & $exe) For $i = 0 To ($count - 1) If $read = $acc[$i] Then ExitLoop EndIf Next $acci = $acc[$i] $passi = $pass[$i] While 1 Sleep (100) ;ToolTip ("Welcome " & $read & @CRLF & "Press {Pause} to login.") ;ToolTip ("Welcome " & $read & "(" & $i & ")" & @CRLF & "Press {Pause} to login.") ToolTip ("Welcome " & $acci & @CRLF & "Press {Pause} to login.") WEnd EndFunc Func manageexe () $file = FileOpenDialog ("Find WoW.exe", $dir, "wow.exe (*.exe)",3,"wow.exe") $array = StringSplit ($file, "\") $exe = $array[$array[0]] $file = StringTrimRight ($file, StringLen ($exe)) If $dir <> $file Then $dir = $file IniWrite ("autologin.ini", "main", "path", $dir) EndIf GUICtrlSetData ($cexe, $exe) IniWrite ("autologin.ini", "main", "exe", $exe) GUICtrlSetState ($cstart, $GUI_ENABLE) GUICtrlSetTip ($cexe, "") main_params () EndFunc Func init () If FileExists ("autologin.ini") = 0 Then FileOpen ("autologin.ini", 1) FileClose (1) FileSetAttrib("autologin.ini", "+H") EndIf $count = IniRead ("autologin.ini", "main", "c", 0) If $count > 0 Then Global $acc[$count],$cryp[$count],$pass[$count],$bad[$count] For $i = 1 To $count $acc[$i-1] = IniRead ("autologin.ini", "accs", $i, "") $cryp[$i-1] = IniRead ("autologin.ini", "pass", $i, "") Next For $i = 1 To $count $pass[$i-1] = BinaryToString (_Crypt_DecryptData ($cryp[$i-1], $key, $CALG_DES)) If $pass[$i-1] = "ÿÿÿÿ" Then $bad[$i-1] = True Else $bad[$i-1] = False EndIf Next EndIf $counts = IniRead ("autologin.ini", "main", "s", 0) If $counts > 0 Then Global $serv[$counts] For $i = 1 To $counts $serv[$i-1] = IniRead ("autologin.ini", "servers", $i, "") Next EndIf $dir = IniRead ("autologin.ini", "main", "path", @ScriptDir) $exe = IniRead ("autologin.ini", "main", "exe", "\wow.exe") $realm = FileRead ("data\engb\realmlist.wtf") If @error Then $realm = "Realmlist not found" EndIf EndFunc Func main_params () If FileExists ($exe) = 0 Then GUICtrlSetState ($ccheck, $GUI_UNCHECKED) GUICtrlSetState ($ccheck, $GUI_DISABLE) GUICtrlSetTip ($cexe, "Exe is missing, please click here to find new one.") EndIf If $count = 0 Then GUICtrlSetState ($cstart, $GUI_DISABLE) GUICtrlSetState ($clist, $GUI_DISABLE) ToolTip ("There are no accounts, click here to add.", 800, 420, "",1, 1) Else For $i = 1 To $count If $bad[$i-1] = False Then $list = $list & "|" & $acc[$i-1] Else $list = $list & "|" & $acc[$i-1] & "!" EndIf Next GUICtrlSetData($clist, $list);, $acc[0]) EndIf $list = "" If $counts = 0 Then GUICtrlSetState ($cserv, $GUI_DISABLE) Else For $i = 1 To $counts $list = $list & "|" & $serv[$i-1] Next GUICtrlSetData($cserv, $list, $serv[0]) EndIf EndFunc Func sent () Send ($acci & "{TAB}" & $passi & "{ENTER}") ToolTip ("") Exit EndFunc Func kill () ToolTip ("") Exit EndFunc with "$cstart = GUICtrlCreateButton ("Start", 10, 35, 50, 20, 0x0001)" i managed to make it start without using hotkeys, hopefully there is something similar for the other ctrls
  5. I'm making a program that has a combo control in a gui and back in win7 when the window was focused the scroll wheel could be used to scroll through it's contents, now i'm using win10 and i have to put the mouse on that control to scroll up and down. Since now the scroll wheel works depending on where the mouse is, is there a way to make it no matter where on the gui the pointer is? Also if the only way to do it is some complex hotkey functions will it work with pressing space to toggle a checkbox? If you need to see what i have so far let me know and i'll copy it here.
  6. Actually now that I started playing with it and reversed the setparrent part so that the gui is child to the irrlicht render so to hide the controls I don't want to see I just call GUISetState (@SW_HIDE) Also the way I want to make it I don't even need to make the gui transparent while it's visible
  7. Thanks Werty, works like a charm. Never thought I could use that (actually never knew it's an option). Well guess i'm still green and have much to learn. One more thing... can I put those "punched holes" back or should I try to make the whole gui that way?
  8. Maybe it will be the same way as to render texture from the camera, but if I can't do it with irrlicht can you tell me about a 3D system that you used or know how to work with?
  9. About the Irrlicht UDF that's exactly what i'm using. How exactly do I cache the render and use it as background? Or more importantly how resource effective this will be?
  10. I'm using irrlight to display 3D models in a window but I can't create any controls in this window and I thought I could compile the code and use objcreate () to display the irrlight (3D) part and overlay it with the autoit gui controls if it won't work is there a way to add gui controls on to the window created by the .dll?
  11. Guinness, I've understood how to use the $cmdline and made it like you used it in your example so this topic is solved.(actually i read your post after i made it) And yes i can omit the function but why should i avoid using global in functions? I am declaring constants in it not variables, how else i can get their values except assigning them out of the function?
  12. THANK YOU JOHN!!! i just had to notice that the quote below wasn't part of your post and see if that var works
  13. For now it's not really opening any files just having a string containing the pathname of a file because if i have this information about the file i can read/write it at any time. I'll post the script anyway. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt ("MustDeclareVars", 1) Func _loadlang () Global Const $lnofile = IniRead ("language.ini", "language", "nofile", "No file opened") Global Const $lidlenf = IniRead ("language.ini", "language", "idlenf", "Idle (no file opened): Please open an archive or create a new one.") Global Const $ltitle = IniRead ("language.ini", "language", "title", "AutoIt Archiver") Global Const $labout = IniRead ("language.ini", "language", "about", "Program for archiving files without compression V.") Global Const $lfo = IniRead ("language.ini", "language", "fo", "File opened:") Global Const $lfns = IniRead ("language.ini", "language", "fns", "File not saved. Do you want to save before closing it?") Global Const $ltn = IniRead ("language.ini", "language", "tn", "Create new file") Global Const $lto = IniRead ("language.ini", "language", "to", "Open archive") Global Const $ltco = IniRead ("language.ini", "language", "tco", "Close opened archive") Global Const $lts = IniRead ("language.ini", "language", "ts", "Save archive") Global Const $ltsa = IniRead ("language.ini", "language", "tsa", "Save archive as") Global Const $lti = IniRead ("language.ini", "language", "ti", "Import files in archive") Global Const $lte = IniRead ("language.ini", "language", "te", "Export all files from archive") Global Const $lta = IniRead ("language.ini", "language", "ta", "About the program") Global Const $ltl = IniRead ("language.ini", "language", "tl", "List of files in the opened archive") ; EndFunc _loadlang () Global $gui, $msg = -1, $content = $lnofile, $saved = True, $tip = $lidlenf, $clist, $file = "", $ofile = "", $fileh = -1, $ask = 0, $mouse, $otip = $lidlenf, $data, $array, $fread Global $bopen, $bnew, $bsave, $bsaveas, $bimport, $bexport, $bclose, $ctip, $babout $gui = GUICreate($ltitle, 900, 400) $bnew = GUICtrlCreateButton ("New", 5, 2, 50, 20) $bopen = GUICtrlCreateButton ("Open", 60, 2, 50, 20) $bclose = GUICtrlCreateButton ("Close", 115, 2, 50, 20) $bsave = GUICtrlCreateButton ("Save", 170, 2, 50, 20) $bsaveas = GUICtrlCreateButton ("SaveAs", 225, 2, 50, 20) $bimport = GUICtrlCreateButton ("Import", 280, 2, 50, 20) $bexport = GUICtrlCreateButton ("Export", 335, 2, 50, 20) $babout = GUICtrlCreateButton ("About", 390, 2, 40, 20) $ctip = GUICtrlCreateLabel ($tip, 435, 5, 460, 20) $clist = GUICtrlCreateEdit ($content, 5, 30, 890, 365) GUICtrlSetState ($bclose, $GUI_DISABLE) GUICtrlSetState ($bsave, $GUI_DISABLE) GUICtrlSetState ($bsaveas, $GUI_DISABLE) GUICtrlSetState ($bimport, $GUI_DISABLE) GUICtrlSetState ($bexport, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() $mouse = GUIGetCursorInfo ($gui) ;ToolTip ($mouse[4]) Select Case $mouse[4] = 0 $tip = $otip Case $mouse[4] = 11 $tip = $otip Case $mouse[4] = 3 $tip = $ltn Case $mouse[4] = 4 $tip = $lto Case $mouse[4] = 5 If $file = "" Then $tip = $otip Else $tip = $ltco EndIf Case $mouse[4] = 6 If $file = "" Then $tip = $otip Else $tip = $lts EndIf Case $mouse[4] = 7 If $file = "" Then $tip = $otip Else $tip = $ltsa EndIf Case $mouse[4] = 8 If $file = "" Then $tip = $otip Else $tip = $lti EndIf Case $mouse[4] = 9 If $file = "" Then $tip = $otip Else $tip = $lte EndIf Case $mouse[4] = 10 $tip = $lta Case $mouse[4] = 12 If $file = "" Then $tip = $otip Else $tip = $ltl EndIf EndSelect If GUICtrlRead ($clist) <> $content Then GUICtrlSetData ($clist, $content) EndIf If GUICtrlRead ($ctip) <> $tip Then GUICtrlSetData ($ctip, $tip) EndIf If $saved = True And GUICtrlGetState ($bsave) = 80 Then GUICtrlSetState ($bsave, $GUI_DISABLE) ElseIf $saved = False And GUICtrlGetState ($bsave) = 144 Then GUICtrlSetState ($bsave, $GUI_ENABLE) EndIf If $file <> "" And GUICtrlGetState ($bclose) = 144 Then GUICtrlSetState ($bclose, $GUI_ENABLE) GUICtrlSetState ($bsaveas, $GUI_ENABLE) GUICtrlSetState ($bimport, $GUI_ENABLE) GUICtrlSetState ($bexport, $GUI_ENABLE) $tip = $lfo & " " & $file $otip = $tip ElseIf $file = "" And GUICtrlGetState ($bclose) = 80 Then GUICtrlSetState ($bclose, $GUI_DISABLE) GUICtrlSetState ($bsaveas, $GUI_DISABLE) GUICtrlSetState ($bimport, $GUI_DISABLE) GUICtrlSetState ($bexport, $GUI_DISABLE) $tip = $lidlenf $otip = $tip EndIf Select Case $msg = $bnew $file = @ScriptDir & "NewArchive.aia" $content = "" $saved = False Case $msg = $bopen $ofile = FileOpenDialog ($ltitle, @ScriptDir, "AIArchives (*.aia)", 3, "", $gui) If $ofile <> "" Then $saved = False $file = $ofile _open (False) $ofile = "" EndIf Case $msg = $bclose If $saved = False Then $ask = MsgBox (3, $ltitle, $lfns, 0, $gui) If $ask = 6 Then savefile(False) $saved = True $fileh = -1 $file = "" ElseIf $ask = 7 Then $saved = True $fileh = -1 $file = "" EndIf Else $file = "" $saved = True $content = $lnofile $fileh = -1 EndIf Case $msg = $bsave savefile (False) $saved = True Case $msg = $bsaveas savefile (True) Case $msg = $bimport $content = _open (True) Case $msg = $bexport ;_open (False) Case $msg = $babout MsgBox (0, $ltitle, $labout & " Alpha 0.1", 0, $gui) Case $msg = $GUI_EVENT_CLOSE If $saved = False Then $ask = MsgBox (3, $ltitle, $lfns, 0, $gui) If $ask = 6 Then savefile (False) $saved = True $fileh = -1 $file = "" Exit ElseIf $ask = 7 Then $saved = True $fileh = -1 $file = "" Exit EndIf Else Exit EndIf EndSelect WEnd Func savefile ($flag = False) If $flag = False Then $fileh = FileOpen ($file, 2) FileWrite ($fileh, $data) FileFlush ($fileh) Else $ofile = FileSaveDialog ($ltitle, @ScriptDir, "AIArchives (*.aia)", 18, "NewArchive.aia", $gui) If $ofile <> "" Then $file = $ofile $fileh = FileOpen ($file, 2) FileWrite ($fileh, $data) FileFlush ($fileh) $ofile = "" $saved = True EndIf EndIf EndFunc Func _open ($flag = False) Local $i = 0 If $flag = False Then ;open $data = $fread Else ;import $ofile = FileOpenDialog ($ltitle, @ScriptDir, "AIArchives (*.aia)", 7, "", $gui) If @error Then $ofile = "" Return "" EndIf $array = StringReplace ($ofile, "|", @CRLF) $ofile = "" Return $array EndIf EndFunc Scullion, i know how to use ini files even in this script i'm using one for locale (change language) option
  14. Not just to associate a specific file extension but to receive a variable containing it's path for opening when the script is started from such file. Right now i have a button to open a file manually but want to make it like other programs. John, i have no idea what you mean and how this is going to help me. Also i can't seem to find that "$CmdLine" you mentioned
  15. Is there a way to pass a file to the script at startup? I mean the same way as if you open a .bmp file and it starts paint opening that file. There is no code of what i did by now because i don't know if there is a way to do it but any advice will be appreciated. Thanks in advance!
×
×
  • Create New...