
kartune
Active Members-
Posts
25 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by kartune
-
XProTec.au3 = automated Protect and get *Paid*
kartune replied to Valuater's topic in AutoIt Example Scripts
Hi there! Highly interested in implementing this to my software. Is there a simple way to have trial keys that only last 5 days, and premium keys for x amount of days (such as 30)? Thanks! -
INIread into array of variables from dropdown
kartune replied to kartune's topic in AutoIt GUI Help and Support
This is exactly what i needed!!! Thank you so much -
INIread into array of variables from dropdown
kartune replied to kartune's topic in AutoIt GUI Help and Support
Hi! Thanks for the reply and sorry for my late one. Didn't get to work on the script till now. Forgive me i explained the script im trying to create poorly. Though this is a great start. So i need the first dropdown to read and populate from the contents of an .ini Then depending on which selection is made on the dropdown, the 2nd dropdown would read and populate from a section of another .ini I hope this makes any sense haha. -
Hello, I am trying to have Dropdown menu 1 (brands.ini) read from the contents of menu1.ini into an array of selections. When selecting an option from menu1, dropdown menu2 (items.ini) will list specific contents accordingly. For example, ---------------------- brands.ini [Tools] brand1 brand2 brand3 ----------------------- items.ini [Brand] item1=1 [Brand2] item1=20 item2=40 Thank you in advance!
-
Hello, i'm not sure if i should post this question here or in a new topic. Your code and explanations in this thread have been VERY helpful. I've been trying to find a way to use this same method but slightly different where the 2nd dropdown (in this script the "department") will populate a different set of items depending on the first dropdown selection. For example, if the user selects "hospital" from the first drop down, the 2nd drop down will only show values from "hospital.ini" and if the user selects "busman" from the first drop down, the 2nd drop down will only show values from "busman.ini" Would you be able to help with this type of script? Thank you so much in advance!
-
Wow thanks a lot! That's some very nice code
- 3 replies
-
- ini
- subsection
-
(and 3 more)
Tagged with:
-
Hi, i would like to know if there is a possible way to use subsections for ini files? For example, my ini file would look something like this: Clientname.ini [Info] Country=USA Type=Distributor [Costs] [[JAN]] <----- subsection cost1=---- cost2=---- [[FEB]] cost1=---- cost2=---- [Sales] [[JAN]] <----- subsection sale1=---- sale2=---- [[FEB]] sale1=---- sale2=---- [Profits] [[JAN]] <----- subsection prof1=---- prof2=---- [[FEB]] prof1=---- prof2=---- The sales would be inputed everyday by the script, and then whenever viewed, i would be using an array to view every sale/cost/profit under the subsection Thanks for your time!
- 3 replies
-
- ini
- subsection
-
(and 3 more)
Tagged with:
-
array variable has incorrect number of subscripts
kartune replied to kartune's topic in AutoIt General Help and Support
Thank you! I am going to clean up my coding as I learn more and practice :).- 11 replies
-
- array variable
- incorrect
-
(and 2 more)
Tagged with:
-
array variable has incorrect number of subscripts
kartune replied to kartune's topic in AutoIt General Help and Support
It works!!! Thanks a lot guys! I'm so grateful for this forum and the members- 11 replies
-
- array variable
- incorrect
-
(and 2 more)
Tagged with:
-
array variable has incorrect number of subscripts
kartune replied to kartune's topic in AutoIt General Help and Support
Thanks, i will remember that :), new to this forum and also coding. Most of my code is copy pasted and then edited.- 11 replies
-
- array variable
- incorrect
-
(and 2 more)
Tagged with:
-
array variable has incorrect number of subscripts
kartune replied to kartune's topic in AutoIt General Help and Support
sure thing, here it is: [VG] ml=0 [PG] ml=0 [TPA] Apple Candy=100 Bavarian Cream=0 Berry Cereal=0 Blueberry=0 Citrus Punch=0 Clove=0 Coconut Extra=0 Energy Drink=0 Fruit Circles=0 Ginger Ale=0 Graham Cracker Clear=0 Hawaiian Drink=0 Honey Dew=0 Kiwi=0 Menthol=0 MType=0 Papaya=0 Peach=0 Peppermint=0 Ry4=0 Tiramisu=0 Toasted Almond=0 Tobacco=0 Vanilla Bean Ice Cream=0 Vanilla Swirl=0 Watermelon=0 Western=0 [JP] Condensed Milk=0 Garikun=0 Honey Dew=0 Kiwi=0 Matcha=0 Melon Cream Soda=0 Peach=0 Pineapple=0 Strawberry=0 Umeshu=0 Yogurt=0 MType=-0 [CAP] Honey Dew=0 Vanilla Custard=0 [FA] Fresh Cream=0 Meringue=0 Seven Leaves=0 Bavarian Cream=0 [INA] Biscuit=0 (Scroll Up)- 11 replies
-
- array variable
- incorrect
-
(and 2 more)
Tagged with:
-
array variable has incorrect number of subscripts
kartune replied to kartune's topic in AutoIt General Help and Support
Sorry, i just noticed that and corrected it, I am using: SciTE-Lite Version 3.5.4 Sep 18 2015 15:04:36 I will check out the full version and au3check now. Here is the revised code: #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $optbar = IniReadSectionNames("test.ini") If Not IsArray($optbar) Then Exit Local $Button[UBound($optbar) - 1] $mGUI = GUICreate('Restock Flavor Ingredients', 10 + (130 * UBound($optbar)), 100) For $x = 1 To UBound($optbar) - 1 $var = IniReadSection("test.ini", $optbar[$x]) If @error Then ContinueLoop $X_Coord = 10 + (($x - 1) * 100) $Button[$x - 1] = GUICtrlCreateButton($optbar[$x], $X_Coord, 30, 70, 30) Next GUISetState() While 1 $mMsg = GUIGetMsg() If $mMsg = $GUI_EVENT_CLOSE Then GUIDelete($mGUI) ExitLoop EndIf For $i = 0 To UBound($Button) - 1 If $mMsg = $Button[$i] Then MsgBox(0, '$Msg = ' & $mMsg, GuiCtrlRead($Button[$i]) & ' Pressed', 2) Global $flavorco = $Button ; flavor company Call('flavorco') EndIf Next WEnd Func flavorco() ;opened flavor companys flavors MsgBox(0, '$Msg = ' & $mMsg, GuiCtrlRead($Button[$i]) & $flavorco, 0) Global $sFilePath = @ScriptDir & "\Test.ini" Global $sSection = "TPA" Global $aArray = IniReadSection($sFilePath, $sSection) _ArrayDelete($aArray, 0) ;_ArrayDisplay($aArray) Global $iIndex Global $iTotButtons = UBound($aArray) Global $iNumPerRow = 5 Global $iButWidth = 100 Global $iButDepth = 30 Global $aButiD[$iTotButtons] Global $hGUI = GUICreate('Ingredients Stock "' & $sFilePath & '"', 10 + ($iButWidth + 10) * $iNumPerRow, _ 10 + Ceiling($iTotButtons / $iNumPerRow) * ($iButDepth + 10), -1, $WS_EX_TOPMOST) For $i = 0 To $iTotButtons - 1 ; $x = $iXBorder + (($iRectWidth + $iSpacing) * Mod($i, $iNumCols)) $x = 10 + (($iButWidth + 10) * Mod($i, $iNumPerRow)) ; $y = $iYBorder + (($iRectDepth + $iSpacing) * Int($i / $iNumCols)) $y = 10 + (($iButDepth + 10) * Int($i / $iNumPerRow)) $aButiD[$i] = GUICtrlCreateButton($aArray[$i][0], $x, $y, $iButWidth, $iButDepth) ;, $BS_NOTIFY) Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE GUIDelete($hGUI) ExitLoop Case $aButiD[0] To $aButiD[$iTotButtons - 1] ;clicking on a flavor name $iIndex = ($msg - $aButiD[0]) Global $RSINGRflavor = $aArray[$iIndex][0] ;flavor name Global $RSINGRml = $aArray[$iIndex][1] ; ml Global $RSINGRgal = $aArray[$iIndex][1]*0.000264172 ;converts ml to gal Call('openflavor') EndSwitch WEnd EndFunc Func openflavor() #Region ### START Koda GUI section ### Form=F:\Karl\AutoIt\FJ-Stock JP\GUI Forms\RSINGRSUBFORM.kxf ;opens flavor to view stock and restock submit $RSINGRSUBFORM = GUICreate($sSection & " " & $RSINGRflavor, 242, 213, 530, 269) $RSINGRFlavorTitle = GUICtrlCreateLabel($sSection & " " & $RSINGRflavor, 32, 8, 200, 28) GUICtrlSetFont(-1, 16, 800, 0, "MS Sans Serif") $RSINGRstockcaption = GUICtrlCreateLabel("Current Stock in ml:", 16, 48, 96, 17) $RSINGRstockml = GUICtrlCreateLabel($RSINGRml, 120, 48, 114, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $RSINGRInput = GUICtrlCreateInput("ml", 40, 112, 153, 21) $RSINGRSUBMIT = GUICtrlCreateButton("SUBMIT", 16, 152, 81, 33) $RSINGRCLOSE = GUICtrlCreateButton("CLOSE", 145, 151, 81, 33) $RSINGRgalcaption = GUICtrlCreateLabel("Current Stock in gal:", 16, 80, 97, 17) $RSINGRstockgal = GUICtrlCreateLabel($RSINGRGAL, 120, 80, 114, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; $msg = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($RSINGRSUBFORM) ExitLoop Case $RSINGRCLOSE GUIDelete($RSINGRSUBFORM) ExitLoop EndSwitch WEnd EndFunc- 11 replies
-
- array variable
- incorrect
-
(and 2 more)
Tagged with:
-
Hello, I am getting this error message when running my script: Case $aButiD[0] To $aButiD[$iTotButtons - 1] Case ^ ERROR Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. The script's purpose is to read my ini file and create buttons for the sections and section contents. The first part of the script creates buttons for the sections of the ini, once you click on the section button it should open another set of buttons of all the contents under the section In this case, the section in the .ini file is called "TPA" on the Func flavorco() It opens the contents of "TPA" into buttons. Right now, the section it is reading is determined by $sSection. It is only when I try to change $sSection = "TPA" to $sSection = $flavorco that the error starts to appear Here is the script #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $optbar = IniReadSectionNames("test.ini") If Not IsArray($optbar) Then Exit Local $Button[UBound($optbar) - 1] $mGUI = GUICreate('Restock Flavor Ingredients', 10 + (130 * UBound($optbar)), 100) For $x = 1 To UBound($optbar) - 1 $var = IniReadSection("test.ini", $optbar[$x]) If @error Then ContinueLoop $X_Coord = 10 + (($x - 1) * 100) $Button[$x - 1] = GUICtrlCreateButton($optbar[$x], $X_Coord, 30, 70, 30) Next GUISetState() While 1 $mMsg = GUIGetMsg() If $mMsg = $GUI_EVENT_CLOSE Then GUIDelete($mGUI) ExitLoop EndIf For $i = 0 To UBound($Button) - 1 If $mMsg = $Button[$i] Then MsgBox(0, '$Msg = ' & $mMsg, GuiCtrlRead($Button[$i]) & ' Pressed', 2) Global $flavorco = $Button ; sets the flavor company's variable Call('flavorco') EndIf Next WEnd Func flavorco() ;opened flavor company's flavors MsgBox(0, '$Msg = ' & $mMsg, GuiCtrlRead($Button[$i]) & $flavorco, 0) Local $sFilePath = @ScriptDir & "\Test.ini" Local $sSection = $Button Local $aArray = IniReadSection($sFilePath, $sSection) _ArrayDelete($aArray, 0) ;_ArrayDisplay($aArray) Local $iIndex Local $iTotButtons = UBound($aArray) Local $iNumPerRow = 5 Local $iButWidth = 100 Local $iButDepth = 30 Local $aButiD[$iTotButtons] Local $hGUI = GUICreate('Ingredients Stock "' & $sFilePath & '"', 10 + ($iButWidth + 10) * $iNumPerRow, _ 10 + Ceiling($iTotButtons / $iNumPerRow) * ($iButDepth + 10), -1, $WS_EX_TOPMOST) For $i = 0 To $iTotButtons - 1 ; $x = $iXBorder + (($iRectWidth + $iSpacing) * Mod($i, $iNumCols)) $x = 10 + (($iButWidth + 10) * Mod($i, $iNumPerRow)) ; $y = $iYBorder + (($iRectDepth + $iSpacing) * Int($i / $iNumCols)) $y = 10 + (($iButDepth + 10) * Int($i / $iNumPerRow)) $aButiD[$i] = GUICtrlCreateButton($aArray[$i][0], $x, $y, $iButWidth, $iButDepth) ;, $BS_NOTIFY) Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE GUIDelete($hGUI) ExitLoop Case $aButiD[0] To $aButiD[$iTotButtons - 1] ;clicking on a flavor name $iIndex = ($msg - $aButiD[0]) $RSINGRflavor = $aArray[$iIndex][0] ;flavor name $RSINGRml = $aArray[$iIndex][1] ; ml $RSINGRgal = $aArray[$iIndex][1]*0.000264172 ;converts ml to gal Call('openflavor') EndSwitch WEnd EndFunc Func openflavor() #Region ### START Koda GUI section ### Form=F:\Karl\AutoIt\FJ-Stock JP\GUI Forms\RSINGRSUBFORM.kxf ;opens flavor to view stock and restock submit $RSINGRSUBFORM = GUICreate($sSection & " " & $RSINGRflavor, 242, 213, 530, 269) $RSINGRFlavorTitle = GUICtrlCreateLabel($sSection & " " & $RSINGRflavor, 32, 8, 200, 28) GUICtrlSetFont(-1, 16, 800, 0, "MS Sans Serif") $RSINGRstockcaption = GUICtrlCreateLabel("Current Stock in ml:", 16, 48, 96, 17) $RSINGRstockml = GUICtrlCreateLabel($RSINGRml, 120, 48, 114, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $RSINGRInput = GUICtrlCreateInput("ml", 40, 112, 153, 21) $RSINGRSUBMIT = GUICtrlCreateButton("SUBMIT", 16, 152, 81, 33) $RSINGRCLOSE = GUICtrlCreateButton("CLOSE", 145, 151, 81, 33) $RSINGRgalcaption = GUICtrlCreateLabel("Current Stock in gal:", 16, 80, 97, 17) $RSINGRstockgal = GUICtrlCreateLabel($RSINGRGAL, 120, 80, 114, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; $msg = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($RSINGRSUBFORM) ExitLoop Case $RSINGRCLOSE GUIDelete($RSINGRSUBFORM) ExitLoop EndSwitch WEnd EndFunc Any help is much appreciated! Thanks. My guess is that $Button isn't an actual string?? Whenever I use msgbox it shows up the string exactly, no numbers attached. So i'm not sure whats going on here.
- 11 replies
-
- array variable
- incorrect
-
(and 2 more)
Tagged with:
-
Renaming a $var1 to $newvarname
kartune replied to kartune's topic in AutoIt General Help and Support
Thanks! i'm gonna study this, but just from the looks of it already, i should've started all my code using arrays. Unfortunately i have so much code already written haha. I've learned a lot already, very grateful for your help! -
Renaming a $var1 to $newvarname
kartune replied to kartune's topic in AutoIt General Help and Support
thank you very much, that was informative. I will look into arrays and learn about them! -
Renaming a $var1 to $newvarname
kartune replied to kartune's topic in AutoIt General Help and Support
Hi, Thanks for your responses and sorry i forgot to mention I am not an advanced scripter nor knowledgeable in programming languages. So i don't exactly understand your questions in regards to storing them as controls or ids. I'm guessing ID? What i need is to at any point be able to have autoit rename the variable when stated to. So if i wanted every code line that contains: $clear1 to actually become $changedvariable Everytime the script sees a $clear1 --- it actually executes it as the variable actually being: $changedvariable ;NOT $clear1 I apologize this is harder than expected to explain haha. In my script, i will be alternating back and forth.... so at certain situations, i need: $clear1 : to actually be $changedvar1 at other times it will be: $changedvar2 then others: $changedvar65 and so on.... I don't want to write out all those lines of code containing: $clear1 :for everytime i need that specific code for: $changedvar I hope this makes sense. If this works out you will be saving me a lot of copy pasted lines lol. -
Renaming a $var1 to $newvarname
kartune replied to kartune's topic in AutoIt General Help and Support
Thank you! -
Renaming a $var1 to $newvarname
kartune replied to kartune's topic in AutoIt General Help and Support
Well i'm trying to avoid hundreds of unnecessary lines of code, i was hoping there'd be an easy way to do this. This action needs to happen to several different variables under different situtations ;;; This is for the SATJ situation ;;; GUICtrlSetState($SATJ0, $GUI_UNCHECKED) ;removes radio button selections GUICtrlSetState($SATJ3, $GUI_UNCHECKED) GUICtrlSetState($SATJ6, $GUI_UNCHECKED) GUICtrlSetState($SATJ12, $GUI_UNCHECKED) GUICtrlSetState($SATJ18, $GUI_UNCHECKED) GUICtrlSetState($SATJ20, $GUI_UNCHECKED) GUICtrlSetState($SATJ30, $GUI_UNCHECKED) GUICtrlSetState($SATJ60, $GUI_UNCHECKED) GUICtrlSetState($SATJ100, $GUI_UNCHECKED) GUICtrlSetState($SATJ120, $GUI_UNCHECKED) ;;; This is for the OBCD situation ;;; GUICtrlSetState($OBCD0, $GUI_UNCHECKED) ;removes radio button selections GUICtrlSetState($OBCD3, $GUI_UNCHECKED) GUICtrlSetState($OBCD6, $GUI_UNCHECKED) GUICtrlSetState($OBCD12, $GUI_UNCHECKED) GUICtrlSetState($OBCD18, $GUI_UNCHECKED) GUICtrlSetState($OBCD20, $GUI_UNCHECKED) GUICtrlSetState($OBCD30, $GUI_UNCHECKED) GUICtrlSetState($OBCD60, $GUI_UNCHECKED) GUICtrlSetState($OBCD100, $GUI_UNCHECKED) GUICtrlSetState($OBCD120, $GUI_UNCHECKED) ;;; What i would love to have it be ;;; GUICtrlSetState($changeableVar0, $GUI_UNCHECKED) ;removes radio button selections GUICtrlSetState($changeableVar3, $GUI_UNCHECKED) GUICtrlSetState($changeableVar6, $GUI_UNCHECKED) ... ... ... So if i could just rename the variable according to the situation, i could set it to a function and call the same function for every situation. Hope that makes sense. -
Hello, i'm trying to rename a variable to another variable name (not the value attached to the variable). This would save me TONS of coding. Here is an example: <autoit> Local $clear1="$SATJ" ;sets the $clear1 variable to become $SATJ GUICtrlSetState($clear1 & "3", $GUI_UNCHECKED) ;i want this to come out to be $SATJ3, it should look something like - GUICtrlSetState($SATJ3, $GUI_UNCHECKED) </autoit> Is this possible? I've been searching all the forums and help files for hours. My javascript friend referenced me to the solution on JS, which lead me to searching through the "assign" help on autoit, but not much info on it. I've already tried <autoit> Assign($clear1, $SATJ) </autoit> any help is greatly appreciated!!!
-
Compiled Script Doesn't Work The Same
kartune replied to kartune's topic in AutoIt General Help and Support
oh, sorry i didnt realize i even had another. you could delete either one, i think the login info is saved on my chrome thanks -
Compiled Script Doesn't Work The Same
kartune replied to kartune's topic in AutoIt General Help and Support
Hi guys, thanks for your help! But i figured it out, I had no idea that compiling the script excludes the images needed for the imagesearch. Once i placed the images in the directory i copied the script to it worked again. Sorry for any trouble! -
Compiled Script Doesn't Work The Same
kartune replied to kartune's topic in AutoIt General Help and Support
Hi, thanks for your assistance. So i troubleshooted and here's what i got: 1) Identified that it starts to glitch when it's doing an imagesearch, i am using the imagesearch2015.au3. 2) I've only tried the compiled .exe that i copied into a different directory. So i figured maybe the compiled version doesnt include the imagesearch2015.au3? So i tried copying that imagesearch2015.au3 into the same directory to see if that solves the issue, which it did not. 3) I tried the compiled.exe in the default directory where the original .au3 script is in and this worked just fine. 4) I then tried copying the original script into the other directory and compiling it there to see if that did anything. It again has the same issue. So now i'm thinking you are right about the issue being something about the directory. Do you have any troubleshooting steps or information you need from me specifically? Thanks again! -
Hello, when compiling as x86 or 64 from the drop down menu of right clicking the .au3, or using the autoit startmenu compile script, it does not run the same as just running the .au3. It just gets stuck on one of the functions. I've tried running as administrator also. Is there something i need to know when compiling the script for .exe? Thanks!
-
Imagesearch going out of range
kartune replied to kartune's topic in AutoIt General Help and Support
awesome that worked! thanks a lot! Now i have another problem though haha.. I've been running so many tests to see what i'm doing wrong but i cant find the mistake... For this one, i'm trying to have it search only within 0x,0y through 1300x, 175y Not sure why, but i ran it about 50 times and it would keep going past the 175y limit, all the way to the bottom right of my screen. Can you find anything i did wrong here? Do i have the coordinates in the wrong spots? Thanks a lot! Local $spacesearch = _Imagesearcharea("pic.bmp",0,0,0,1300,175,$x,$y,10) ;searches for like buttons without username showing to click If $spacesearch = 1 Then Send ("{DOWN}") Sleep (2000) Else Sleep (500) EndIf -
Hello, Just want to start by saying thanks and i appreciate any help/advice/information. Scenario: I'm trying to have it ONLY search for the image in the area ranging from x:408 y:511 through x:799 y:957. Problem: Imagesearch keeps searching as low as y 50, which is way below my y minimum. The only time i got it to NOT search that is if i made the minimum y like, 3000 haha. Anyone have any solutions? Thanks again! Func likecone() ;Column 1 check Local $likesearch = _Imagesearcharea("pic.bmp",408,511,0,799,957,$x,$y,10) If $likesearch = 1 Then MouseMove($x, $y, 10) EndIf EndFunc