Jump to content

Sebix

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Sebix

  1. I think this is another way to do the same, more contracted/Neat. For $language[0] = 0 To $language[2] GUICtrlSetState($language[0], $GUI_UNCHECKED) Next I understand everything up to this part. $aSplit_String[5] = $New_Name ; I don't understand the array [5] $aSplit_String[9] = $New_Age ; here too For $i = 1 To $aSplit_String[0] ;number of elements in array $New_String &= $aSplit_String[$i] & " " ; $aSplit_String[u][b][$i][/b][/u] <- All this I have the edge of understanding Next
  2. Do not get me wrong! I'm not interested in give me a code without explanations. If quench my appetite with fish, without giving me a fishing rod, the next time I'll ask for more fish. That's my philosophy. I learn to compare, understand and see things, I appreciate your support, what happens is that I am very started on this, and I understand little, coupled with my bad English, I'm lost. Edit: Viewing your code, i remember a thing That i learn with scripting for the game Counter-Strike, in the AMXX, using Pawn language or C++, i don't remember. That was the Array... I have a question, how can do a call to all of the var's? For example, for a reset of the checkbox's i'll do this. Global $language[3] $language[0] = GUICtrlCreateCheckbox("English", 15, 120) $language[1] = GUICtrlCreateCheckbox("Spanish", 15, 140) $language[2] = GUICtrlCreateCheckbox("Portuguese", 15, 160) $RESET = GUICtrlCreateButton("Reset", 35, 260, 75, 25) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Start _Modiffy() Case $RESET GUICtrlSetState($language[0], $GUI_UNCHECKED) ; how can i contract all of them in one call? for example GUICtrlSetState($language[3], $GUI_UNCHECKED)? GUICtrlSetState($language[1], $GUI_UNCHECKED) GUICtrlSetState($language[2], $GUI_UNCHECKED) EndSwitch WEnd How can i say, the $language[1] (English) is = to "English, " So when the user clicks in the checkbox, "English, " will be appear next to I can Speak ... _FileWriteToLine("text.txt",3,"I can speak " & $New_String,1) I know there are many possibilities, if the user click English, but don't click Spanish, the phrase will change, I know. But don't do problems, i only need moddify numbers in my script, using my example I can understand all more fastly Thanks.
  3. Yes, that is the question. I only need to moddify the "Text.txt" for one time. If i don't select the name, the original name will not change. And if i select the age, for example 30, the original age (60), will be change to 30. How can i search the phrase in the text, and edit that? I know the file an row of the phrase, but i don't know how apply to this. So i have the .exe, and the .txt in the same folder. When i open the exe, put the name "Seba" and put start, the .txt will be change, and when i open that, the name will be "Seba". And stop the func, i need do this for one time. But If you know a way to edit it having any words, for example from "Seba" to "Pepe", that will be great PD: In your code, only generates a msgbox with the info? I need EDIT the .txt. The most that I could do was this: Local $file = FileOpen("text.txt", 1) Func _modify If $file = -1 Then MsgBox(0, "Error", "Unable to open file 'Text.txt'.") Exit EndIf FileWriteLine($file, "Added") FileClose($file)
  4. If the text was much more extensive, how would I do to find the phrase "Hello, my name is Alberto, and i have 60 years old. I can speak spanish, and portuguese.", After that modify the name as it is wrote in Input. This is a generic code: #include<GUIConstantsEx.au3> #include<EditConstants.au3> GuiCreate("Example",150,305) GuiSetState(@SW_SHOW) GuiCtrlCreateLabel("Name", 5, 20) $Name = GUICtrlCreateInput("", 35, 15, 75, 25) GuiCtrlCreateLabel("Age", 5, 60) $Age = GUICtrlCreateInput("", 35, 55, 75, 25) GUICtrlCreateLabel("Languages", 15, 100) $English = GUICtrlCreateCheckbox("English", 15, 120) $Spanish = GUICtrlCreateCheckbox("Spanish", 15, 140) $Portuguese = GUICtrlCreateCheckbox("Portuguese", 15, 160) $START = GUICtrlCreateButton("Start", 35, 225, 75, 25) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Start _Modiffy() EndSwitch WEnd Func _Modiffy() FileOpen("text.txt") FileRead ;String? I don't understand how go to the original phrase, and moddify that. EndFunc The" text.txt" will be: Sos venezolano? Se me facilitaría mucho si hablás en castellano jaja
  5. Mmmm, when i'm talking about "txt", i'm talking about a file ".txt". So: $Portuguese = GUICtrlCreateCheckbox("Portuguese", 10, 10) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Start Local $File = FileOpen("text.txt", 0) ;What i need put? In the Text.txt is the phrase Hello, my name is Alberto, and i have 60 years old. I can speak spanish, and portuguese. FileClose($File) EndSwitch WEnd I think I misspoke. Sorry for that. Now I explain correctly?
  6. Hello! i am creating a script. This script, in one of his functions, have the work to edit a .txt. For example, in the Txt say this: Hello, my name is Alberto, and i have 60 years old. I can speak spanish, and portuguese. So, the GUI, for example, is the next: NAME : [ ] Age: [ ] Languages: (Checkbox) [ ] Spanish [ ] Portuguese [ ] English I need to edit the First Line. If the user put the name John, i need to change the word "Alberto" to "John". If the user put 10 years old, i need to change the numbers 60 to 10. And if the user select only spanish, the phrase ", and portuguese" will be delete, or if the user select Spanish, Portuguese and English, the word English will be put next to the word "Portuguese". Sorry for my english, i'm from argentina. lol Thanks, and i'll be waiting for a response Bye
  7. Ok, people! Thanks to you for answering my question . Thanks, seriously, i'm understanding how it works Again, thanks, you can close the thread. #QuestionSolved #Closed ¿?
  8. ! Thanks man, that works! I don't understand why this don't work Local $Tiempo = $Tiempo * 60000 Func _Delay() Sleep(GUICtrlRead($Tiempo)) EndFunc Can you explain me, why that don't work? The logical is good, i'm using a bad command? Thanks Edit: I think i discover why my logical doesn't work. Local GuiCtrlRead($Tiempo) = GuiCtrlRead($Tiempo) * 60000 The logical is fine?
  9. The question is simple, how can i create a func of time, in minutes, previously selected on a combobox? For example, in a alarm clock, i need snooze the alarm in relation to what the user selected. In the script i mean i'll put the Func, and call the func in a While, so when i click the button for snooze clock, the func will activate. I'll wait with patient. Thanks
  10. Hi folks, I'm new to the forum. I am creating a "FarmBot", which has a GUI, where you can select the map and playtime. This is my first file created by AutoIt, so it is not very complex, this theory would. Open button, select playtime, select map, give Start. Pressing Start opens the game window, F5 is pushed (key that starts the game), is generates Sleep 20 seconds to load the game, it opens another program which serves to teleport in the game. The bot it will also do is place the coordinates of the positions within the game to teleport to certain beneficial points. After that will generate Sleep 21 minutes, and then will start again from 0, omitting the step of opening the program teleportation. This is the code: #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GuiComboBoxEx.au3> GuiCreate("Farmbot S4 League por XxSsebasSxX",245,200) GuiSetState(@SW_SHOW) GuiCtrlCreateGroup("Tiempo", 20, 15, 90, 100) $Tiempo = GuiCtrlCreateCombo("0", 30, 40, 70, 200, $CBS_DROPDOWNLIST) GuiCtrlSetData(-1, "6|11|16|21|31") GUICtrlCreateInput("", 30, 75, 70, 25, $ES_NUMBER) GuiCtrlCreateGroup("Mapa", 125, 15, 100, 100) $Skyline = GUICtrlCreateRadio("Skyline", 135, 40) $Station2 = GUICtrlCreateRadio("Station2", 135, 60) $Start = GuiCtrlCreateButton("Start", 80, 130, 70, 25) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Start _Delay() EndSwitch WEnd $Tiempo = $Tiempo * 60000 Func _Delay() Sleep(GUICtrlRead($Tiempo)) EndFunc I tried in many ways, with if, using Select, using loops, but none seemed to work. At this time the bot just want to prove that, by pressing START, Sleep is generated from the number of minutes that is in the Combobox. So the multiplication "$ Time * 60000", because if the user selects 6, if this number is placed in the function, then the amount of sleep time would be 0.01. By doing 6 * 60000 = 360000 = 6 minutes. Anyway, I hope to explain to me how I can solve and how failure. I await your reply, thanks in advance.
×
×
  • Create New...