Jump to content

myspacee

Active Members
  • Posts

    731
  • Joined

  • Last visited

About myspacee

  • Birthday 09/17/1975

Profile Information

  • Location
    Italy

Recent Profile Visitors

478 profile views

myspacee's Achievements

Universalist

Universalist (7/7)

1

Reputation

  1. Thank you Nine, it seems that #RequireAdmin inhibits ConsoleWrite and exit my cicles (for, while) I lowered my WIN10 UAC to bottom, is this related ? m.
  2. Hello, I have a PC in my living room, it is used as a media hub on my home TV. The computer is hidden in a 'closet' .... it happens to forget the computer turned on after using it and the wardrobe door is closed. In these cases the danger is to leave it on and risk damaging it. Is it possible to intercept the temperatures of the computer (CPU, motherboard) and turn it off at a certain heat threshold? m.
  3. Brew you are right. I need only referred to this year. Can correct this for me ? #include <Date.au3> Dim $Day1 = @YEAR & "/01/01" If $CmdLine[0] = 0 Then $Days = _DateDiff("D", $Day1, _NowCalcDate() ) ConsoleWrite(StringRight("000" & String($Days + 1), 3)) ElseIf $CmdLine[0] = 1 Then ; Julian date of today. Local $sJulDate = _DateToDayValue(@YEAR, @MON, @MDAY) Local $Y, $M, $D $today_doy = _DateDiff("D", $Day1, _NowCalcDate() ) + 1 if number($today_doy) > number($CmdLine[1]) Then consolewrite("today is after : " & number($today_doy) & "-" & number($CmdLine[1]) & " = " & number($today_doy) - number($CmdLine[1]) & @CRLF) $my_datediff = number($today_doy) - number($CmdLine[1]) $doy_sJulDate = _DayValueToDate($sJulDate - $my_datediff, $Y, $M, $D) consolewrite($doy_sJulDate) Else consolewrite("today is before : " & number($CmdLine[1]) & "-" & number($today_doy) & " = " & number($CmdLine[1]) - number($today_doy) & @CRLF) $my_datediff = number($CmdLine[1]) - number($today_doy) $doy_sJulDate = _DayValueToDate($sJulDate + $my_datediff, $Y, $M, $D) consolewrite($doy_sJulDate) EndIf EndIf IF today is > DOY given, I (_DayValueToDate - DatesDiff) ELSEIF today is < DOY given, I (_DayValueToDate + DatesDiff) This logic is correct ?
  4. Hello, need for a command line script that return what date corresponds to the day of the year. (eg: Today 2019/07/29 is 210th day of year, i need to reverse it ) In this mini-script (compiled as console), Autoit return DOY based on today date #include <Date.au3> Dim $Day1 = @YEAR & "/01/01" If $CmdLine[0] = 0 Then $Days = _DateDiff("D", $Day1, _NowCalcDate() ) ConsoleWrite(StringRight("000" & String($Days + 1), 3)) ElseIf $CmdLine[0] = 1 Then ;///////////////////////// ;// MISS idea/code ;///////////////////////// EndIf In my idea, if I give as parameter Doy Of Year to script, it must return date in this format YYYY/mm/dd (eg: script.exe 210 ---> 2019/07/29) Please, can you help me ? Thank you, m.
  5. Hello, try to help at work building a script capable to view PDF from intranet repository. The problem is filenaming; my script solve this problem but i want to show PDF to my user, using Autoit GUI. Read and test mLipok work but it doesn't work well. At first run, script show an error, solved resizing manually the GUI. I read about free activex, but can't install other PDF reader over 200 and more PCs on my workplaces scattered throughout the territory. I need to show PDF and allow copy/paste text, so i can't show JPG of page. Anyone can suggest a solution to show PDF on AI GUI ? Thank you for your time, m.
  6. hello, I need this script as part of onother one. Bigger and with its 'structure'. My fault double sort at end. Thank you again, your solution is more simple than others i try. m.
  7. Adapt to my case : #include <Array.au3> #include<file.au3> Local $Array[0][2] $file = FileOpen(@DesktopDir & '\animals.txt', 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $line_number = StringRegExp($line, '\d+', 1) if @error then $sFill = $line & "|" & "" _ArrayAdd($Array, $sFill) else $sFill = $line & "|" & Number(StringRegExpReplace($line_number[0], "[^0-9]", "")) _ArrayAdd($Array, $sFill) endif WEnd FileClose($file) For $i = 0 to UBound ($array)-1 $array[$i][1]=Number($array[$i][1]) Next _ArraySort ($array, 1, 0, 0, 1) Local $value = $array[0][1], $start = 0 For $i = 1 to UBound ($array)-1 if $value = $array[$i][1] then ContinueLoop $value = $array[$i][1] if $i - $start > 1 then _ArraySort ($array, 0, $start, $i-1, 0) $start = $i Next if UBound ($array) - $start > 1 then _ArraySort ($array, 1, $start, Ubound($array)-1, 0) _ArraySort ($array, 1, $start, Ubound($array)-1, 0) _ArrayDisplay ($array) Thank you! m.
  8. Hello, I try to automate ranking sort. Usually my classifications have votes at the end of line, eg: Bat - 0 Bear - 3 Red Fox - 2 Fox - 1 Lion - 4 Cat - 1 Armadillo - 3 Monkey - 10 my users want to order it and obtain Monkey - 10 Lion - 4 Armadillo - 3 Bear - 3 Red Fox - 2 Cat - 1 Fox - 1 Bat - 0 You can notice, that list is double sorted : - before numeric column - then rows with same vote (eg: cat -> fox) I assemble some code : #include <Array.au3> #include<array.au3> #include<file.au3> Local $aArray_Base[0][2] $file = FileOpen(@DesktopDir & '\animals.txt', 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $line_number = StringRegExp($line, '\d+', 1) if @error then $sFill = "" & "|" & $line _ArrayAdd($aArray_Base, $sFill) else $sFill = Number($line_number[0]) & "|" & $line _ArrayAdd($aArray_Base, $sFill) endif WEnd FileClose($file) _ArrayDisplay($aArray_Base, "$avArray BEFORE _ArraySort()") _ArraySort($aArray_Base, 0, 0, 0, 0) _ArrayDisplay($aArray_Base, "$avArray AFTER _ArraySort() ascending column 0") _ArraySort($aArray_Base, 0, 0, 0, 1) _ArrayDisplay($aArray_Base, "$avArray AFTER _ArraySort() ascending column 1") _ArraySort($aArray_Base, 0, 0, 0, 2) _ArrayDisplay($aArray_Base, "$avArray AFTER _ArraySort() ascending column 2") But I can't understand how use _arraysort... Can you help me, please ? thank you, m.
  9. Thank you, in fact, correcting syntax as suggested, solves also my word delimiters 'problem' .... Autoit command line tool is core of my PHP site: Thank you all for support, m.
  10. StringRegExpReplace($file_input_line, "(div.*?/div)", "") Where div and /div are common HTML codes.
  11. This works. Thank you ! Another question : Is it possible to use StringRegExpReplace with words instead of single symbol ? eg: StringRegExpReplace($file_input_line, "(div.*?/div)", "") Thank you, m.
  12. StringRegExpReplace($file_input_line, "\<(.*)\>", "") generally above; where <> can be symbols that i want. m.
  13. Hello, I'm working on command line tool that manipulate text to extract only info I need. I need this tool to HTML scraping. I don't know how to solve a problem. I've reducing BIG text to strings like this : [Lunedì 04/03]<30466>[16:50]<30467>[19:15]<R4nd0m>[21:20] I need to remove all text inserted in these symbol <> and obtain this : [Lunedì 04/03][16:50][19:15][21:20] But using StringRegExpReplace I obtain this : [Lunedì 04/03][21:20] Can you suggest me some code, or syntax, to solve this issue ? Thank you for your time, m.
  14. Thank you, nice games collection and AI example. I take inspiration grom MADRIGAL work. He builds a simulator from varius handheld. I'm not so smart, but i think that is possible to show 'precalculated' graphic using GDI, eg : I know it's an ambitious project, but can help me to improve my rusty AI. m.
  15. Hello, I want to recreate a game of my childhood, 'Epoch LCD Handheld - Game lost in space' : I Know, it's hard and perhaps useless. But i want to try. Can you suggest how you approach this task ? ( not for programming, only for graphic ) Thank you for any help, m.
×
×
  • Create New...