Jump to content

Search the Community

Showing results for tags 'code'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






Found 12 results

  1. Let me get it straight... I've been having such a great experience with AutoIt, it helped me a lot at my work. And now, I gotta make some configurations in the BIOS of many computers at my work. So, I'd like to know, is it possible to use AutoIt (or some programming language) to write an algorithm that when compiled and transefered to a pen drive, it's "plug and run"?
  2. Hi All, It has been bugging me for a while now. Can you view the AutoIt code from within a compiled exe. Like how you can with most .Net exe's by using a certain program. If this is possible, how then can I secure my program (if this method exists).
  3. Hi everybody, i want to optimize my search code, because i don't think that my solution is "acceptable" from development perspective, it might be optimized. I have a text file, i read it and i copy all the entries to an Array, then i have to start a search to see if a specific entry is present. I have about ten different strings to search. Func FileSearch($file_content_array, $search) $j=0 For $i = 0 To UBound($file_content_array) - 1 $search_result=StringInStr($file_content_array[$i],$search) If $search_result<>0 Then ReDim $searchResultArray[UBound($searchResultArray) + 1] $searchResultArray [$j] = $file_content_array[$i] $j+=1 EndIf Next Return $searchResultArray EndFunc My solution would be ok for a single search, but in case of multiple searches? would it be still good? I have thought to use a 2D Array, where the first column is the array-item and the second column is "yes" or "no". But what about the searches? Do i have to use 10 times the function? In case of questions: I have to scan a directory and check whether some files are present or not and then write into another file:"yes, it is present", "no, it is not present". Thanks in advance
  4. Hi All, I'm not too code savvy but I know this is a simple one! Here's my problem, I have a folder with text files containing gcode. they are appended .nc, .ngc, and .gcode randomly. I can rename them all .ngc which is my preferred file type. In these files there's lines of gcode, carrying commands for a CNC. What I need to do is remove some comments from the beginning and format the text a certain way. I'll show an example of the original file and what I need it to look like. The files can be 20 lines or 10,000 long depending on the part. Old text: ( Header 1 text ) ( Header 2 text ) G90 (set absolute distance mode) G90.1 (set absolute distance mode for arc centers) G17 (set active plane to XY) G21 (set units to mm) #<z_safe> = 0.250 #<plunge_feed> = 5 (---------------------------------------------------------) G0 X 17.2644 Y 1.6127 M03 G1 X 2.2842 Y 8.0674 F 0.01 G1 X 15.3642 Y 17.8133 G1 X 17.2644 Y 1.6127 M05 G0 X 0.0000 Y 0.0000 M05 M02 What it needs to look like: G90 G21 G0 X17.2644 Y1.6127 M03 G1 X2.2842 Y8.0674 <--- copy and paste above the next m05 G1 X15.3642 Y17.8133 G1 X17.2644 Y1.6127 G1 X2.2842 Y8.0674 <--- pasted here M05 G0 X0.000 Y0.000 M05 M02 Some things to note: g90 sets absolute coordinate mode, g21 tets units to mm, g0 is first coordinate to move the tool to. This is an important step: m03 is what turns on a laser. I need the first coordinate after every m03 to be copied to the line above m05 for each chunk of gcode. the very last m05 before the m02 needs to be ignored. There are multiple chunks with m03 x,ys then m05. each chunk is going to have different coordinates after the m03. I have no idea where to start other than find the line with the wanted string, m03. dont know how to handle m05 though... any help is very much appreciated!
  5. Hi, SL3NCK calculates the 7 NCK's levels used for unlocking SL3 phones. SL3NCK("0000000000000000000000000000000000000000", "080803080307030003010002020305") _output: #pw+283037116581614+1# #pw+235518432205471+2# #pw+595388505163502+3# #pw+415333744058839+4# #pw+259299316395048+5# #pw+467723677207791+6# #pw+690485095019780+7# You can test run and see is the same code output as in the following websites: http://www.francesco-pompili.it/Hash2Nck.aspx http://nokia-sl3.com/nck.php #include <Crypt.au3> ; #Function# =========================================================================================================== ; Name...........: SL3NCK ; Description ...: Calculates 7 NCK levels for SL3. ; Syntax.........: SL3NCK("TARGET_HASH","MASTER_SP_CODE") ; Return values .: string with 7 levels NCK's. ; Author ........: kyan (autoIT code), oOXTCOo (PHP code). ; Remarks .......: $TargetHash is a string with 40 hex chars. $MasterSP is a string with 30 digits. ; Related .......: SimlFeistel(), _packH() ; Requeires .....: #include <Crypt.au3> ; =============================================================================================================================== Func SL3NCK($TargetHash, $MasterSP) $result = '' $MasterSP = '000000' & StringMid($MasterSP, 0 + 1, 24) For $i = 1 To 7 $hash = _packH('0' & $i & $TargetHash) $hash = StringTrimLeft(StringUpper(_Crypt_HashData($hash, $CALG_SHA1)), 2) $precode8 = StringMid($MasterSP, 0 + 1, 16) $precode7 = StringMid($MasterSP, 17 + 1, 30) For $magic = 0 To 1 $sh = _packH('0' & $magic & StringMid($hash, 0 + 1, 32) & $precode8) $sh = StringTrimLeft(StringUpper(_Crypt_HashData($sh, $CALG_SHA1)), 2) $precode = SimlFeistel($sh, $precode7) $precode7 = $precode $sh = _packH('0' & $magic & StringMid($hash, 0 + 1, 32) & $precode) $sh = StringTrimLeft(StringUpper(_Crypt_HashData($sh, $CALG_SHA1), 2) $precode = SimlFeistel($sh, $precode8, 8) $precode8 = $precode Next $final = $precode8 & $precode7 $x = 1 $nck = '' For $y = 1 To 15 $nck = $nck & StringMid($final, $x + 1, 1) $x += 2 Next $result &= '#pw+' & $nck & '+' & $i & '#' & @CRLF Next Return $result EndFunc ;==>SL3NCK Func SimlFeistel($sh, $precode, $bytes = 7) Local $result = '', $j = 0, $nck = '', $nck2 = '' While ($j < ($bytes * 2)) $nck = StringMid($sh, $j + 1, 1) & StringMid($sh, $j + 2, 1) $nck2 = StringMid($precode, $j + 1, 1) + StringMid($precode, $j + 2, 1) $prenck = Mod((Dec($nck) + Dec($nck2)), 10) $result = $result & '0' & $prenck $j += 2 WEnd Return $result EndFunc ;==>SimlFeistel Func _packH($sInput) Local $sReply = "" For $xx = 1 To StringLen($sInput) Step 2 $sReply &= Chr(Dec(StringMid($sInput, $xx, 2))) Next Return $sReply EndFunc ;==>_packH by Luigi Hope it comes handy for someone PS: You can't unlock a phone only with this. Google is your friend.
  6. This function is used to create a unique system I/O control code (IOCTL). ; Ported from C to C#: http://www.emoticode.net/c-sharp/win32-ctl_code-macro-ported-to-c.html Func _WinAPI_Create_CTL_CODE($iDeviceType, $iFunction, $iMethod, $iAccess) Return BitOR(BitShift($iDeviceType, -16), BitShift($iAccess, -14), BitShift($iFunction, -2), $iMethod) EndFunc ;==>_WinAPI_Create_CTL_CODE
  7. Hi, Here is a script which destroys the AutoIt Window, there is many issues that can understand and fix except that the application won't exit with the Exit code. Is there any way to "redirect" the exit code to terminate the application? There should be a main function in the internal autoit code, no way to make it exit? Here is the script : ;you will need to kill the autoit3 process. #include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> Global $_hWndProc = DllCallbackRegister("WM_HANDLER", "int", "hwnd;int;wparam;lparam") AutoItWinSetTitle("Wndtmp_") $hWnd = WinGetHandle("Wndtmp_") _WinAPI_SetWindowLong($hWnd, $GWL_WNDPROC, DllCallbackGetPtr($_hWndProc)) _WinAPI_DestroyWindow($hWnd) ;also destroys: ;tray icon, hotkeys, wm messages (in particular Exit), more things? Exit ;does not work Func WM_HANDLER($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_CLOSE Return False EndSwitch Return _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>WM_HANDLER My purpose for this is insignificant, but I would be interested to know if it's possible. Br, FireFox.
  8. Let me explain better.And Im 100% sure many have this problem and would be awesome if there would be a fix for this . So : In the SciTE script editor, if I load a big project, I want my source code to be clean, good ordered and concise. Because I have many functions, I often tight or expand them via that left little '+' or '-' cube button of the function. But after I close the SciTE window, ofc my sourcecode gets saved but not and the functions state ! Everytime I start the project , I start with all the functions expanded, despite if they were tightened or expanded . What could I do to SciTE to save my code state too ?
  9. wanted to know if theres a way to create a blank image of specific color code using au3 only, for example, wanted to make blank jpg pic of hex code 004488 using au3 only, how can it be done? and second question is, how to place a transparent png over another picture and save it as jpg (or any other format)? + = 3rd, how to convert png to jpg? Regards, Akshay
  10. Hi everyone I have 2 basic question about hex editing - I have several texts with a common problem, in stead of having CRLF (carriage return+line feed) only had 0x0A (LF), how do I add 0D behind every 0x0A? - Its possible to edit only the beginning of a file (speaking in large files that should't be loaded in memory) and save the changes?
  11. Hello, When I want to post some code to the forum, I always have some issues on how to paste it correctly so the code looks correct in my post. The problems I ran into are: - the tab indent disapear - some smileys appear with some regexp patterns - the forum try to auto format the text and add some html tags in my regexp patterns - paste the code in "toggle edit mode" to keep the tab indents but this method adds some html tags here and there - I don't know about you guys, but when I try to paste some code in the "Special BB code" and select "Autoit" then the window stretches up and I cannot click the button to validate (the button goes out of my screen (Google Chrome and Windows 7 x64))! I tried several ways and it seems that the best way of doing it is: 1 - Paste the code as plain text (to make sure no text formatting is kept) 2 - write myself the [ autoit ] tags at the beginning and end of the code 3 - now the problem is that this method doesn't keep the tab indents. I was thinking that there should be a tutorial pinned in every forum, because I've seen that I am not the only one having troubles with it. So if you have some tips, I'd be happy to know them so I don't pull my hairs every time! jmon. [EDIT] Solved: So it's a problem with the IPB forum editor, so while there is no update, the best way of doing it is (From Melba23 and BogQ): 1 - Toggle "Edit mode" (Top left of the text editor) 2 - do all you things in edit mode 3 - add manually the autoit tags for autoit code ([*autoit*] for the beginning, [*/autoit*] for the end (remove the stars)) 4 - preview your post. If there is unwanted html tags, then remove them manually 5 - post This method keeps the TAB indents, but sometimes add some unwanted html tags in RegExp Patterns and URLs. Also sometimes, #includes containing "<" or ">" will disappear. In this case, preview your post and if you notice this then just write them again...
  12. Hey everyone, I am working on a script for which I have a webpage saved. At the start of the program, the program loads the source code into a variable, removes all script and noscript, and then it must cut out a div called product (<div id="product">). The problem is that each time I try to write this function, I have problems detecting how many child divs it has nested in it. I have tried also writing a function that determines the amount of characters in the div, for trimming to the right of the div, but this has not worked. I dont wish to use an embedded browser for my program, I just want to work with the strings. Could anybody give me any pointers? Thanks. EDIT I have found the following forum post: The problem is though, that (as far as I am aware) it requires you to use the embedded browser or just use internet explorer, which will not help me as I just want to read the source code. I am aware that I can load the source into the browser and then hide the browser, but I would rather just "cut" the div out of the source. Thanks. SOLUTION Thanks to thanlankon. Please note that this also returns the div tags (opening and closing) for the specified div. It also removes the " character from either side of the ID name.
  • Create New...