Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2015 in all areas

  1. Melba23

    A New Moderator

    Hi, For those of you still using monochrome monitors, or who have some degree of colour-blindness, I would like to announce that we have a new forum Moderator - JLogan3o13. He has kindly agreed to join the Mod team and I would like to take this opportunity to welcome him - I am sure you will all join with me in wishing him well , because he will certainly need it! M23
    8 points
  2. Yay! It took me about 6 hours straight, but I ported everything. And it does actually compile (the port that is). This is the minimal example we will use to iron out all remaining bugs: link GUI entry main func main() { // here be code. }This should generate a 2.048 byte file that when run does nothing. Needless to say, it doesn't work (yet) using the port. The port compiles fine but outputs a corrupted and misaligned 2.050 byte file. If you take a look at the hex dumps from both outputs, they are essentially the same, apart from a few byte-errors. That's whats next - fixing those errors. You can find the running port, the hex dumps and everything else in the official repo. Don't read or care about the ; TODO(minx): blah... comments yet, that's just for the future me . I'll start debugging some time later this weekend.
    2 points
  3. Jon

    AutoIt (Latest Stable Version)

    Version v3.3.16.1

    50,336 downloads

    This is the current stable version of AutoIt. What's new: Changelog. Main AutoIt download page (for AutoIt and other tools like the script editor).
    1 point
  4. Gianni

    $oIE source into txt

    You have to use "1" as last parameter in your _IECreate statement cause you have to wait that the page is ready before you can get his source, otherwise, if you set that parameter to 0, script goes ahead also if the source of the page is still not loaded and the and the _IEDocReadHTML function will fail. #include <IE.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> Local $oIE = _IECreate("https://www.autoitscript.com",0,0,1) ; use 1 as last parameter Local $sHTML = _IEDocReadHTML($oIE) MsgBox($MB_SYSTEMMODAL, "Document Source", $sHTML) ; now save source to a file Local $sFilePath = @TempDir & "\PageSource.html" $hMyfile = FileOpen($sFilePath, $FO_OVERWRITE) FileWrite($hMyfile, $sHTML) FileFlush($hMyfile) FileClose($hMyfile) ShellExecute($sFilePath) ; open saved page to a browser Edit: You can also get the HTML source of a web page using commands like InetGet(), InetRead(), _INetGetSource(), _IEDocReadHTML()
    1 point
  5. Gianni

    $oIE source into txt

    Have a look to the _IEDocReadHTML function
    1 point
  6. Local $Data, $NewData;variable placeholder for selected text While 1; make a loop to keep the script running inefinately WinActive(name of your program);You will probably want to use this to make the screen with the text the active window Send("^c");Send Ctrl + C to copy the copied text sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons If $NewData == $Data Then Click_1() $Data = $NewData EndIF IF $NewData == 0.00 Then Click_2() $Data == $NewData EndIF Sleep(1000);pause the program for 1 second so it doesn't overuse your processor. WEnd Func Click1() MouseClick("",x1,y1) EndFunc Func Click_2() MouseClick("",x1,y1) EndFuncHaven't tested this but it is how I would write what you are explaining.
    1 point
  7. I am halfway there, as the the content doesnt matter so much as the declaration. And that could be fixed first thing in the func to redim both inputs to the max necessary value. But making dimensions not matter, that sounds like an astrophysics exercise for Czardas. Local $aFirst[5][9] = [[5, 5, 6, 7, 1], [8, 9, 10, 1, 0], [11, 14, 15, 1, 0], [16, 17, 18, 1, 0]] Local $aSecond[3][9] = [[1, 3, 4, 4, 6, 7, 8, 9 , 0] , [1, 3, 4, 6, 2, 3, 9] , [1 , 2 ,3]]
    1 point
  8. one more shot at this, I would assume that boundaries had been validated prior. #include <Array.au3> Local $aFirst[5][5] = [[5, 6, 7, 1, 0], [8, 9, 10, 1, 0], [11, 14, 15, 1, 0], [16, 17, 18, 1, 0] , [17, 17, 17, 17, 0]] Local $aSecond[4][5] = [[1, 3, 4, 4, 6] , [2, 6, 8, 4, 6] , [1, 3, 4, 4, 6] , [1, 3, 4, 4, 6]] ;~ _ArrayDisplay($aSecond) $timer = timerinit() $aRowSmash = _2Dsmash($aFirst , $aSecond, 0) $diff = timerdiff($timer) _ArrayDisplay($aRowSmash , $diff) $timer = timerinit() $aColumnSmash = _2Dsmash($aFirst , $aSecond, 1) $diff = timerdiff($timer) _ArrayDisplay($aColumnSmash , $diff) Func _2Dsmash($aBase , $aAdd , $flag = 0) If $flag = 0 Then redim $aBase[ubound($aBase) + ubound($aAdd)][ubound($aBase, 2)] For $k = 0 to ubound($aAdd) - 1 For $i = 0 to ubound($aBase , 2) - 1 $aBase[ubound($aBase) - ubound($aAdd) + $k][$i] = $aAdd[$k][$i] Next Next Else redim $aBase[ubound($aBase , 2)][ubound($aBase) + ubound($aAdd)] For $k = 0 to ubound($aAdd) - 1 For $i = 0 to ubound($aBase) - 1 $aBase[$i][ubound($aBase , 2) - ubound($aAdd) + $k] = $aAdd[$k][$i] Next Next EndIf return $aBase EndFunc ;2Dsmash
    1 point
  9. maybe this will help #include <GUIConstantsEx.au3> #include <StructureConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $g_idMemo _Example_Defaults() Func _Example_Defaults() ; Create GUI $hGui = GUICreate("GetOpenFileName use defaults", 400, 296) $g_idMemo = GUICtrlCreateEdit("", 2, 32, 396, 226, $WS_HSCROLL) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") $id_Dialog = GUICtrlCreateButton("Open File", 155, 270, 90, 20) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $id_Dialog $aFile = FileOpenDialog("", @DesktopDir & "\", "(*.ini)") $line = FileReadLine($aFile,2) ;~ Read Line 2 MemoWrite($line) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGui) EndFunc ;==>_Example_Defaults ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite ;~ Read Line 2 in File.ini
    1 point
  10. It work fine for me using Visual Studio 2010 Ultimate. Saludos
    1 point
  11. i got cocky and jacked up columns the same way rows were jacked up before, I'll fix that during american football later. Rows should be fine though.
    1 point
  12. It might turn out to be quite complicated but I'll have a go. Like I said I need to think about it first - edge case limitations on maximum available elements in all dimensions need to be tested. Then error checks can be put in place and the parsing can begin. The returned array will have the minimum number of dimensions needed to hold all the elements without corrupting the original ordered sequences. It sounds fun - in theory at least.
    1 point
  13. @czardas , That's great. An "array Concatenate function which doesn't care how many dimensions".
    1 point
  14. You guys are inspiring me. I might have a go at a super arrayConcatenate function which doesn't care how many dimensions there are in either array. The concept is just to create the elements and add the data at the first available opportunity. It might be convenient to imagine a one dimension array as a multi-dimensional array with only one entry in all other dimensions, like so ==> $a1[2] ~ $a2[2][1] ~ $a3[2][1][1] ~ $a4[2][1][1][1] etc... All these arrays have exactly 2 elements. Needs further thought.
    1 point
  15. Danyfirex

    Text To Binary

    I edit an Ascend4nt's code and got this: _StringToBase('LÖS7Õ¿—ÑëÜzþš‡gËÑ') Func _StringToBase($sString) Local $iTopBit,$sBinString = "" Local $iUnsignedNumber=0 ; Maximum 32-bit # range is -2147483648 to 4294967295 For $i= 1 to StringLen($sString) ; Any number <0 or >2147483647 will have the 32nd (top) bit set $iNumber= Asc(StringMid($sString,$i,1)) If $iNumber<-2147483648 Or $iNumber>4294967295 Then Return SetError(1,0,"") If $iNumber>2147483647 Or $iNumber<0 Then $iTopBit=1 Else $iTopBit=0 EndIf ; Remove topbit, otherwise the function will enter an endless loop $iUnsignedNumber=BitAND($iNumber,0x7FFFFFFF) ; Cycle through each bit, shifting to the right until 0 Do $sBinString = BitAND($iUnsignedNumber, 1) & $sBinString $iUnsignedNumber = BitShift($iUnsignedNumber, 1) Until Not $iUnsignedNumber ConsoleWrite(chr($iNumber) & "=" & Stringright($iTopBit & StringRight("000000000000000000000000000000" & $sBinString,31),8) & @CRLF) $sBinString="" Next EndFunc ;==>_NumberToBinary Output: L=01001100 Ö=11010110 S=01010011 7=00110111 Õ=11010101 ¿=10111111 —=10010111 Ñ=11010001 ë=11101011 Ü=11011100 z=01111010 þ=11111110 š=10011010 ‡=10000111 g=01100111 Ë=11001011 Ñ=11010001Saludos
    1 point
  16. kcvinu, Then we just convert the array inside the function like this: #include <Array.au3> Global Enum $eAddRow, $eAddCol Global $aBase[3][3] = [["0-0", "0-1", "0-2"], _ ["1-0", "1-1", "1-2"], _ ["2-0", "2-1", "2-2"]] Global $aAdd[3] = ["A", "B", "C"] _ArrayDisplay($aBase, "", Default, 8) $aBaseArray = $aBase _ArrayAdd_Ex($aBaseArray, $aAdd) _ArrayDisplay($aBaseArray, "", Default, 8) $aBaseArray = $aBase _ArrayAdd_Ex($aBaseArray, $aAdd, $eAddCol) _ArrayDisplay($aBaseArray, "", Default, 8) Func _ArrayAdd_Ex(ByRef $aBaseArray, $aAdd, $iLocation = $eAddRow) Local $aAdd2D[1][UBound($aAdd)] For $i = 0 To UBound($aAdd) - 1 $aAdd2D[0][$i] = $aAdd[$i] Next If $iLocation = $eAddCol Then _ArrayTranspose($aBaseArray) _ArrayAdd($aBaseArray, $aAdd2D) If $iLocation = $eAddCol Then _ArrayTranspose($aBaseArray) EndFuncM23
    1 point
  17. mine had an error as well, $k was looping on the wrong ubound, i believe this fixes that #include <Array.au3> Local $aFirst = [[5, 6, 7, 1, 0], [8, 9, 10, 1, 0], [11, 14, 15, 1, 0], [16, 17, 18, 1, 0]] Local $aSecond = [[1, 3, 4, 4, 6]] $timer = timerinit() $aRowSmash = _2Dsmash($aFirst , $aSecond, 0) consolewrite(timerdiff($timer) & @CRLF) _ArrayDisplay($aRowSmash) Func _2Dsmash($aBase , $aAdd , $flag = 0) If $flag = 0 Then redim $aBase[ubound($aBase) + ubound($aAdd)][ubound($aBase, 2)] For $k = 0 to ubound($aAdd) - 1 For $i = 0 to ubound($aBase , 2) - 1 $aBase[ubound($aBase) - ubound($aAdd) + $k][$i] = $aAdd[$k][$i] Next Next Else redim $aBase[ubound($aBase)][ubound($aBase , 2) + ubound($aAdd , 2)] For $k = 0 to ubound($aAdd , 2) - 1 For $i = 0 to ubound($aBase) - 1 $aBase[$i][ubound($aBase , 2) - ubound($aAdd , 2) + $k] = $aAdd[$k][$i] Next Next EndIf return $aBase EndFunc ;2Dsmash
    1 point
  18. That was easy I just had to copy a few lines from another script.
    1 point
  19. Hi Beardeus, Welcome to the forums ! here is little prog I have been working on that may help you..
    1 point
  20. kcvinu, Thanks. for clarifying your remark. The example I posted works fine for me. And I did not forget to return the function, it is passed as a ByRef parameter and so the original array is modified directly from within the function. Perhaps the Variables - using Global, Local, Static and ByRef tutorial in the Wiki might be a useful read. M23
    1 point
  21. Jon

    Can anyone confirm this

    From that snippet, I can't see anything. Must be something else going on.
    1 point
×
×
  • Create New...