Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/17/2014 in all areas

  1. ravkr

    SunMoon calculator

    This script calculates information about the Moon and the Sun (position on the sky, rise, transit, set, Moon phase etc.) Just enter your longitude and latitude wait a second Maybe I'll add ISS, asteroids and planets but I don't promise anything. Needed help with translating! If you want to translate it to your language just copy section (eg. [English]) from lang.ini, translate all messages and post it here Download link: http://ravkr.duckdns.org/autoit/sunmoon_v1.zip Report any bugs. Feedback is welcome PS. It's my first script published on this forum
    1 point
  2. taietel

    Window in slide format

    #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #cs <----------------------- $iW -----------------------> | | $iH | | - <--------- $w -------><--- $r ---> | | $p | | - #ce $iW=500 $iH=200 $w=90 $p=25 $r=20 $iFont=16 $bExpand=True ; Create GUI Local $hForm = GUICreate("Test", $iW, $iH+$p, (@DesktopWidth-$iW+$w+$r)/2, -$iH, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xdedede) $hExit = GUICtrlCreateLabel("r", $iW-$r-$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings") GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) $hCfg = GUICtrlCreateLabel("@", $iW-$r-2*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings") GUICtrlSetCursor(-1,0) GUICtrlSetColor(-1, 0x505050) $hExpand = GUICtrlCreateLabel("6", $iW-$r-3.5*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings") GUICtrlSetCursor(-1,0) GUICtrlSetColor(-1, 0x505050) Local $aPoint[9][2] = [[0, 0],[$iW, 0],[$iW, $iH],[$iW-$r,$iH],[$iW-$r-$p/3,$iH+$p],[$iW-$r-$w,$iH+$p],[$iW-$r-$w-$p/3,$iH],[0, $iH],[0, 0]] Local $hRgn = _WinAPI_CreatePolygonRgn($aPoint) _WinAPI_SetWindowRgn($hForm, $hRgn, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $hExit Exit Case $hCfg MsgBox(0,"","You won! What?...") Case $hExpand If $bExpand Then GUICtrlSetData($hExpand,"5") WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, 0, $iW, $iH+$p,5) $bExpand=False Else GUICtrlSetData($hExpand,"6") WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, -$iH, $iW, $iH+$p,5) $bExpand=True EndIf EndSwitch WEnd Try this, see if it fits. (modified: made some changes)
    1 point
  3. mjfoxtrot, Welcome to the AutoIt forum. Using this file: Line 1 | File 1 Line 2 | ****** END OF REPORT ****** Line 4 | File 2 Line 5 | ****** END OF REPORT ****** Line 7 | File 3 Line 8 | Line 9 | Line 10 | Line 11 | ****** END OF REPORT ****** Line 13 | File 4 Line 14 | Line 15 | ****** END OF REPORT ****** Line 17 Line 19 Line 19 the following code splits it as indicated: #include <File.au3> Global $FileArray $file = @ScriptDir & "\test.txt" ;"C:\SBT\Incoming\SBTFILE.txt" $newfile = @ScriptDir & "\split-" ; "C:\SBT\Work\SBTFILE-" _FileReadToArray($file, $FileArray) $filecount = 1 $sNewFile_Text = "" ProgressOn("Processing SBT File", "Reading The File...", "0 Lines") For $i = 1 To $FileArray[0] If StringInStr($FileArray[$i], "****** END OF REPORT ******") Then ; We need to write the current file FileWrite($newfile & $filecount & ".txt", $sNewFile_Text & $FileArray[$i]) ; And start a new one $filecount = $filecount + 1 $sNewFile_Text = "" Else ; Add line to string $sNewFile_Text &= $FileArray[$i] & @CRLF EndIf $Percent = Int(($i / $FileArray[0]) * 100) ProgressSet($Percent, $Percent & " Percent Complete") Next ProgressSet(100, "Done", "Complete") Sleep(1000) ProgressOff() Is that what you are looking for? If not then please post a test file showing how it should be split and I can modify the code. M23
    1 point
×
×
  • Create New...