Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/15/2015 in all areas

  1. I've been tinkering with this on and off for around 9 months and finally figured it out. Here are 100 functions or so that deal with creating, manipulating, training, and ultimately using neural nets. I'm using the Fann(Fast Artificial Neural Network) library. This is the best open source package I could find, and has many interesting features. I've created the functionality in AutoIt to do everything except the callbacks, c-level convenience functions, and the cascade training system. I'll be adding the cascade system sometime soon. Neural nets are powerful computational devices that can be used for many things, such as OCR, pathing, targeting, threat detection, function approximation, document sorting, and more. The dll: fannfloat.dll The UDF: _Fann.au3 [[previous downloads: 14]] Here's an example. This will create a neural net, train it on some data, and save it to a file called "xor_float.net." #include "_Fann.au3" Global $InputsArray[4][2] = [[-1, -1],[-1, 1],[1, -1],[1, 1]] Global $OutputsArray[4][1] = [[-1],[1],[1],[-1]] Local $ANNLayers[3] = [2, 3, 1] _InitializeANN() $Ann = _CreateAnn(3, $ANNLayers) _ANNSetActivationFunctionHidden($Ann, $FANN_SIGMOID_SYMMETRIC) _ANNSetActivationFunctionOutput($Ann, $FANN_SIGMOID_SYMMETRIC) _ANNTrainOnData($Ann, $InputsArray, $OutputsArray, 5000, 10, 0.001) _ANNSaveToFile($Ann, "xor_float.net") _DestroyANN($Ann) _CloseANN() Now you have a neural net that is trained to handle the logic of XOR. It takes two inputs and returns one output. To use the neural net, you'll have to load it, and run some input through it to see what it produces. #include "_Fann.au3" Local $myInputs[2] = [1, -1] _InitializeANN() $hAnn = _ANNCreateFromFile("xor_float.net") $calc_out = _ANNRun($hAnn, $myInputs) MsgBox(0, "XOR", "XOR " & $myInputs[0] & ", " & $myInputs[1] & @CRLF & $calc_out[0]) _DestroyANN($hAnn) _CloseANN() The neural net will return an approximation of the XOR value for the pair of inputs you give it. (1 or -1) If (1,1) or (-1,-1) then it returns something like -.969. If (-1,1) ir (1,-1) then it will return something like .934 I'll provide a more useful example in the form of a mouse gesture recognition neural net sometime later, but I thought I'd share this now. I hope at least a few people are as excited as I am. This should provide a significant boost to AutoIt's AI firepower. Documentation is located at: http://leenissen.dk/fann/html/files/fann-h.html If there are questions, fire away. I'll answer as best I can. Oh, and before I forget... My everlasting gratitude and thanks to the following, in no particular order: monoceres, valik, RichardRobertson, trancexx, martin, manadar, and Smoke_N, for the help and teaching they've given me. Thanks, guys (+gal)!
    1 point
  2. Here a version of a splash text variant using GDI+. Requires AutoIt v3.3.12.0 or higher! Source code download: UDF: _SplashTextEx.au3 (previous downloads: 135) Example: Example1.au3 (previous downloads: 127) Might be useful for someone... Please report any bugs.
    1 point
  3. Don't get too excited when you look at this... Func _SciTE_GetText() ; Thanks To Jos: http://www.autoitscript.com/forum/topic/130437-new-scite4autoit3-available-with-scite-v227/page__view__findpost__p__907702 If Int(StringRegExpReplace(@AutoItVersion, '\D', '')) >= 33911 Then Return ControlGetText($__vSciTEAPI[$__hSciTEWindow], '', '[CLASS:Scintilla; INSTANCE:1]') ; v3.3.9.11+ Else Local $sReturn = StringToBinary(ControlGetText($__vSciTEAPI[$__hSciTEWindow], '', '[CLASS:Scintilla; INSTANCE:1]'), 2) ; Translate Back To ANSI Text $sReturn = BinaryToString($sReturn, 1) ; Strip Ending 00 Plus Extra Characters. Return String($sReturn) EndIf EndFunc ;==>_SciTE_GetText Because it's probably not what you expect, text at line.
    1 point
  4. 1 point
  5. Great. You need to call _SciTE_Startup() at the start of your script and _SciTE_Shutdown() at the end e.g. _SciTE_Startup() ConsoleWrite(_SciTE_LinesOnScreen() & @CRLF) _SciTE_Shutdown()
    1 point
  6. Look here '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> princip is to use native Windows control msctls_hotkey32 EDIT: nice clever/small example of using HotKey control is here
    1 point
  7. If you look at the SciTE Jump source code you will see a UDF called SciTE.au3. This has the majority of functions you need to interact with SciTE.
    1 point
  8. Have you looked at Yashied's UDF? Do a bit of searching on the subject first.
    1 point
  9. You should be using SciTE's DirectorExtension with SendSciTE_Command() and SendSciTE_GetInfo() as already suggested. Look here to find out what commands you can use with the DirectorExtension, for an example of how that can be used, look at the SciTE toolbar linked in my signature.
    1 point
  10. Hey there! Im currently trying to make a custom auto login using an Array! I'm fairly new to AutoIt but I worked out this Code: #include <Array.au3> #include <Misc.au3> #RequireAdmin Local $Array2D[3][3] HotKeySet("{ENTER}", "TogglePause") Global $Paused = False While 1 If $Paused = True Then Blockinput(1) $i = 2 $rows = UBound($Array2D) - 1 while $i < $rows MouseClick("left",$Array2D[$i][1],$Array2D[$i][2], 1) $i = $i + 1 wend Blockinput(0) Exit ElseIf _IsPressed("01") Then $rows = UBound($Array2D) ReDim $Array2D[$rows + 1][3] $pos = MouseGetPos() $posX = $pos[0] $posY = $pos[1] $Array2D[$rows -1][1] = $posX $Array2D[$rows -1][2] = $posY Sleep(100) EndIf WEnd Func TogglePause() $Paused = True EndFunc It worked very well but then I tried to add left clicks to it.Looks like this: #include <Array.au3> #include <Misc.au3> #RequireAdmin Local $Array2D[3][4] HotKeySet("{ENTER}", "TogglePause") Global $Paused = False While 1 If $Paused = True Then Blockinput(1) $i = 2 $rows = UBound($Array2D) - 1 while $i < $rows MouseClick($Array2D[$i][3],$Array2D[$i][1],$Array2D[$i][2], 1) $i = $i + 1 wend sleep(3000) Blockinput(0) Exit ElseIf _IsPressed("01") Then $rows = UBound($Array2D) ReDim $Array2D[$rows + 1][3] $pos = MouseGetPos() $posX = $pos[0] $posY = $pos[1] $Array2D[$rows -1][1] = $posX $Array2D[$rows -1][2] = $posY $Array2D[$rows -1][3] = "left" Sleep(100) ElseIf _IsPressed("02") Then $rows = UBound($Array2D) ReDim $Array2D[$rows + 1][3] $pos = MouseGetPos() $posX = $pos[0] $posY = $pos[1] $Array2D[$rows -1][1] = $posX $Array2D[$rows -1][2] = $posY $Array2D[$rows -1][3] = "right" Sleep(100) EndIf WEnd Func TogglePause() $Paused = True EndFunc Since then it doesn't work anymore!It returns this: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Admin\Downloads\Bot\Array.au3" /UserParams +>01:12:26 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000407 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0407) +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Admin\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Admin\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Admin\Downloads\Bot\Array.au3 +>01:12:26 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\Admin\Downloads\Bot\Array.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>01:12:26 AutoIt3.exe ended.rc:0 +>01:12:26 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.5291 I don't have any Idea why it does that. Pls help!
    1 point
  11. There are many LUA scripts in the full distribution of SciTE4AutoIt3 and the SciTE Documentation contains all information are the LUA integration in SciTE. It's a little steep learning curve to understand it all but after that you have many options to improve what you have done today with the posted script. Jos
    1 point
  12. Not sure why ControlCommand doesn't return text but this works: ; test this line Local $title = WinGetTitle("[CLASS:SciTEWindow]") Local $tempfile = @ScriptDir & '\scitecontentstemp.txt' $hFile = FileOpen($tempfile, 2) FileWrite($hFile, ControlGetText($title, "S", "Scintilla1")) FileClose($hFile) $Current_lineNumber = ControlCommand($title, "S", "Scintilla1", "GetCurrentLine", "") MsgBox(0,"", "Line Number is = " & $Current_lineNumber & " Text is = " & FileReadLine($tempfile, $Current_lineNumber)) ;~ another test - or any line really!
    1 point
  13. @kcvinu - You should really update your first post with the new download, and remove the original. Most people coming here, will see the first post, and perhaps not read on past the first couple of replies, and so miss later updates. If you want, you can link new posts and first post like I do with mine, and I also take notice of the number of downloads and write them up as (6 previously). It makes things easier all round, including for yourself.
    1 point
  14. guinness

    mysterious $i & $h

    Did I write that sentence? It doesn't look like something I would say.
    1 point
  15. BrewManNH

    #Region ???

    Another use for the #Region/#EndRegion tags are if you use Tidy on your script and you use the sort functions by name options. If you want to keep certain functions together, and still sorted, you would put them in between the region tags. What this does is it will sort the functions like this #Region 1st region Func A1 Func B1 Func C1 #EndRegion #Region 2nd Region Func A2 Func B2 Func C2 #EndRegion Normally they would all be sorted like A1->A2->B1->B2 etc. Handy if you have a GUI with tabs and want to keep the control functions together so it's easier to find them instead of having to search for them.
    1 point
  16. Tvern

    #Region ???

    I can't find it in the helpfile either, but I'll try to explain it's use. First of all it doesn't change the way your script behaves. I believe it is stripped when compiling and ignored by the interpeter. Region is just an easy way for the user to specify what a part of the code does. For instance a database program could have a number of functions to read and write, create and edit a database which could be put in #Region Database ... #Endregion. It might also have a few functions to create and update the GUI which could go in #Region GUI ... #EndRegion. And it might have a few functions to check it's website for updates, download them and apply them in #Region Update ... #Endregion. These regions can be collapsed so the user can easily work on other parts of the code, without having a 4000 line file open. (Making scrolling back and forth a nightmare) I hope thats accurate and clear. Edit: Need a spellchecker. @BrewMan : That's handy. I didn't realise that works.
    1 point
  17. For the opening of scripts to be folded by default, then add this into your User Options file and save. # Folding # enable folding, and show lines below when collapsed. fold=1 fold.compact=1 fold.flags=16 fold.symbols=2 fold.on.open=1 fold.comment=1 fold.preprocessor=1 These are the options that I currently use. Use Megas' method as needed while the file is open.
    1 point
×
×
  • Create New...