Jump to content

ATR

Active Members
  • Posts

    95
  • Joined

  • Last visited

Reputation Activity

  1. Like
    ATR reacted to Floops in Wait until text is visible   
    Wouldn't you have to put the _IEBodyReadText() into the loop aswell? Like this?
     
    Do Sleep(1000) $sText = _IEBodyReadText($oIE) ; or this? --> $sText = _IEPropertyGet("innerText") Until StringInStr($sText, 'Your text')  
  2. Like
    ATR reacted to JLogan3o13 in I meet loop problem   
    @anphat1995 That is what I figured. It appears you strolled right past our forum rules on your way in. I suggest you take a look at them now, especially the section on game automation, and you will see why this thread is now locked. You will not get any assistance on this subject.
  3. Like
    ATR reacted to jguinch in Regex exactly 15 digits   
    So much posts for a so little issue...

    The question was about Regexp, so I just answered with a Regexp solution.
    Now, Melba, DarthCookieMonster and Guinness answered with a different way, which is the simplest way, the way of learning, the obvious way to progress with a script language.
    For these reasons, I think it's a good idea to provide these different solutions, for the asker's interest.
    A lot of us like to use Regexp, but it's a good thing to sometime make a "booster shot".
  4. Like
    ATR reacted to iamtheky in Remove string between numbers   
    $str = fileread("Code_source_html.html") msgbox(0, '' , stringreplace($str , " " , "")) in the string replace instead of space, i typed alt+0160
    and with all spaces including those removed:
    $str = fileread("Code_source_html.html") msgbox(0, '' , stringstripws(stringreplace($str , " " , ""),8))
  5. Like
    ATR reacted to mikell in Remove string between numbers   
    $str = "<tr> <td>30/09/2013</td> <td> 69 290 </td> <td> 9 980 </td> <td></td> </tr> <tr> <td>30/09/2012</td> <td> 46 350 &euro; </td> <td>    1 280 </td> <td></td> </tr> <tr> <td>30/09/2011</td> <td> 12 030 </td> <td> 20 260 </td> <td></td> </tr> </tbody> </table>" $res = StringRegExpReplace($str, '\h*(\d+)[^\d/]+(\d+)[^<]*', '$1$2') msgbox(0,"", $res) ?
  6. Like
    ATR reacted to jchd in Problem with regexp   
    (?is)forme juridique.*?class="tableResult">([^(]*)
  7. Like
    ATR reacted to guinness in Problem with accent   
    I use this function created by me.

    #include <Constants.au3> _INIUnicode(@ScriptDir & '\myINI.ini') Func _INIUnicode($sINI) If FileExists($sINI) = 0 Then Return FileClose(FileOpen($sINI, $FO_OVERWRITE + $FO_UNICODE)) Else Local Const $iEncoding = FileGetEncoding($sINI) Local $fReturn = True If Not ($iEncoding = $FO_UNICODE) Then Local $sData = _GetFile($sINI, $iEncoding) If @error Then $fReturn = False EndIf _SetFile($sData, $sINI, $FO_APPEND + $FO_UNICODE) EndIf Return $fReturn EndIf EndFunc ;==>_INIUnicode Func _GetFile($sFile, $sFormat = $FO_READ) Local Const $hFileOpen = FileOpen($sFile, $sFormat) If $hFileOpen = -1 Then Return SetError(1, 0, '') EndIf Local Const $sData = FileRead($hFileOpen) FileClose($hFileOpen) Return $sData EndFunc ;==>_GetFile Func _SetFile($sString, $sFile, $iOverwrite = $FO_READ) Local Const $hFileOpen = FileOpen($sFile, $iOverwrite + $FO_APPEND) FileWrite($hFileOpen, $sString) FileClose($hFileOpen) If @error Then Return SetError(1, 0, False) EndIf Return True EndFunc ;==>_SetFile
  8. Like
    ATR reacted to BrewManNH in Litle problem with a number rounded...   
    I see what you're saying now, simple fix. Change every instance of $Temps in the calculations to $Temps_km and it works out correctly. It just so happened that the distance figure he used in his example made the calculations the same for either variable.
    Here's the updated script using the correct figures.


    $Distance = 10000 $Heures = 1 $Minutes = 60 $Secondes = 65 ; Calcul du temps en secondes : $Temps = (($Heures * 3600) + ($Minutes * 60) + $Secondes); Calcul de la vitesse en km/h : $Vitesse = Round((($Distance / $Temps) * 3.6), 1) ; Calcul du temps au km : Temps = Distance / vitesse ; Calcul du temps au km : Temps = Distance / vitesse $Temps_km = (1000 * $Temps) / $Distance ; Temps en secondes $Temps_km_h = Int($Temps_km / 3600) ; OK $Temps_km_m = Int(($Temps_km - ($Temps_km_h * 3600)) / 60) $Temps_km_s = Int(($Temps_km - ($Temps_km_h * 3600) - ($Temps_km_m * 60))) ConsoleWrite("Temps ensecondes : " & $Temps & @CRLF & "Vitesse en km/h : " & $Vitesse & @CRLF & "Temps au km : " & $Temps_km_h & " h " & $Temps_km_m & " m " &$Temps_km_s & " s" & @CRLF) Also, yes it would be much simpler to read it if you use variables to hold the intermediate calculations, but the results are the same.
  9. Like
    ATR reacted to Juvigy in Instance of Excel in background   
    You have 2 options.
    Check this topic:

×
×
  • Create New...