Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/31/2016 in all areas

  1. wakillon

    Gif2Avi

    An other tool for AutoIt Coders : Gif2Avi permit to convert an animated Gif to an Avi file for use with the (rarely used) GUICtrlCreateAvi function. Use an Avi file as loader or animation in a script (see StringFinder for example) is easier than use an animated gif. With this little tool you can also : _ Set the AVI file dimensions ( height will follow width changes for preserve ratio W/H ) _ Change FPS (frames per second) _ Try an other background color ( used in _GDIPlus_BitmapCreateHBITMAPFromBitmap function) _ Crop width and height (From the original dimension) Thanks to monoceres, Prog@ndy and UEZ for AVI functions. Source and compiled Version are available in the Download Section. May be the "GUICtrlCreateAvi" function will be a bit more used ! Some Links for find or create loaders/spinners preloaders.net loading.io dribbble.com chimply.com tools.bit-hive.com
    2 points
  2. Wyh using a array only for the searchinG of the index. Using _GUICtrlComboBox_FindStringExact or _GUICtrlComboBox_FindString you get also the ID returned you want to delete.
    2 points
  3. Hi This UDF is for anyone who - Object Orientated Programing ie properties and methods in autoIT - needs standards compliant JSON,, - JSON.parse (read) and JSON.stringify (to text ) - Now JSONPath - wants to use dot syntax in AutoIT like you would in Javascript - dosen't like AutoIt arrays - full javascript arrays and objects in AutoIT! - knows javascript or would like to learn autoIT or vice versa. - call javascript functions like EncodeURI - run any javascript from autoIT ! Tested IE8 - IE11. v7 JSON_OO v7.zip - IE free version. ( hey microsoft ditched IE now too!) .- No IE dependencies- Added arrayAdd and arrayDel- JSONPath! for searching.- Added Keys Function - to list properties of a JSON object.- Secure JSON parse- Native Pure JS implementaion not a port.Credits to Douglas Crockford's for JSON2 code and stefan.goessner for JSONPath code. (see example file). v4 - json_oo_v4.zip. - use v7 (v4 may not work because of windows updates on dec-2014. ). v4 uses IEs JSON , so no ported external librariesv4 also includes a Non - IE version of JSON no include files but no stringify and uses javascript EVal (not secure). use v7.eg valid JSON '{ "hello" : "world" }' invalid "{ 'hello' : 'world' }"v4 does not have JSONPath , arrayAdd, arrayDel or keys (properties) methods - use v7 - enjoy ...the brakes come off Autoit . This is the smallest OO extensions for AutoIT Object Oriented JSON --- using JSON to Build Objects in Native AutoIT -- Using JSON to create objects $oJSON = _OO_JSON_Init ( ) $jsObj = $oJSON.parse('{ "hello": "world" }') $jsObj.hello;-> world $oJSON.stringify( $jsObj );-> {"hello":"world"} $jsObj.stringify();-> {"hello":"world"} ARRAYS - goodbye Auto it arrays hooray The real magic in this script is that it lets you access JSON array items by index number through dot syntax without the need for a for-each loop. eg you can go $obj.arr.item(n) It does this by making javascript objects syntax friendly to Autoit. . Also you can go $obj.arr.item("property").and $obj.arr.property & Also $obj.arr.length (see below) -- Using JSON to create one dimentional array $sJSON=[ "h1", "h2", "h3" ] $oResult.length= 3 $oResult.item(0);-> h1 -- Using JSON to create 2 dimentional array; $sJSON=[[1,2],[3,4],[5,6]] $oResult.length= 3 $oResult.item(0);-> $oResult.item(0).stringify();-> [1,2] $oResult.item(2).item(1);-> 6 $oResult.item(2).length;-> 2 -- Using JSON to create an object array $sJSON= [ { "card":"ace" }, {"card":"king" }] $oResult.length= 2 $oResult.item(0).card;-> ace -- Using JSON to create key values $sJSON= { "name":"Jon" , "surname":"who" } $oResult.item("surname");-> who $oResult.surname ;-> who Many other benefits such as building objects using JSON text just like you would in JavaScript Basic OO - Properties and methods -- Add properties to objects in AutoIT $jsObj.propAdd("myProp", "'x'") $jsObj.myProp ;-> x $jsObj.propAdd("myProp", '{ "hello": "world" }') $jsObj.myProp.hello ;-> world -- User Defined methods - using javascript -CASE SENSITIVE $jsObj.methAdd("myMethod", " Function('y','return y*5') " ) $jsObj.myMethod(5) ;-> 25 Some people have problems on 64 bit autoIT windows with the script control...here is the work around.. '?do=embed' frameborder='0' data-embedContent>> You will most likely have the script control ..but here it is.. http://www.microsoft.com/en-us/download/details.aspx?id=1949 --- using JSON to Build Objects in Native AutoIT -- Using JSON to create objects $oJSON = _OO_JSON_Init ( ) $jsObj = $oJSON.parse('{ "hello": "world" }') -- Accessing Items $jsObj.hello;-> world $jsObj.item("hello");-> world -- Using Any Object to create objects $jsObj.stringify();-> {"hello":"world"} $jsObj = $jsObj.parse('{ "goodbye": "world" }') $jsObj.goodbye;-> world -- Read JSON from a file (PC only) - untested $var = _OO_JSON_Read_File("jsondata.txt") $obj = $oJSON.parse($var) > BASIC OO (Object Oriented) programming in Auto it -- Compound Syntax $oJSON.parse( '{ "hello":"world" }' ).hello;-> world -- assigning propeprties $jsObj.parse ( '{ "goodbye": "world" }') $jsObj.goodbye ;-> world $jsObj.goodbye = "hello" $jsObj.goodbye;-> hello > OO Adding Methods and Properties in Auto it -- Add properties to objects in AutoIT $jsObj.propAdd("myProp", "'x'") $jsObj.myProp ;-> x $jsObj.propAdd("myProp", '{ "hello": "world" }') $jsObj.myProp.hello ;-> world -- User Defined methods - using javascript -CASE SENSITIVE $jsObj.methAdd("myMethod", " Function('y','return y*5') " ) $jsObj.myMethod(5) ;-> 25 > Querying Objects $jsObj = $oJSON.parse('{ "hello": "world" , "Goodbye" : "World" } ') $jsObj.type($jsObj) ->object $jsObj.isArray() ->False -- List object properties or "keys" $jsObj.keys($jsObj).stringify() ->["hello","Goodbye"] -- Querying Objects $jsObj = $jsObj.parse({ "hello" : "world" , "myarray" : [ "item0", 2 , { "jon" : "who"} ] }) > JSON path - always returns an array of matches $jsObj.jsonPath( "$.*").stringify() -> ["world",["item0",2,{"jon":"who"}]] $jsObj.jsonPath( "$..hello").stringify() -> ["world"] $jsObj.jsonPath( "$..myarray").stringify() ->[["item0",2,{"jon":"who"}]] $jsObj.jsonPath( "$..myarray[?(@.jon)]").stringify() ->[{"jon":"who"}] $jsObj.jsonPath( "$..myarray[?(@.jon)]").item(0).stringify() ->{"jon":"who"} > Basic Arrays using JSON -- Querying Arrays $jsObj.myarray.stringify() ->["item0",2,{"jon":"who"}] $jsObj.type($jsObj.myarray) ->object $jsObj.myarray.isArray() ->True $jsObj.myarray.length ->3 $jsObj.type($jsObj.myarray.item(0)) ->string $jsObj.type($jsObj.myarray.item(1)) ->number $jsObj.type($jsObj.myarray.item(2)) ->object > Modifying Arrays using OO -- Empty array; $jsObj = $oJSON.parse('[]') $jsObj.stringify() ->[] $jsObj.isArray( ) ->True -- Add items; $jsObj.arrayAdd( 0, "test0") $jsObj.arrayAdd( 1, "test1") $jsObj2 = $oJSON.parse( '{ "hello" : "world" }') $jsObj.arrayAdd( 2, $jsObj2) $jsObj.stringify() ->["test0","test1",{"hello":"world"}] -- Delete items; $jsObj.arrayDel( 0) $jsObj.stringify() ->["test1",{"hello":"world"}] -- Using JSON to create one dimentional array $sJSON=[ "h1", "h2", "h3" ] $oResult.length= 3 $oResult.item(0);-> h1 -- Using JSON to create 2 dimentional array; $sJSON=[[1,2],[3,4],[5,6]] $oResult.length= 3 $oResult.item(0);-> $oResult.item(0).stringify();-> [1,2] $oResult.item(2).item(1);-> 6 $oResult.item(2).length;-> 2 -- Using JSON to create an object array $sJSON= [ { "card":"ace" }, {"card":"king" }] $oResult.length= 2 $oResult.item(0).card;-> ace -- Using JSON to create key values $sJSON= { "name":"Jon" , "surname":"who" } $oResult.item("surname");-> who $oResult.surname ;-> who > Working with OO Objects -- assigning JSON objects in AutoIT $jsObj = $oJSON.parse( '{ "hello" : "world" }') $jsObj2 = $oJSON.parse( '{}' ) $jsObj2 = $jsObj $jsObj.hello;-> world $jsObj2.hello;-> world -- Assign an JSON object to a property $jsObj = $oJSON.parse( '{ "hello" : "world" }') $jsObj.hello ;-> world $jsObj2.propAdd("myProp") $jsObj2.myProp = $jsObj $jsObj2.myProp ;-> $jsObj2.myProp.stringify() ;-> {"hello":"world"} $jsObj2.myProp.hello ;-> world -- Using Existing JS Objects , Object must exist in the scripting object (not IE) $oJSON2 =$jsObj.objGet('JSON') ; objGet is javascript eval $oResult = $oJSON2.parse('{ "hello":"world" }') $oResult.hello;-> world > Using Javascript functions extending UDF -- Calling javascript standard functions $jsObj.jsFunAdd( "encodeURI") $jsObj.encodeURI( 'te st' );-> te%20st $jsObj.protoAdd("encodeURI", " function (s) { return encodeURI(s); } " $jsObj.encodeURI( 'te st' );-> te%20st -- Calling javascript literal methods $str_obj = $jsObj.toObj("my string") $str_obj.jsMethAdd( "charAt") $str_obj.charAt( 0 );-> m $jsObj.toObj('\"my string').charAt(0) ;-> \ $str_obj.jsFunAdd( "charAt") $str_obj.charAt( 0 );-> m $jsObj.jsMethAdd("toFixed" ) $jsObj.toObj(5.56789).toFixed(2) ;-> 5.57 $jsObj.jsMethAdd("concat" , 3 ) $jsObj.toObj('hello').concat( ' world', ' again ', ' and again ' ) ;-> hello world again and again $jsObj.dot("\""'my string", "charAt(0)" );-> \ > depreciated syntax -- depreciated syntax - previous UDFs $jsObj = _JS_obj_create ( '{ "hello": "world" }') ; invalid "{ 'hello':'world'}" $jsObj.hello ;-> world $jsObj.objToString();-> {"hello":"world"} $jsObj.strToObject ( '{ "goodbye": "world" }') $jsObj.goodbye ;-> world -- Close IE explorer.exe instance - not required anymore _OO_JSON_Quit ( ) -- Objects still usable after _OO_JSON_Quit closes $jsObj.goodbye ;-> world Example script output; see example file ; enjoy
    1 point
  4. wakillon

    Gif2Avi

    eukalyptus example is great, thanks ! May be you need to be admin for use Drag'n'drop ? Conversion or Conversation For the compression unfortunatelly GuiCtrlCreateAvi (after many tries with other formats) only support uncompressed "DIB " format (Microsoft Device Independent Bitmap) The only interest is that no codec is required.
    1 point
  5. using the IE.au3 i suggest _IELinkGetCollection will be easiest solution.
    1 point
  6. Turtlix21, If you are just using the array to search you should use AutoBert suggestion. I assumed that you could be using the array for other purpose. #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GuiComboBox.au3> #include <Array.au3> $Window = GUICreate("Window", 540, 600) GUICtrlCreateLabel("Autorzy:", 5, 36) $Autor = GUICtrlCreateCombo("", 44, 33, 388) $Add = GUICtrlCreateButton("Add", 435, 30, 50) $Delete = GUICtrlCreateButton("Delete", 485, 30, 50) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Add $StringAdd = StringStripWS(GUICtrlRead($Autor), 3);..............................................Deleting White Characters before and after string $SearchingAdd = _GUICtrlComboBox_FindStringExact($Autor, $StringAdd) If StringIsSpace($StringAdd) <> 1 And $SearchingAdd = -1 Then;...................................Checking isn't the string white character only and isn't occured in array _GUICtrlComboBox_AddString($Autor, $StringAdd);....Adding string to ComboBox EndIf Case $Delete $StringDelete = StringStripWS(GUICtrlRead($Autor), 3);...........................................Deleting White Characters before and after string $SearchingDelete = _GUICtrlComboBox_FindStringExact($Autor, $StringDelete) If $SearchingDelete <> -1 Then;..................................................................Checking is string occured in the array _GUICtrlComboBox_DeleteString($Autor, $SearchingDelete);.....................Deleting string from ComboBox EndIf EndSwitch WEnd Exit
    1 point
  7. The next update includes a new style for the control editor in the formstudio! How do you find it?? The upper area (pos, size and handle) is fixed and visible on all tabpages. PS: I see under Handle are two $ symbols. Ignore that xD
    1 point
  8. OMG - why do some you keep insisting on using pixelsearch? Several of the more experienced people keep pointing out how bad and unreliable it is yet you keep beating that drum.
    1 point
  9. Hello Turtlix21, The command work just fine. Read again the helpfile of the "_GUICtrlComboBox_DeleteString" and you will see that it requires the "Control ID/Handle to the control", not the array. Try this and see if it works for you. #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GuiComboBox.au3> #include <Array.au3> $Window = GUICreate("Window", 540, 600) GUICtrlCreateLabel("Autorzy:", 5, 36) $Autor = GUICtrlCreateCombo("", 44, 33, 388) $Add = GUICtrlCreateButton("Add", 435, 30, 50) $Delete = GUICtrlCreateButton("Delete", 485, 30, 50) GUISetState(@SW_SHOW) Local $AutorCombo[0 + 1][1 + 1] While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Add If StringIsSpace(GUICtrlRead($Autor)) <> 1 And (_ArrayBinarySearch($AutorCombo, GUICtrlRead($Autor)) = -1) Then _ArrayAdd($AutorCombo, GUICtrlRead($Autor)) $AutorCombo[UBound($AutorCombo) - 1][1] = _GUICtrlComboBox_AddString($Autor, GUICtrlRead($Autor)) EndIf Case $Delete $iIndex = _ArrayBinarySearch($AutorCombo, GUICtrlRead($Autor)) MsgBox(0, "", $iIndex) If $iIndex <> -1 Then _GUICtrlComboBox_DeleteString($Autor, $iIndex-1) _ArrayDelete($AutorCombo, $iIndex) EndIf EndSwitch WEnd Exit
    1 point
  10. JLogan3o13

    Number to VarInt

    @algiuxas you have been a member long enough to have read the Forum Rules by now. I suggest you do so before posting again. Especially this bullet point: Launching, automation or script interaction with games or game servers, regardless of the game.
    1 point
  11. Either way, I have added the 500 ms sleep and uploaded a new Beta of AutoIt3Wrapper, so you could start using that and see if that works fine now. Thanks for the testing checking and reporting all of this. Jos
    1 point
  12. faldo

    Remmanaut

    Version 0.2.3

    829 downloads

    Remmanaut, the autoit RMM tool.
    1 point
  13. 1) Line 6 (Global Const $IMAGE_BITMAP = 0, $STM_SETIMAGE = 0x0172) is needed for line 13 -> _WinAPI_DeleteObject( GUICtrlSendMsg( $BackgroundImage, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmapGDI)). 2) The purpose to disable the picture control is that the control is not overlapping other controls when you want to click on it. In this case it is not needed actually. 3) Line 13 sends the GDI bitmap to the picture control. Look at MSDN for a detailed describtion about sendmessage -> http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx. GUICtrlSendMsg() returns a handle which needs to be deleted afterwards done by _WinAPI_DeleteObject (nested calls). 4) Sorry, bad habits to write magic numbers. -2 stands for $GUI_BKCOLOR_TRANSPARENT 5) it releases the bitmap handle Br, UEZ
    1 point
×
×
  • Create New...