
Kiti
Active Members-
Posts
287 -
Joined
-
Last visited
Everything posted by Kiti
-
I've integrated it into my script but I don't know why it's not resizing... :-/ #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include<array.au3> #include <timers.au3> Opt("MustdeclareVars", 1) Opt("GUIOnEventMode", 1) Global $Form1, $Edit1, $Edit2, $Button1 Global $ET, $LS, $LR, $TE, $NS, $TM, $TM_0, $TM_1, $TM_2, $TM_3 Global $raport1, $striped1, $slot[2] Global $v1[10], $v2[10], $v3[10], $v4[10], $array3[11][4] Global $p, $x, $s, $i1, $i2, $i3, $timer1, $a, $b, $c, $d $array3[0][0] = "Temp. max" $array3[0][1] = "Reactor" $array3[0][2] = "Energie/sat" $array3[0][3] = "Ofiter" $Form1 = GUICreate("Form1", 462, 200, 219, 126) GUISetOnEvent($GUI_event_close, "Form1Close") $Edit1 = GUICtrlCreateEdit("", 66, 37, 104, 121) $Button1 = GUICtrlCreateButton("Button1", 198, 124, 75, 25, 0) GUICtrlSetOnEvent($Button1, "Button1") GUISetState(@SW_SHOW) button1() ;~ While 1 ;~ Sleep(100) ;~ WEnd Func Form1Close() Exit 0 EndFunc ;==>Form1Close Func Button1() $raport1 = GUICtrlRead($Edit1) $striped1 = StringStripWS($raport1, 8) $ET = StringRegExp($striped1, '(?:Energie:)([0-9.]{1,7})', 1) $LS = StringRegExp($striped1, '(?:UzinaSolara)([0-9]{1,2})', 1) $LR = StringRegExp($striped1, '(?:ReactordeFuziune)([0-9]{1,2})', 1) $TE = StringRegExp($striped1, '(?:TehnologiaEnergiei)([0-9]{1,2})', 1) $NS = StringRegExp($striped1, '(?:Satelitsolar)([0-9.]{1,6})', 1) $slot = StringRegExp($striped1, "((?:\[\d:\d{1,3}:)(\d{1,2})(?:\]))", 1) If Not IsArray($ET) Then $ET = 0 Else $ET = Int(StringReplace($ET[0], ".", "")) EndIf If Not IsArray($LS) Then $LS = 0 Else $LS = Int($LS[0]) EndIf If Not IsArray($LR) Then $LR = 0 Else $LR = Int($LR[0]) EndIf If Not IsArray($TE) Then $TE = 0 Else $TE = Int($TE[0]) EndIf If Not IsArray($NS) Then $NS = 0 Else $NS = Int(StringReplace($NS[0], ".", "")) EndIf If Not IsArray($slot) Then $slot = 0 Else $slot = $slot[1] EndIf #cs $ET = 4567 $LS = 20 $LR = 0 $TE = 12 $NS = 23 $p = 1 #ce ;~ #cs $ET = 20030 $LS = 23 $LR = 0 $TE = 0 $NS = 442 $p = 1 $slot = 7 ;~ #ce If $LR = 0 Then TM(0) Else TM(1) EndIf For $i = 1 To $i2 - 1 $array3[$i][0] = $v1[$i] $array3[$i][1] = $v2[$i] $array3[$i][2] = $v3[$i] $array3[$i][3] = $v4[$i] Next _ArraySort($array3, 1, 1, $i2 - 1) ;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- $timer1 = _Timer_SetTimer(0, 20, "shift") _ArrayDisplay($array3, "Slot " & $slot, $i2 - 1) ;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GUICtrlSetData($Edit1, "") ResetArrays() EndFunc ;==>Button1 Func ResetArrays() $v1 = 0 $v2 = 0 $v3 = 0 $v4 = 0 $p = 1 $i2 = 1 $array3 = 0 Global $v1[10], $v2[10], $v3[10], $v4[10], $array3[11][4] $array3[0][0] = "Temp. max" $array3[0][1] = "Reactor" $array3[0][2] = "Energie/sat" $array3[0][3] = "Ofiter" EndFunc ;==>ResetArrays Func TM($r) If $r = 0 Then $TM_0 = 4 * ((($ET - Int(20 * $LS * 1.1 ^ $LS)) / $NS) - 20) $TM_1 = 4 * Ceiling(((($ET - 20 * $LS * 1.1 ^ ($LS + 1)) / $NS) - 22) / 1.1) If IsInt($TM_0) Then $v1[$i2] = $TM_0 $v2[$i2] = "-" $v3[$i2] = ($TM_0 / 4) + 20 $v4[$i2] = "OFF" $i2 = $i2 + 1 EndIf If IsInt($TM_1) Then $v1[$i2] = $TM_1 $v2[$i2] = "-" $v3[$i2] = ($TM_1 / 4) + 20 $v4[$i2] = "ON" $i2 = $i2 EndIf EndIf If $r = 1 Then For $i1 = 0 To 10 $TM_2 = ((4 * ($ET - Int(20 * $LS * 1.1 ^ $LS) - Int($p * 30 * $LR * (1.05 + $TE * 0.01) ^ $LR))) / $NS) - 80 $TM_3 = 4 * ((Ceiling($ET / 1.1) - Int(20 * $LS * 1.1 ^ $LS) - Int($p * 30 * $LR * (1.05 + $TE * 0.01) ^ $LR))) / $NS - 80 If IsInt($TM_2) And $TM_2 < 129 And $TM_2 > -128 Then If $i1 = 10 Then $p = 0 $v1[$i2] = $TM_2 $v2[$i2] = $p * 100 & "%" $v3[$i2] = Int($TM_2 / 4) + 20 $v4[$i2] = "OFF" $i2 = $i2 + 1 EndIf If Not StringInStr($TM_3, ".") And $TM_3 < 129 And $TM_3 > -128 Then $v1[$i2] = $TM_3 $v2[$i2] = $p * 100 & "%" $v3[$i2] = Int($TM_3 / 4) + 20 $v4[$i2] = "ON" $i2 = $i2 + 1 EndIf $p = $p - 0.1 Next EndIf EndFunc ;==>TM Func shift($a,$b,$c,$d);parameters are unused but must be included If Not WinExists("ARRAYTITLE") Then Return WinMove("Slot " & $slot, "", default,default,default,75 + 21 * $i2) _Timer_KillTimer(0, $timer1) EndFunc ;==>shift
-
That's exactly what I needed, thank you very much! Happy New Year!
-
Oh, I see. I will create a GUI then. Thank you very much for your help! Happy New Year!
-
Hello! I want to move the window resulted from arraydisplay function but it won't move by any means. #include <array.au3> global $array[10] _arraydisplay($array,"ARRAYTITLE") winmove("ARRAYTITLE","",100,100) What can I do? Thank you in advance!
-
Breaking long string lines into 2 lines
Kiti replied to anzacfalcon's topic in AutoIt General Help and Support
You must put a "&" before the "_". $DllBinary &= 'FFDDFFFFC8240000535657837D100075055F5E5BC9C30A1073686A10FF75088DFFFFBFFD45E050E8D408218D7DF08B750C8B5D088B4D1083C40C8A440EFF3244DCDE6CFF0BFF88440FFFE2F22814034510502CAD0F35B77BAD3A373EE8993A07D83773D30EF00CE88A3D2431C04068BBDBE4EDE9B05800EB3934598A513044C53E67960EF62F325D4FEB6EBFEE0C4E4A3F450C816D108518A8FBC8F61BC1B97462A0E00C83EB10A3FFED5B98A0B4F92A098A040B88040F41B7B15DB0EBB1AEFE0EA08B5483E8DD6CD8B110A3E607C014FF078463B160B5B404C83434BDF79209579F0758B8780991CDFC0E9026861A1672C85F538B7D0C8D75F024F9DC661223DBE9C5045B0CC14DC21943213B4A0C6CDB6C077474B31083F88B692F95B199B91318D3C0F89E608E16FC0633C31083E973C1967054843245353B36E43678CA0640C119792F238010BF019706D0FE1C08B20C0F8331FF00E1CEF0814E5589E54D880FB61B15EFE7B67F14EB5685DB75113D184043590D67DD85FF6F64550801DA83FF04722489D88347751DA08B5B7B7BFB003302890281108906C40483E35B1304D2DDBEF983EF04EB138A0632028801064317FF9174BBED4F854CA6AC891E745D425E98E1E95A6377E10C477EF9E4261F8B4D098B0231C8890A72F7736179150E88C87B06880A945C2103A24BF99E0CC9651D168BEC317260DF21' & _ '0F8A1530E8B1FA378D5D0000C83B0F318945FC8955F8B0E36D59320C49C6FCC1E9FAFC256CE6F2AD8D2169C0699001C818F8BB93838CF85046F82BC1E0FEEDD6DC100308A18B0C4EE0FF4D0C75B7C9C21FA727DD5BC82C1165DC3DF28BF7F2B70DE4833D1503E400741C6A206A0305C86FBF6E01688B80E1AB5C1B8945ECEB1A63DB260389A7EC0D07293DDD85054B022F03C0A6EC8C3D035F4BE81B3DCCDBB24D4BE80F10ECE8261AFB6EC153A8D850122523D4F9F26D59CFD80405D410736F10017469DBB55BBB0274634F28E450D753D0402F3648DFF0FB5BAFC00F84280110E41A65BE722CF7ABFA30E01B36739FF8E8E8D12F132A158ECCFDF0BB5BE310E9CBAA319FD985937D405991607321605988930E32D9518773A000E170C2DEB6F8AC220401753A94DC50005B6A8E9096FCC45D341CBE4776F26AFD17CEDCF918105EF8F7CABDFD5A73E431D229381955D8EE33BCD0A39B0F8549F498C21C205F127E24BA5A6B16AB048CD8CDA383C8FF1739BC421E642E7C5A5A5ABC425E84305A0E5A24A7E490F759F6592E247938761EBFE499D9591C2F0B7C740696E405E93D2880D1960502D45D32654EC9C8C85B554F9559E31C404E007AF95100E3C9236959B7003D480E843C3559CDFA0839841C2CFBD3F8F2E44072BF5884587C5863C993136D586558051DE1FB708F05E8E97B8225F3E96F73979CCC0B189CFD900BEC1828D0845C' -
How do I assign a variable to an array element?
Kiti replied to gte's topic in AutoIt General Help and Support
That's perfect, but just get rid of the second quotes in WinGetPos. Try this: $winpos = WinGetPos("HP OpenView ServiceCenter - Incident Queue:", "") $winposhorizontal = $winpos[0] $winposvertical = $winpos[1] MsgBox(0, "", $winposhorizontal & ":" & $winposvertical) It's working! -
I don't know what number it will be, I just want to do something when it's an integer. The StringInStr test is great, thank you very much! And one more thing: At the 10th run, when $p should be 0, it displays it as 1.38777878078145e-016. Why is that? Is there any nicer approach than "If $i = 10 then $p = 0" ?
-
Hello! I've wrote this code, run it to see what it happens: $ET = 4567 $LS = 20 $LR = 9 $TE = 12 $NS = 23 $p = 1 For $i = 0 To 10 $x = ((Ceiling($ET / 1.1) * 1.1 - 1.1 * Int(20 * $LS * 1.1 ^ $LS) - 1.1 * Int($p * 30 * $LR * (1.05 + $TE * 0.01) ^ $LR))) / ($NS * 1.1) If IsInt($x) Then MsgBox(0, "","IF $p = " & $p & " then " & $x & " is integer") Else MsgBox(0, "","IF $p = " & $p & " then " & $x & " is NOT integer") EndIf $p = $p - 0.1 Next When $p is 0.8 $x is 25 but is NOT recognized as an integer. The message box says "IF $p = 0.8 then 25 in NOT integer". Why?? 25 IS an integer! How can I solve this? Thank you in advance!
-
My mind tells me to write this: #include<array.au3> Global $array1[5] = ["A","B","C","D","E"] Global $array2[5] = [1,2,3,4,5] $s = UBound($array1) global $array3[$s][2] for $i = 0 to $s $array3[$i][1] = $array1[$i] $array3[$i][2] = $array2[$i] next _arraydisplay($array3) ...but (of course) it's not right ) Any ideea about what can be wrong? Edit: I've got it, it has to be: for $i = 0 to $s -1 $array3[$i][0] = $array1[$i] $array3[$i][1] = $array2[$i] next Thank you a lot for your help!!! Happy New Year!
-
Hello! How can I turn this: Global $array1[5] = ["A","B","C","D","E"] Global $array2[5] = [1,2,3,4,5] into this? Global $array3[5][2] = [["A",1],["B",2],["C",3],["D",4],["E",5]] Thank you in advance!
-
Yaay, brilliant! Thank you very much!
-
Hello everyone! Here's a piece of non-working code: for $i = 1 to 3 eval("f" & $i) next func f1() msgbox(0,"",1) EndFunc func f2() msgbox(0,"",2) EndFunc func f3() msgbox(0,"",3) EndFunc I think you've already understood what I want to do. I have three functions, called f1, f2 and f3, and I want to be able to call them by something similar to the eval function, so the script will count up to 3. How do I do that?
-
Thank you a lot for the explanations! Now I managed to creat a search string to pull out the number "26" ! $String = clipget() $nr = StringRegExp($String, '(?:Total\s)(\b\d+\B) ', 1) My script is finally finished!
-
It's working, thank you very much! What about the "Total 26" thing? And if you're not to busy right now, could you explain me what does the "(?:Aparator\s)(\b\w+\ (?:\s\(\[)(.*?)(?:\]\))" do? I really want to be able to make my own stringregexp match strings without getting them from the forum ^^
-
Both examples are working if I try to pull out "26" only from the string "Total 26", but the point is that I have a larger text in clipboard and I want to pull "26" from all of it. This is the text: What is bolded always remains the same. What is red changes everytime. I want to pull the underlined words which are: 26, Marvin,2:489:4, 88.812, 49.807 and 12.679. For the last three numbers I've made a script and it works: $string = clipget() $asResult1 = StringRegExp($string, '([.0123456789]{1,7})(?: metal)', 1) If @error == 0 Then MsgBox(0, "", $asResult1[0]) EndIf $asResult2 = StringRegExp($string, '([.0123456789]{3,7})(?: cristal)', 1) If @error == 0 Then MsgBox(0, "", $asResult2[0]) EndIf $asResult3 = StringRegExp($string, '([.0123456789]{3,7})(?: deuteriu)', 1) If @error == 0 Then MsgBox(0, "", $asResult3[0]) EndIf But I still don't know how to pull "Marvin" and "2:489:4" because both are changeable and there is nothing else next to them apart from "Aparator" which stays fixed. And the above two scripts are not working on that entire text
-
Hello! I want to pull out the number "26", but it doesn't work: $string = "Total 26" $result = StringRegExp($string, '([/z][1-9](1,2})(?:Total )', 1) If @error == 0 Then MsgBox(0, "", $result[0]) EndIf I don't really know how to put a non-capturing group capture what it finds after the group. I've tried "[/z]" in the beginning but it doesn't solve the problem.
-
ok, I've tried to simplify it as much as possible. Here's the resulting code: #include <ExcelCOM_UDF.au3> $oExcel = _ExcelAttach("C:\Documents and Settings\Administrator\Desktop\Book3.xls", "FilePath") _ExcelSort($oExcel, "A1", 1, 1, 10, 1, 1) Book3.xls is a worksheet with numbers written on column 1, from line 1 to line 10. And it still doesn't sort them, even though it seems like it worked fine: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Administrator\Desktop\2 iunie\3\script3.au3" >Exit code: 0 Time: 0.634 What am I doing wrong?
-
Hello! I want to sort by a collumn in an excel workbook, using Locodarwin's UDF. But I don't get the right parameters, here's the error I get: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Administrator\Desktop\2 iunie\3\script3.au3" C:\Program Files\AutoIt3\Include\ExcelCOM_UDF.au3 (1225) : ==> The requested action with this object has failed.: $oExcel.Range($oExcel.Cells($sRangeOrRowStart, $iColStart), $oExcel.Cells($iRowEnd, $iColEnd)).Sort ($oExcel.Range($sKey), $iDirection, $oExcel.Range($sKey), Default, $iDirection, $oExcel.Range($sKey), $iDirection, $iHeader, True, $fMatchCase, $iOrientation, Default, $iDataOption) $oExcel.Range($oExcel.Cells($sRangeOrRowStart, $iColStart), $oExcel.Cells($iRowEnd, $iColEnd)).Sort ($oExcel.Range($sKey)^ ERROR >Exit code: 1 Time: 0.726 It seems like the $sKey parameter is wrong, but I cannot fiind the right one. Here's my script: #include <ExcelCOM_UDF.au3> $oExcel = _ExcelAttach("C:\Documents and Settings\Administrator\Desktop\Book3.xls", "FilePath") _ExcelSortExtended($oExcel, "I", 1 , 1, 10000, 24, 2, 1, False, 2, 0) Msgbox(0,"", @error & " ; " & @extended) Thank you in advance!
-
for $i = 1 to 23*10^99 Msgbox(0,"","sorry sorry sorry sorry sorry sorry") next Sorry!!! for making you waste so much time ^^
-
oups, when I saw only bmp is allowed, I changed the file extension from jpg to bmp ... fatal mistake Now it's working great, thank you very much!
-
Then just upload the .exe and I'll get the problem solved, maybe there is something wrong with my computer. I *think* I can see the pic in there, it's a folder tree : Bitmap > Pic > 0. The "0" has a flower icon next to it and when I press it I get a message saying "The file has a non standard resource layout... it has probably been compressed with an "EXE Compressor". "
-
[22 apr. 2009, 21:55:02] C:\Users\Kiti\Desktop\ResHack\ResHacker.exe -add C:\Users\Kiti\Desktop\DDFL.exe, C:\Users\Kiti\Desktop\DDFL.exe, C:\Users\Kiti\Desktop\o3.bmp, BITMAP, PIC, 0 Added: BITMAP,PIC,0 Commands completed And still, there is no picture when I run the compiled version
-
>"D:\Aplicatii\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "C:\Users\Kiti\Desktop\DDFL.au3" +>21:54:58 Starting AutoIt3Wrapper GUI v.1.10.1.14 -> No changes made.. +>21:55:01 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0409 Keyboard:00020409 OS:WIN_VISTA/Service Pack 1 CPU:X86 ANSI) >Running AU3Check (1.54.14.0) from:D:\Aplicatii\AutoIt3 +>21:55:01 AU3Check ended.rc:0 >Running:(3.3.0.0):\Aplicatii\AutoIt3\aut2exe\aut2exe.exe /in "C:\Users\Kiti\Desktop\DDFL.au3" /out "C:\Users\Kiti\Desktop\DDFL.exe" /comp 2 /nopack /Bin C:\Users\Kiti\AppData\Local\Temp\AutoItSC.bin +>21:55:01 Aut2exe.exe ended.rc:0 +>21:55:01 Created program:C:\Users\Kiti\Desktop\DDFL.exe ->Warning: This is an Unicode compiled script and will not run on Win9x/ME. >Running:C:\Users\Kiti\Desktop\ResHack\ResHacker.exe -add C:\Users\Kiti\Desktop\DDFL.exe, C:\Users\Kiti\Desktop\DDFL.exe, C:\Users\Kiti\Desktop\o3.bmp, BITMAP, PIC, 0 >C:\Users\Kiti\Desktop\ResHack\ResHacker.exe -add C:\Users\Kiti\Desktop\DDFL.exe, C:\Users\Kiti\Desktop\DDFL.exe, C:\Users\Kiti\Desktop\o3.bmp, BITMAP, PIC, 0 Ended rc:0 >Running:C:\Users\Kiti\Desktop\upx303w\upx303w\upx.exe --best "C:\Users\Kiti\Desktop\DDFL.exe" Ultimate Packer for eXecutables Copyright © 1996 - 2008 UPX 3.03w Markus Oberhumer, Laszlo Molnar & John Reiser Apr 27th 2008 File size Ratio Format Name -------------------- ------ ----------- ----------- 701267 -> 378195 53.93% win32/pe DDFL.exe Packed 1 file. >C:\Users\Kiti\Desktop\upx303w\upx303w\upx.exe --best "C:\Users\Kiti\Desktop\DDFL.exe" Ended rc:0 +>21:55:03 AutoIt3Wrapper Finished >Exit code: 0 Time: 4.675
-
Hmm... it's not working #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_After=C:\Users\Kiti\Desktop\ResHack\ResHacker.exe -add %out%, %out%, C:\Users\Kiti\Desktop\o3.bmp, BITMAP, PIC, 0 #AutoIt3Wrapper_Run_After=C:\Users\Kiti\Desktop\upx303w\upx303w\upx.exe --best "%out%" #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <resources.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Determinarea distantei focale a unei lentile", 422, 298) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $input1 = GUICtrlCreateInput("", 80, 32, 41, 21) $input2 = GUICtrlCreateInput("", 80, 72, 41, 21) $input3 = GUICtrlCreateInput("", 80, 112, 41, 21) $input4 = GUICtrlCreateInput("", 80, 152, 41, 21) $Button1 = GUICtrlCreateButton("Calculeaza!", 48, 224, 99, 33, 0) GUICtrlSetOnEvent($Button1, "Button1Click") $Label1 = GUICtrlCreateLabel("n1 =", 40, 32, 25, 17) $Label2 = GUICtrlCreateLabel("n2 =", 40, 72, 25, 17) $Label3 = GUICtrlCreateLabel("R1 =", 40, 112, 27, 17) $Label4 = GUICtrlCreateLabel("R2 =", 40, 152, 27, 17) $Label5 = GUICtrlCreateLabel("f=", 224, 224, 24, 36) GUICtrlSetFont($Label5, 20, 400, 0, "MS Sans Serif") $Label6 = GUICtrlCreateLabel("m", 128, 112, 12, 17) $Label7 = GUICtrlCreateLabel("m", 128, 152, 12, 17) $Label9 = GUICtrlCreateLabel("", 248, 224, 150, 36) GUICtrlSetFont($Label9, 20, 800, 0, "MS Sans Serif") GUICtrlSetColor($Label9, 0x000000) $Label10 = GUICtrlCreateLabel("", 218, 254, 150, 36) GUICtrlSetFont($Label10, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor($Label10, 0x000000) $pic1 = GUICtrlCreatePic("", 164, 20, 230, 194) _ResourceSetImageToCtrl($pic1, "PIC", $RT_BITMAP) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Button1Click() $n1 = GUICtrlRead($input1) $n2 = GUICtrlRead($input2) $r1 = GUICtrlRead($input3) $r2 = GUICtrlRead($input4) $f = 1 / ((($n1 / $n2) - 1) * ((1 / $r1) - (1 / $r2))) If $n1 = $n2 Then MsgBox(64, "Eroare", "n1 si n2 trebuie sa aiba valori diferite!") ElseIf $r1 = $r2 Then MsgBox(64, "Eroare", "R1 si R2 trebuie sa aiba valori diferite!") Else GUICtrlSetData($Label9, MyFunc($f, 2) & " D") EndIf If $r1 <> $r2 And $n1 > $n2 Then GUICtrlSetData($Label10, "-lentila convergenta") Else GUICtrlSetData($Label10, "-lentila divergenta") EndIf EndFunc ;==>Button1Click Func MyFunc($NUM, $DIGIT) If IsInt($NUM) Then Return $NUM Else $LEN = StringLen(String($NUM)) $POINT = StringInStr(String($NUM), ".") Return StringLeft(String($NUM), $POINT + $DIGIT) EndIf EndFunc ;==>MyFunc Func Form1Close() Exit 0 EndFunc ;==>Form1Close I just compiled the script, but the image is not there.
-
Hi! I want to include a picture in my compiled script. I read Zedna's resources UDF, but I just don't get it. Here is my script: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <resources.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Determinarea distantei focale a unei lentile", 422, 298) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $input1 = GUICtrlCreateInput("", 80, 32, 41, 21) $input2 = GUICtrlCreateInput("", 80, 72, 41, 21) $input3 = GUICtrlCreateInput("", 80, 112, 41, 21) $input4 = GUICtrlCreateInput("", 80, 152, 41, 21) $Button1 = GUICtrlCreateButton("Calculeaza!", 48, 224, 99, 33, 0) GUICtrlSetOnEvent($Button1, "Button1Click") $Label1 = GUICtrlCreateLabel("n1 =", 40, 32, 25, 17) $Label2 = GUICtrlCreateLabel("n2 =", 40, 72, 25, 17) $Label3 = GUICtrlCreateLabel("R1 =", 40, 112, 27, 17) $Label4 = GUICtrlCreateLabel("R2 =", 40, 152, 27, 17) $Label5 = GUICtrlCreateLabel("f=", 224, 224, 24, 36) GUICtrlSetFont($Label5, 20, 400, 0, "MS Sans Serif") $Label6 = GUICtrlCreateLabel("m", 128, 112, 12, 17) $Label7 = GUICtrlCreateLabel("m", 128, 152, 12, 17) $Label9 = GUICtrlCreateLabel("", 248, 224, 150, 36) GUICtrlSetFont($Label9, 20, 800, 0, "MS Sans Serif") GUICtrlSetColor($Label9, 0x000000) $Label10 = GUICtrlCreateLabel("", 218, 254, 150, 36) GUICtrlSetFont($Label10, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor($Label10, 0x000000) GUICtrlCreatePic("C:\Users\Kiti\Desktop\o3.bmp", 164, 20, 230, 194); ----------------------------------look here! GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Button1Click() $n1 = GUICtrlRead($input1) $n2 = GUICtrlRead($input2) $r1 = GUICtrlRead($input3) $r2 = GUICtrlRead($input4) $f = 1 / ((($n1 / $n2) - 1) * ((1 / $r1) - (1 / $r2))) If $n1 = $n2 Then MsgBox(64, "Eroare", "n1 si n2 trebuie sa aiba valori diferite!") ElseIf $r1 = $r2 Then MsgBox(64, "Eroare", "R1 si R2 trebuie sa aiba valori diferite!") Else GUICtrlSetData($Label9, MyFunc($f, 2) & " D") EndIf If $r1 <> $r2 And $n1 > $n2 Then GUICtrlSetData($Label10, "-lentila convergenta") Else GUICtrlSetData($Label10, "-lentila divergenta") EndIf EndFunc ;==>Button1Click Func MyFunc($NUM, $DIGIT) If IsInt($NUM) Then Return $NUM Else $LEN = StringLen(String($NUM)) $POINT = StringInStr(String($NUM), ".") Return StringLeft(String($NUM), $POINT + $DIGIT) EndIf EndFunc ;==>MyFunc Func Form1Close() Exit 0 EndFunc ;==>Form1Close And my picture is this one: o3.bmp Please edit my script in order to get that picture inside the .exe after I compile the script! Thank you!