Jump to content

Search the Community

Showing results for tags 'Number'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 12 results

  1. hello evrybody here is an example about how to split your texts using a delimiter with the ability to select how much of delimiters shows in each colum with $i_number e.g you have a long text and you want to split it in an array that evry colum have a number (n) of lines i made a function that do that for you just call it with a three params $s_text your text $i_number the number that you want to put in each col $s_siparator the siparator default is "|" here is the function with example i hope that it will be useful for you **** #include <Array.au3> $s_txt = "some text1some text2|some text3|some text4|some text5|some text6" $array = splitText($s_txt, 2) _ArrayDisplay($array) Func splitText($s_text, $i_number, $s_siparator = "|") Local $a_TXT = StringSplit($s_text, $s_siparator) Local $a_Return[$a_TXT[0] + 1] If ($a_TXT[0] <= $i_number) Or ($i_number <= 0) Then ReDim $a_Return[2] $a_Return[0] = 1 $a_Return[1] = $s_text Return $a_Return EndIf Local $i_Processed = 1, $i_arrayProcessed = 1 Do For $i = $i_Processed To ($i_Processed + $i_number) - 1 If ($a_TXT[0] < $i) Then ExitLoop If Not ($a_Return[$i_arrayProcessed]) Then $a_Return[$i_arrayProcessed] = $a_TXT[$i] Else $a_Return[$i_arrayProcessed] &= $s_siparator & $a_TXT[$i] EndIf $i_Processed += 1 Next $i_arrayProcessed += 1 Until ($a_TXT[0] < $i_Processed) ReDim $a_Return[$i_arrayProcessed] $a_Return[0] = $i_arrayProcessed - 1 Return $a_Return EndFunc ;==>splitText accept my greetings thanks to @Dan_555 for his notes
  2. Hi, i have a variable (floating number - could be positive or negative), i wish to print it into a text file, how can i keep the format in such a way that it always has 4 digits ahead of decimal and 2 after decimal basically i have total 7 columns in the text file to print the variable ; eg: variable = 1.235, output requied = 0001.24 variable=-23.55555, output required =-023.56
  3. I want the number in a file to be overwritten with the next number up each time a button is pressed. So it is pressed once, the number '1' is written to the file. It is pressed again and the number '2' overwrites the first number. At the moment I get the number 1 written, but can't get it to overwrite. What I have so far: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #Region ### START Koda GUI section ### Form=C:\Users\soulf\Desktop\CalcGui\RLCalc.kxf $Form1 = GUICreate("Form1", 615, 437, 426, 141) $One = GUICtrlCreateButton("1", 32, 72, 25, 25) GUICtrlSetBkColor(-1, 0xFF0000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func First ()     $fPath = "C:\temp\First.txt"     $fOpen = FileOpen ($fPath, 2)     $Counter = FileReadLine ($fpath)     $counter = $counter + 1     $fWrite = filewriteline ($fPath, $counter)     FileClose ($fpath) EndFunc While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $One             Call ("First")     EndSwitch WEnd I tried a Do Until statement, but that just puts the numbers 1 to 5 in the file. Any help would be greatly appreciated!
  4. Hello! After watching a whole day of "Journey into cryptography" at Khan Academy, I have got to know the secrets behind some sneaky things! . This is one of em', A PRNG (Pseudo Random Number Generator). Its features (atleast what I believe) are: Simple, short and crappy. Great for beginners who are baffled by the mechanics of random number generation in computers! Support for custom seeds! EIGHT DIGITS OF RANDOMNESS!!! Unlike all other PRNGs, This one is predictable 1000 possible PRNs when using @MSEC as the seed. No option for min or max, the min is 10000000 and the max is 99999999. The Unlicensed . #cs LICENSE This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org/> #ce LICENSE ; #FUNCTION# ==================================================================================================================== ; Name ..........: MiddleSquareRandom ; Description ...: Pseudo-random number generator based on the infamous "Middle Sqaure" method. ; Syntax ........: MiddleSquareRandom([$iSeed = @MSEC]) ; Parameters ....: $iSeed - [optional] A seed for generation of the random number. Default is @MSEC. ; Return values .: A pseudorandom 8 digit integer. ; Author ........: John von Neumann ; Modified ......: Damon Harris (TheDcoder) - Conversion into AutoIt and simplification + further crappification. ; Remarks .......: Fun Fact - The output is based on the $iSeed passed, Same $iSeed = Same pseudo-random number. ; Related .......: Random() ; Link ..........: https://en.wikipedia.org/wiki/Middle-square_method ; Example .......: ConsoleWrite(MiddleSquareRandom() & @CRLF) ; =============================================================================================================================== Func MiddleSquareRandom($iSeed = @MSEC) Local Const $TURNS = 8 Local $sRandomNumber, $sSeed For $iTurn = 1 To $TURNS $iSeed = $iSeed * 2 $sSeed = String($iSeed) $sRandomNumber &= StringMid($sSeed, Ceiling(StringLen($iSeed) / 2), 1) Next Return Int($sRandomNumber) EndFunc Enjoy your numbers, TD . P.S NEVER USE THIS FUNCTION IN A REAL WORLD IMPLEMENTATION OF SOMETHING WHICH USES RANDOM NUMBERS!!! THIS ONE IS VERY UNSUITABLE FOR THAT PURPOSE! READ THE POSTS BELOW FOR MORE INFORMATION.
  5. Hey there I'm thinking about making a program that will calculate with huge numbers. Well above 1*10^18 probably. Can autoit deal with that? If not, how can I make it work? Thanks!
  6. I have been scratching my head for a while trying to think of an application for the following behaviour: ConsoleWrite(Number('10 green bottles') & @LF) ; prints 10I feel like I'm missing out on some secret information. I know it's been discussed previously, but in what context does this apply? - Got any ideas?
  7. Well Hello, I currently a bit sad because i can't find anywhere in helpfiles and google away in autoit to check if a number between another number is the same as 4 variables which is checking if the main variable got the same princip of looking >.<.( I really can't explain it at all) Case $Send2Box $ReadText2Box = GuictrlRead($Text2Box) _GUICtrlEdit_AppendText($Console, $ReadText2Box & @CRLF) If $ReadText2Box = '/ping ' & $ip1 & '.' & $ip2 & '.' & $ip3 & '.' & $ip4 Then $IP = StringRight('/ping ', 1) $Ping = Ping($IP) _GUICtrlEdit_AppendText($Console,'Ping is: ' & $Ping & 'ms') GUICtrlSetData($Text2Box,'') EndIfNext try to explain ^-^ i want to check if the text in the inputbox($Text2Box which is read from $ReadText2Box) the same looking like a ip but with a '/ping ' before and i don't know how to make the variables to check this.. and getting after it checked that it is truly a IP to ping it and send it to $Console to display the ms I hope i could explained it anyway to understand it(if i write more i am getting more confused) Thanks to everyone who try's to help me
  8. Seems like Int function works incorrect sometimes. Int of binary data works fine on 1-byte data only. 2+ byte data always returns incorrect results. Int of 4-byte binary data and it's string representation: Int of 4-byte binary data returns bswap as result. Int64 of string representation of 4-byte binary data returns 32-bit signed integer. $bin = Binary('0xff'); 1 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd8'); 2 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d'); 3 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8a'); 4 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abc'); 5 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abcd1'); 6 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abcd1e5'); 7 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abcd1e5ff'); 8 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) AutoIt 3.3.12.0 x86 and x64 OS: Win 7 x64 SP1
  9. Wondering about the possible ways to find a particular forum topic solely base on a given topic-number. Not working for example: (Space in '/ /' is intentional.) - http:/ /www.autoitscript.com/forum/topic/<number> - http:/ /www.autoitscript.com/forum/topic?<number> - 1) Using the BBC ... tag in forum editor and previewing the message. -- Pro: works. -- Con: only available to registered forum users. (major con in my view.) - 2) ? --- Note: remove the space in 'http:/ /www...' part. --- Topic Solved, and considered closed.
  10. Hi, I have searching in the forum but i don't have find nothing. How to add a progressive number to a ConsoleWrite? Example: Func Test() Local $Position = MouseGetPos() While $Final = MouseGetPos() If _IsPressed("01") Then ConsoleWrite("X Pos: " & $Final[0] & @CRLF & "Y Pos: " & $Final[1] & @CRLF) EndIf Sleep(100) WEnd EndFunc ;==>Test The output is: X Pos: 488 Y Pos: 345 X Pos: 674 Y Pos: 9 etc. I'd like to add a progressive number, like: X Pos_001: 488 Y Pos_001: 345 X Pos_002: 674 Y Pos_002: 9 etc. Hope everything is clear, thanks
  11. First off I tried searching both the forums and the help file and I just know it's in one of them. If somebody could please help me find it I would be much grateful. Simply put, I am trying to increment a number that is read from an ini file. The script is to read the initial value, add one to it, and save the new value. The area dealing with this is the last line of code below. Here is my code: #Include <Restart.au3> Global $CommandIni = "DropRun.ini" ; Check that CommandIni exists, if not create file with default values. If FileExists($CommandIni) Then Global $Commands = IniReadSection($CommandIni, @ComputerName) IniWrite($CommandIni, @ComputerName & "_Log", "Start", $CommandIni & " found and read.") Else Local $defCmds[2][2] = [ ["Completed", "1"], ["Command1", "cmd.exe"] ] IniWriteSection($CommandIni, @ComputerName, $defCmds, 0) IniWrite($CommandIni, @ComputerName & "_Log", "Error", $CommandIni & " not found. Attempted to create file.") EndIf ; Check if already completed, if not run the commands. If $Commands[1][1] = "0" Then IniWrite($CommandIni, @ComputerName & "_Log", "Reading", "Entered Command section.") For $i = 2 To $Commands[0][0] ; Check if line is commented out. If StringInStr($Commands[$i][0], ";") Then ContinueLoop Local $exitCode = RunWait($Commands[$i][1]) IniWrite($CommandIni, @ComputerName & "_Log", "Command" & $i-1, $exitCode) Next IniWrite($CommandIni, @ComputerName, "Completed", "1") EndIf Sleep(300000) ; Log number of times script restarted. $Restarts = IniRead($CommandIni, @ComputerName & "_Log", "Restarts", "0") IniWrite($CommandIni, @ComputerName & "_Log", "Restarts", $Restarts+1) _ScriptRestart()The script uses the Also, if anybody has suggestions on how to simplify this I'd also greatly appreciate it. P.S. Sorry I couldn't get the code to paste pretty =S
  12. Trying to put in a GUI(textbox) and want it to get the information only if the input is numbers --------------- Case $Start_button $var[2] = GUICtrlRead($TimeoutInput) If $TimeoutInput = ???? --------------- Anyone? =)
×
×
  • Create New...