Jump to content

Lucidity

Members
  • Posts

    15
  • Joined

  • Last visited

Lucidity's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. ahh, thanks!
  2. I don't mean that. That will make it wait 1 second and then click on the position. What I want is a click delay, so the mouse press in 1 second and then it release.
  3. How do I make the click delay in maybe 1 second? If I got a position I want the mouse to go (like in MouseClick("left",100,100) how can I make the click be pressed down in maybe 1 second? Is it possible? Thanks in advance!
  4. Well, I found a video with a drawing bot made in AutoIT http://www.youtube.com/watch?v=o3p8M66HpZc It looks dope and I downloaded the script (link in the description of the video). However, I wonder how this one works? I opened an image (not so large image, and it's a black/white drawing image of an ant). But it's processing in like, ages? The loading is on probably 98% or something, and it's like stuck there?
  5. Aah yea I was just reading about iniRead (from AutoIT's wiki tutorial) and it works great. Thanks :]
  6. Tried add that, and got up the fail msgbox. What I want to achieve is to be able to choose and change settings easily in a text file. I want to be able to put the values of variables in the text file. In the textfile I want to write for example: $coord_X = 500 $coord_Y = 400 $name = jesus $num = 5000 or something. Then I want to be able to have those values into the code. So if I would write a msgbox it could be MsgBox(0,"Number", $num) and there I would get 5000 because in the textfile I'd $num = 5000 By this I don't need to get in the script file to change variables if needed. I also then can use the setting text file for multiple AutoIT script file and don't have to keep copy all variables with their value to every script file.
  7. Hey I watched out the FileReadLine, I want to put settings into a text file. So this code, if I understand it correctly, it takes all the lines in the text file "test.txt" that's located in the same folder as the AutoIT script. That means if I put $test = 2 in the test.txt, it will work? Because in the original example it was sending msgbox for each line, with the text inside that msgbox for each line. So I tried this out, but I can't get it to work ; Script Start - Add your code below here Local $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK 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 Local $line = FileReadLine($file) If @error = -1 Then ExitLoop WEnd FileClose($file) If $test = 2 Then msgbox(0,"Success","Success!") Else msgbox(0,"FAIL", "FAIL!") EndIf The error occurs at the $test It says I haven't declared it. Even though it shall be from the test.txt file? Or do I have to declare it in the code, so it points to the text file? how would that be done? :S thanks in advance.
  8. What is this stack overflow error? I'm getting it always. I got a code where it's checking a couple of 'IF" functions all the time. I made it that end of the func holder, it's coming back to the func. Example: Func ex() If $this = 1 then $num = 1 next() ElseIf $this = 2 then $num = 2 next() ElseIf $this = 3 then $num = 3 next() Else ex() EndIf EndFunc I believe this code could be performed another way? cus I think this is causing the stack overflow that occur after like some minutes to some hours.
  9. Ahh thank you! @PhoenixXL that's looking kinda advanced to really understand it.. Though, I'd another idea now. Does it work to take those values from a plain txt file instead? If having the variable values there written up, and the script takes these values. In order not need to set these in the start of the script but rather from a textfile that can be saved and easily changed?
  10. In start of the a script i want to choose the value of a variable. Like $num = value. I done it for long time ago but have forgot. How is it made? To explain more what i meant is that a popup comes when i open the autoit script and there i can write something. This that i'm writing is gonna be the value of variable $num
  11. I don't understand. What's IE controls? internet explorer? :s
  12. It's for a site and not a game. Though I fixed it by putting the $Gray = PixelSearch one before the if $Gray code
  13. Alright, I got a blue button I want to click on when it's available, so far the script works. When the blue button is clicked, the button will turn gray instantly. The code then wanna check if the blue button now turned the gray color, if it did, then it will click on a green button. If it doesn't, it will jump to a skip function. Where it fails, is when it's gonna check for the gray color. The gray color is there, but it jumps to the skip function anyway. Where in the script is the wrong? I have red it a couple of times myself and added notes on the side of them. Func Go() $Blue = PixelSearch(822, 550, 860, 565, 0x3B5998) ; Setup for the blue $Gray = PixelSearch(822, 550, 860, 565, 0xEEEEEE) ; Setup for the gray $Green = PixelSearch(741, 609, 812, 650, 0x009D0B) ; Setup for the green If IsArray($Blue) Then ; If it is blue Mouseclick("left",$Blue[0], $Blue[1]) ; then it will click on the blue Sleep(500) Else ; If it's not blue.. Sleep(100) Wait() ; ..it will jump to wait function EndIf If IsArray($Gray) Then ; If the blue is now gray.. Mouseclick("left",$Green[0], $Green[1]) ; ..then click on the green Else ; If it is not gray Skip() ; .. it jumps to skip function EndIf Wait() ; jumps to wait function EndFunc
  14. Aah, thank you!
  15. Last time I used AutoIT was 3 years ago and already then I wasn't very good at coding/scripting. I got very low experiences in programming and have only been using Visual Basic (6 and .net) and AutoIT. Now however, I've already run into a problem that I don't understand of what's wrong. Here what I got Func Test() $Click = PixelSearch(822, 550, 860, 565, 0x3B5998) Sleep(1000) if @error Then MsgBox("Error","The pixels was not found.") Else Mouseclick("left",$Click[0], $Click[1]) EndIf EndFunc When I got the color in this coordination, the mouse goes to the coordination and making a left click. Just as I want. However, when I don't got the color in the coordination, I'm getting up an error on the Mouseclick line. It says the [0] is error (if I understand it right). I don't understand. Because wont it be registered as an @error when the pixelsearch isn't found? What I see from my old script I got it very similar. When I look at the guide it says @error is set to 1, so even if I try to make it If @error = 1 then instead, it will still give me error on the same line as before. Anybody who would like to help? Also is there more tutorials? I've read the 4 tutorials in the help file, but then it's just functions and stuffs, ofc I guess I can read one by one from there, but if somebody got more tutorials that me as a beginner can follow for being a pro in AutoIT, it would be very nice. also I tried this, but still same error! Func Test() $Click = PixelSearch(822, 550, 860, 565, 0x3B5998) Sleep(1000) if @error = 1 Then MsgBox("Error","The pixels was not found.") Elseif @error = 0 Then Mouseclick("left",$Click[0], $Click[1]) EndIf EndFunc Thanks in advance!
×
×
  • Create New...