Jump to content

Search the Community

Showing results for tags 'formula'.

  • 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 3 results

  1. What i have done is set Coordinates in xyBox1, xyBox2 and xyBox5 (with MouseGetPos() - The rest of my code works 100%) And instead of going out every time and entering every single box coordinate i figured i would come up with this "Formula" to calculate all the boxes locations by itself from what i have entered for my 3 Variables Everytime i run, it clicks on box 1, 2, 5, 6 and the crashes, skips box 3 and 4 Any Clue? Func FourxSeven() ; 0 Returns the X1 co-ordinate as an integer. ; 1 Returns the Y1 co-ordinate as an integer. Local $xSD = ($xyBox1[1] - $xyBox2[1]) ; (Box1 y - Box2 y) = xAxis - Sideways difference Local $yDD = ($xyBox1[0] - $xyBox5[0]) ; (Box1 x - Box5 x) = yAxis - Downwards Difference MouseClick("Left", $xyBox1[0], $xyBox1[1]) ;#1 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], $xyBox1[1]) ;#2 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD), $xyBox1[1]) ;#3 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2)), $xyBox1[1]) ;#4 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox1[0], $xyBox5[1]) ;#5 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], $xyBox5[1]) ;#6 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD)[0], $xyBox5[1]) ;#7 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2))[0], $xyBox5[1]) ;#8 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox1[0], ($xyBox5[1] + $yDD)[1]) ;#9 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], ($xyBox5[1] + $yDD))[1]) ;#10 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD)[0], ($xyBox5[1] + $yDD)[1]) ;#11 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2))[0], ($xyBox5[1] + $yDD)[1]) ;#12 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox1[0], ($xyBox5[1] + ($yDD * 2))[1]) ;#13 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], ($xyBox5[1] + ($yDD * 2))[1]) ;#14 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD)[0], ($xyBox5[1] + ($yDD * 2))[1]) ;#15 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2))[0], ($xyBox5[1] + ($yDD * 2))[1]) ;#16 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox1[0], ($xyBox5[1] + ($yDD * 3))[1]) ;#17 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], ($xyBox5[1] + ($yDD * 3))[1]) ;#18 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD)[0], ($xyBox5[1] + ($yDD * 3))[1]) ;#19 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2)[0], ($xyBox5[1] + ($yDD * 3))[1]) ;#20 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox1[0], ($xyBox5[1] + ($yDD * 4))[1]) ;#21 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], ($xyBox5[1] + ($yDD * 4))[1]) ;#22 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD)[0], ($xyBox5[1] + ($yDD * 4))[1]) ;#23 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2)[0], ($xyBox5[1] + ($yDD * 4))[1]) ;#24 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox1[0], ($xyBox5[1] + ($yDD * 5))[1]) ;#25 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", $xyBox2[0], ($xyBox5[1] + ($yDD * 5))[1]) ;#26 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + $xSD)[0], ($xyBox5[1] + ($yDD * 5))[1]) ;#27 Box Locations Sleep(Random(590,1390,1)) MouseClick("Left", ($xyBox2[0] + ($xSD * 2))[0], ($xyBox5[1] + ($yDD * 5))[1]) ;#28 Box Locations Sleep(Random(590,1390,1)) Sleep(Random(990, 1990, 1)) EndFunc
  2. Hi, everybody! i'm trying to make a math worksheet generator for kids, but i need it in this format: and generate a PDF file with the math problems.... i know how to generate a problems, but idk how to 'format' this anyone have a ideia how to make this? Thanks a lot. p.s: Here is my sum generator code: Func _Sum_Generator($iMin, $iMax, $iProblems = 100, $iMaxAddends = 2, $bRandomAddends = True, $bUseDecimal = False, $bUseNegative = False) Local $aGenerated[$iProblems][2] If $iMaxAddends < 2 Then $iMaxAddends = 2 For $i = 0 To $iProblems -1 $aGenerated[$i][1] = 0 $iAddends = $iMaxAddends -1 If ($bRandomAddends And $iMaxAddends > 2) Then $iAddends = Random(2, $iMaxAddends, 1) -1 For $j = 0 To $iAddends Local $iOnlyInt = 1, $Negative = 0 If $bUseDecimal Then $iOnlyInt = Random(0,1,1) If $bUseNegative Then $Negative = Random(0,1,1) Local $iRandom = Round(Random($iMin, $iMax, $iOnlyInt), 2) If $Negative Then $iRandom *= -1 If $j = $iAddends Then $aGenerated[$i][0] &= String($iRandom) & " = " Else $aGenerated[$i][0] &= String($iRandom) & " + " EndIf $aGenerated[$i][1] += $iRandom Next Next Return $aGenerated EndFunc
  3. Hello folks, Fairly new to AutoIt, but I've done a few scripts. However, this is my first dealing with Excel. I'm getting an AutoIt error when writing a formula ($add1) to Excel via _ExcelWriteFormula. As for the cell references in this formula; the column number would be static, but the row number is stored in a variable ($iNextRow). I write an array just before the formula and it works fine. Also, MsgBox will display the correct formula stored in $add1. Any thoughts? Thanks in advance, guys! #include <Excel.au3> #include <EditConstants.au3> #include <Misc.au3> #include <Date.au3> #include <GUIConstantsEx.au3> #include <Array.au3> Global $sFilePath = @ScriptDir & "\Shipment Log.xlsx" Global $oExcel = _ExcelBookOpen($sFilePath, 0) #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Shipment Log", 300, 300) $Input1 = GUICtrlCreateInput(_NOWDATE(), 10, 30, 75, 21) $Input2 = GUICtrlCreateInput("", 10, 80, 270, 21) $Input3 = GUICtrlCreateInput("", 10, 130, 270, 21) $Input4 = GUICtrlCreateInput("", 10, 180, 270, 21) $Input5 = GUICtrlCreateInput("", 10, 230, 270, 21) $Label1 = GUICtrlCreateLabel("Today's Date:", 10, 10, 100, 17) $Label2 = GUICtrlCreateLabel("Location:", 10, 60, 55, 17) $Label3 = GUICtrlCreateLabel("Contact(s):", 10, 110, 55, 17) $Label4 = GUICtrlCreateLabel("Item Description(s):", 10, 160, 100, 17) $Label5 = GUICtrlCreateLabel("Item QTY(s):", 10, 210, 75, 17) $Button1 = GUICtrlCreateButton("Submit", 10, 260, 120, 30) GUISetState() #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _ExcelBookClose($oExcel, 0) Exit Case $Button1 Local $fVisible Local $avData = _ExcelReadArray($oExcel, 1, 1, 1000, 1, 1) Local $iLastUsed = 0, $iNextRow = 0 _WriteOrderID() Local $add1 = "=VLOOKUP($C" & $iNextRow & ",LocationAddresses!$A$2:$G$65,2,FALSE)" ;Variable with Excel formula I'm trying to write Local $aArray[6] = [$iNextRow, GUICtrlRead($Input1), GUICtrlRead($Input2), GUICtrlRead($Input3), GUICtrlRead($Input4), GUICtrlRead($Input5)] _ExcelWriteArray($oExcel, $iNextRow, 1, $aArray) MsgBox(0,"",$add1) MsgBox(0,"",$iNextRow) _ExcelWriteFormula($oExcel, $add1, $iNextRow, 7) ;ERROR LINE _ExcelBookClose($oExcel, 1) MsgBox(0, @ScriptName, "Record Saved.") GUICtrlSetData($Input2, "") GUICtrlSetData($Input3, "") GUICtrlSetData($Input4, "") GUICtrlSetData($Input5, "") EndSwitch WEnd Func _WriteOrderID() For $n = UBound($avData) - 1 To 1 Step -1 If StringStripWS($avData[$n], 8) <> "" Then $iLastUsed = $n ExitLoop EndIf Next If $iLastUsed Then $iNextRow = $iLastUsed + 1 Else $iNextRow = 1 EndIf $sData = _ExcelReadCell($oExcel, $iLastUsed) + 1 EndFunc
×
×
  • Create New...