Jump to content

LordRaven

Active Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by LordRaven

  1. I tried this and got 'Unknown Function' error: #include <GUIConstants.au3> Global $wrong = "";link antes de ser invertido Global $correct = "";link depois de ser invertido Global $link = "";link correto #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 202, 243, 193, 125) $Input1 = GUICtrlCreateInput("", 16, 56, 169, 21) $Label1 = GUICtrlCreateLabel("Inversor de Links 1.0", 16, 8, 176, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Inverter", 64, 88, 67, 25, 0) $Button2 = GUICtrlCreateButton("Copiar", 64, 192, 67, 25, 0) $Group1 = GUICtrlCreateGroup("Inversor", 8, 40, 185, 89) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Resultado", 8, 136, 185, 97) $Input2 = GUICtrlCreateInput("", 16, 160, 169, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $wrong = GUICtrlRead($Input1) $correct = _StringReverse($wrong) $link = StringLeft($correct, 37) MsgBox(0,"Link: ",$link) Case $Button2 EndSwitch WEnd
  2. Hi im facing some issue in a utility im coding to revert links. I've found the way to reverse the link but my problem is at limiting to 'where' it should be considered. For example, we got the inverted following link: http://telona.biz/protetor/?28YRO2UG=d?/moc.daolpuagem.www//:ptth If we reverse this we will get the following: http://www.megaupload.com/?d=GU2ORY82?/rotetorp/zib.anolet//:ptth So far everything is ok, the proble is limiting the code to get the real link part: http://www.megaupload.com/?d=GU2ORY82?/rotetorp/zib.anolet//:ptth In this case the red part is the one needed. So what i did was a For counting from 0 to 36, that makes it count 37 characters which must return the full url correctly, my problem is that for a unknown reason, it adds a '65' number before the url... This might be stupid and useless but i would really appreciatte any help. Follows what I got: #include <GUIConstants.au3> Global $str_antes = "";link antes de ser invertido Global $str_depois = "";link depois de ser invertido #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 202, 243, 193, 125) $Input1 = GUICtrlCreateInput("", 16, 56, 169, 21) $Label1 = GUICtrlCreateLabel("Inversor de Links 1.0", 16, 8, 176, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Inverter", 64, 88, 67, 25, 0) $Button2 = GUICtrlCreateButton("Copiar", 64, 192, 67, 25, 0) $Group1 = GUICtrlCreateGroup("Inversor", 8, 40, 185, 89) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Resultado", 8, 136, 185, 97) $Input2 = GUICtrlCreateInput("", 16, 160, 169, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $str_antes = GUICtrlRead($Input1) _Revert() Case $Button2 If $str_depois = "" Then MsgBox(0,"Erro","Sem link para ser copiado.") Else ClipPut($str_depois) MsgBox(0,"Link Copiado.") EndIf EndSwitch WEnd Func _Revert() Local $arrayString = StringSplit($str_antes, ""), $cont, $cont2, $Temp = "" For $cont = $arrayString[0] To 1 Step -1 $Temp &= $arrayString[$cont] Next MsgBox(0,"String: ",$Temp) Local $NewArr = StringSplit($Temp, "") For $cont2 = 0 To 37 Step 1 $str_depois &= $NewArr[$cont2] Next MsgBox(0,"String: ", $str_depois) EndFunc
  3. Now I got it. Relate to my another Syntax error, on C programming which is the one im working with in my university, the switch works that way. Thats why I put that way the code. The right way for me to use should be making using a select then isnt?(for the syntatically incorrect way i was using) If was using a select wouldnt be wrong isnt? Like this: Select Case $readed = "Test 1" MsgBox(0,"Value","The Value Returned was X") Case $readed = "Test 2" MsgBox(0,"Value","The Value Returned was Y") Case $readed = "Test 3" MsgBox(0,"Value","The Value Returned was Z") EndSelect So, Thanks very much for all your help Melba23 Have a nice day, and a good night friend!
  4. @Melba23 Sorry for the dumb syntax error, sometimes I forgot stuffs... Oh about Select and Switch, I've been thinking, those 2 looks like they have the exacly same function to me. Am I wrong? They different in any case? Could you point me which they got different than other? Thanks once again Melba23, you're a life savior. Oh almost forgot, the code. Here is it, if someone need anytime: #include <GUIConstants.au3> Global $readed #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 228, 62, 303, 219) $Combo1 = GUICtrlCreateCombo("", 16, 16, 145, 25) GUICtrlSetData(-1, "Test 1|Test 2|Test 3") $Button1 = GUICtrlCreateButton("Set", 168, 16, 43, 17, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $readed = GUICtrlRead($Combo1) Switch $readed Case $readed == "Test 1" MsgBox(0,"Value","The Value Returned was X") Case $readed == "Test 2" MsgBox(0,"Value","The Value Returned was Y") Case $readed == "Test 3" MsgBox(0,"Value","The Value Returned was Z") EndSwitch EndSwitch WEnd
  5. Sorry friend, I wish my logic was better, but sometimes I stuck even reading help file. I follow everything you said and I'm getting error in expression. Follows the code: #include <GUIConstants.au3> Global $readed #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 228, 62, 303, 219) $Combo1 = GUICtrlCreateCombo("", 16, 16, 145, 25) GUICtrlSetData(-1, "Test 1|Test 2|Test 3") $Button1 = GUICtrlCreateButton("Set", 168, 16, 43, 17, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $readed = GUICtrlRead($Combo1) Switch Case $readed == "Test 1" MsgBox(0,"Value","The Value Returned was X") Case $readed == "Test 2" MsgBox(0,"Value","The Value Returned was Y") Case $readed == "Test 3" MsgBox(0,"Value","The Value Returned was Z") EndSwitch EndSwitch WEnd
  6. Hey guys, hi again. Im here with a new doubt. Now I am trying to work with combobox function. I've read help file, and did search a lot over forum about it, but I couldnt find what I really needed. I need to know how to put ComboBox values, so I can click on Set button and one defined var, will get different values, depending on the content chosen on combobox, the reason of this is code saving, so i dont need to create like 3 functions in a gui for example to call 3 distinct functions. Here is what I need, I need to know how to put fix values in a ComboBox for starting, like: ComboBox Values: Test 1 Test 2 Test 3 Then I got a Button called Set. When I click it, it sets a determined value to the $opt var, for example, if rolled combo to Test 1, it sets my $opt var to 'x', if i roll to Test 2, it sets my $opt var to 'y', and if i roll my combo to Test 3 and click set, it should set my $opt var to the value z. Follows the GUI Code: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 228, 62, 303, 219) $Combo1 = GUICtrlCreateCombo("Combo1", 16, 16, 145, 25) $Button1 = GUICtrlCreateButton("Set", 168, 16, 43, 17, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Sorry guys if my questions sound noobish, is that I still begginner in AutoIt coding.
  7. @ahmet Thanks for your support and for pointing me in the right directon. I followed you sleep inside while looping and worked fine. This is the code case anyone in the future need: Global $pos, $file $file = FileOpen("coords.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf HotKeySet("{F7}","Write") HotKeySet("{F8}","Close") While 1 Sleep(100) WEnd Func Write() $pos = MouseGetPos() FileWriteLine($file, 'MouseClick("Left",' & $pos[0] & "," & $pos[1] & ")") EndFunc Func Close() FileClose($file) MsgBox(0, "Closing", "Closing...All coordinates were saved.") Exit EndFunc Now I wonder if you or someone could help me in something else. This time what I need is a function which will call all my MouseClick() events inside that .txt to the code itself and use it for example: The .txt: MouseClick("Left",550,549) MouseClick("Left",901,550) MouseClick("Left",517,398) MouseClick("Left",421,449) MouseClick("Left",439,489) MouseClick("Left",852,561) MouseClick("Left",648,343) MouseClick("Left",455,447) The Function to call the .txt: HotKeySet("{F9}","_Call") While 1 Sleep(100) WEnd Func _Call() ;call all those mouseclick() events inside the .txt and execute them here Sleep(1000) EndFunc My goal with this is save program code, instead of put like 3 or 4 function of clicking events i could leave the MouseClick() coords inside a .txt and call to one single function inside the program. Thanks in advance. Any doubt ask me. EDIT -- Nvm I found it how. Theres the code in the future if someone need it. Func _Call() $file = FileOpen("coords.txt", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop Execute($line); Run the line readed from the file Wend EndFunc
  8. How should be then? And why?
  9. I've just read it, and made like this, still i get 'Error parsing function call' Here is what I got: Global $pos, $file $file = FileOpen("test.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 HotKeySet("{F7}","Write") HotKeySet("{F8}","Close") WEnd Func Write() $pos = MouseGetPos() FileWriteLine($file, "MouseClick("Left"," & $pos[0] & "," & $pos[1] & ")") EndFunc Func Close() FileClose($file) MsgBox(0, "Closing", "Closing...Have a nice day.") Exit EndFunc Any idea what could be?
  10. Hi, recently i was making a clicker(not a spammer nor a gamebot, just warning in advance) and i made a function to get the mouse position, this was pretty easy, follows what i got: Global $pos While 1 HotKeySet("{F1}","getpos") WEnd Func getpos() $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) EndFunc What i really want is get this determined positions, save them formated the way i want in a .txt file for example, if i got the following coords: X: 156 Y: 593 X: 789 Y: 1007 X: 229 Y: 980 I want them to be sended to the .txt file this way: MouseClick("Left",156,593) MouseClick("Left",789,1007) MouseClick("Left",229,980) What I need is a mouseclick function maker to ease my use of this determined function. Theres a way to do this? Can someone help?
  11. Oh now i got it, the difftime is the diference of the initial value, which is the 0 attribued to the iBegin in global declaration and the time its called in that if.. for example we got a 0 value that was setted to our iBegin var, the difftime will look for 2000milliseconds forth this, once it finds the 2000ms point, it execute what we want to do, and then ... as you said the TimerInit() sets a new Timestamp as you show to roll another 2000ms. Now I finally got it. Clearly I need to read more the help files Thank you very much for your patience and help Melba23, your examples were very enlightening. Have a nice day.
  12. So basically when you use TimerDiff($iBegin) the iBegin var value is not 0 anymore, the value changes due the count to 2000 in that example? So when the count reach 2000 milliseconds the ConsoleWrite("Doing things every 2 secs - " & @SEC & @CRLF) or whatever other command, like even a msgbox(0,"Hello!") is executed, and next the TimerInit brings the var $iBegin again to 0 again, so in the next loop of that while the process starts all over again? Is something like that?(sorry if i sound confusing)
  13. @Melba23 Thanks for replying me, I've tried your changes and they worked just as I expected. Related to the code I didnt understand one process, the following: If $KPUnPaused And TimerDiff($iBegin) > 2000 Then ; Do it ConsoleWrite("Doing things every 2 secs - " & @SEC & @CRLF) ; Reset the timer $iBegin = TimerInit() EndIf What this suppose to do exactly? I know the KPUnPause is the control var to check if the keypressing process is true or false, in other words, on/off, but what about the timerdiff and that var called iBegin, this part I didnt got right;
  14. It is not a kind of spammer it would be more like an Advisor to show time to time a defined message. Its more like a countdown timer with a message. If it was for spamming I would have don already. I could've solve this by making 2 buttons Active and Desactive, but I want a single On/Off button which is the right way to do, saving most lines we can. Thats it, an advisor for some random message time to time by determined times, for now idk really for what I'll use for, so far im still doing for knowledge, not because of futile things like spamming. Thanks Melba23
  15. Thanks for the previous help. And sorry mate, I'll pay more attention to the help file content. Im facing another issue here. Im working on some kind of shouter wich should send the same sentence like 5 times each 20 secs(ill work on the details of it later) but for start im getting a small problem here. My problem is, theres a button specific to trigger the function but when i click again the same button to stop the function nothing happen, the function still on and sending that 'X'... Weird thing is, this code works fine using HotKeySet, but wont work for a reason with a GUI button. Follows the Code: ;GUI's While looping While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Button1 KeyPress() EndSwitch WEnd ;Function called by the button click event Func KeyPress() Local $KPUnPaused $KPUnPaused = NOT $KPUnPaused While $KPUnPaused ToolTip('KeyPresser is "ON"',500,8,"",0,2) Send("X") WEnd ToolTip('KeyPresser is "OFF"',500,8,"",0,2) Sleep(2000) EndFunc
  16. @Melba23 Thanks for replying my topic and answering my question. Your help did make me understand more about GUI's and how they work. Now im facing a new problem. In fact I got 2 questions now, I'll ask both so I avoid spam. 1st question: How can I make a GUI form call another one? For example, the last code i posted here(the following): #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("This is a Test!", 136, 108, 195, 125) $Button1 = GUICtrlCreateButton("START", 32, 16, 75, 25, 0) $Button2 = GUICtrlCreateButton("QUIT", 32, 56, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I Turned into this: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("This is a Test!", 136, 132, 195, 125) $Button1 = GUICtrlCreateButton("START", 32, 16, 75, 25, 0) $Button2 = GUICtrlCreateButton("QUIT", 32, 56, 75, 25, 0) $Button3 = GUICtrlCreateButton("About", 32, 96, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd As you can see I only add 1 extra option, About. What I want is call another Form that i made in Koda as an example, I'll show you, follows the GUI code of the About form: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 219, 170, 194, 302) $Label2 = GUICtrlCreateLabel("THIS IS A EXAMPLE", 56, 16, 105, 17) $Label1 = GUICtrlCreateLabel("Credits: Someone", 24, 48, 87, 17) $Label3 = GUICtrlCreateLabel("E-Mail: som-e-one@test.com", 24, 72, 139, 17) $Label4 = GUICtrlCreateLabel("Website: www.someone.com", 24, 96, 142, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 2nd question: How do I make a inputbox inside the GUI save an attribued value to an variable? Content: - Inputbox - Apply button - Show Value button Goal: I type any number in the gui inputbox, click apply button setting that value from the box to the variable and the I click Show Value so the value will be shown to me in a common MsgBox Follows the new GUI code: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("This is a Test!", 212, 132, 195, 125) $Button1 = GUICtrlCreateButton("START", 32, 16, 75, 25, 0) $Button2 = GUICtrlCreateButton("QUIT", 32, 56, 75, 25, 0) $Button3 = GUICtrlCreateButton("About", 32, 96, 75, 25, 0) $Input1 = GUICtrlCreateInput("Input1", 128, 16, 65, 21) $Button4 = GUICtrlCreateButton("Apply", 128, 40, 59, 17, 0) $Button5 = GUICtrlCreateButton("Show Value", 120, 96, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thanks very much for any help. -- Edited -- @Melba23 Also i want to know how do i replace those 2 buttons(Start and Quit) per checkboxes like |_| Start |_| Quit If i click start the checkbox gets checked and it goes to a function, if i check the Quit for example it "uncheck the Start box" and check the Quit one and after 10 secs quit. My point is, i made 2 checkboxes in Koda but when i check the 1st everything is good, but when i check the 2nd the first stills marked, i just want one choice not both.
  17. I got a small questions about GUI that I still didnt got even doing research, or even checking the 1-2-3 AutoIT guide. How do I make an GUI interact with a function? For Example I've made 2 simple Functions and a gui form with 2 buttons, my question is, when i click that button, how do i make it call that specific function? Please I know is a stupid question with no use, but to learn i need to start with the stupid things, if you dont want to help dont reply, just ignore my topic. Functions: Func Quit() MsgBox(0,"Quiting", "Have a nice day.") Exit EndFunc Func Start() MsgBox(0,"Testing", "This is a GUI Test Message.") EndFunc GUI Code: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("This is a Test!", 136, 108, 195, 125) $Button1 = GUICtrlCreateButton("START", 32, 16, 75, 25, 0) $Button2 = GUICtrlCreateButton("QUIT", 32, 56, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thanks in advance.
  18. ok sorry, but as my previous question, how to break lines?
  19. so theres no section in this forum i can discuss about it? if anyone could help me even by private message i would appreciate =/ and sorry, i didnt notice talking about game botting was forbidden couldnt we just assume this is a normal clicking program? is that all i need for, clicking on some specifics places of the screen, the only problem im having is breaking that loop
  20. Hey guys im sure other people already asked this same question but my problem is I cant find any stoping method to put in my script, im trying to make a script for auto-move/clicking to open some packages in a game called ryl, my problem is: When i start my script(I made this coords as an test) it starts to click in randoms places from the screen and when i use the stop button it stop moving/clicking, but when i start again it starts clicking where it stops when what i want is a fresh new clicking from the begining. Sorry guys if what im asking is a stupid question and my script is wrong thing is, im newbie in autoit programming and i wish to learn really more, i hope you guys could point me in the right direction. If any of you could help me with my code and make it better i would really appreciate! Theres my code so far: HotKeySet("{HOME}", "Start") HotKeySet("{END}", "Stop") Global $Go Global $Wait MsgBox(4096, "Instructions", "Press Home to start opening your packs, End to Pause.", 10) While 1 While $Go = 1 MouseMove(453,233) MouseClick("Right") Sleep(1000) MouseMove(738,445) MouseClick("Right") Sleep(1000) MouseMove(930,210) MouseClick("Right") Sleep(1000) WEnd Sleep(100) WEnd Func Start() $Go = 1 ToolTip('Packs Opener is "ON"',0,0) EndFunc Func Stop() $Wait = NOT $Wait While $Wait sleep(100) ToolTip('Packs Opener is "Stoped"',0,0) WEnd ToolTip('Packs Opener is "ON"',0,0) EndFunc I got another quick question and nobbish aswell >.> How can i break lines in MsgBox, in C i know is \n, its the same for AutoIT? Thanks in advance.
×
×
  • Create New...