Jump to content

smcombs

Active Members
  • Posts

    67
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

smcombs's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Ah ok I didnt catch that. I just saw wall and green dot. And all that function does is just go from center of your square to your destination.
  2. Also, you can turn on the WinAPIDrawLine cmd's and it will draw out the line that its searching. It does this in a diagonal fashion until it reaches the destination which is of course your green dot. Keep in mind drawline will not succeed on a window that is constantly re-drawing itself. So you may not see that lines that its drawing. If this is the case the only option is a new gui of your own with a screenshot of what your searching. It will also blot out with a red pixel the first green pixel that it found. So as not to go that way again, but keep in mind that will only happen if the window is not constantly refreshing itself. This is the part where it says If _IsArray($blockage) Then. So if you dont want it to do that then just comment out the _WinAPI_DrawLine thats in that If statement
  3. I have possibly a better solution. I have written a script to do wall detection and its UDF for the most part. Here it is: Basically you pass in the whole square that your needing to search and the function calculates everything inside. $object is what your searching for so basically the other green dot. $arrayColorCheck is an array variable which basically is your wall. The reason I made it an array is because a wall can have multiple colors on it. $shade is of course your shade variation. And this is a handle based function so handle to the window your searching. This will return a true or false value letting you know if you can make it to $object. So set $object to a Global variable so that your other functions can see it and utilize the coords that it returns upon success. Func searchforObject($x1, $y1, $x2, $y2, $object, $shade, $handle, $arrayColorcheck) $center_x = Int(($x2 - $x1) / 2); + $x2 ;Calculate center the center of two given points $center_y = Int(($y2 - $y1) / 2); + $y2 ;Calculate center the center of two given points $coords = PixelSearch($x1, $y1, $x2, $y2, $object, 0, 0, $handle) ;Search new gui map that was created for an object with the color $object If Not @error Then $origObjectX = $coords[0] $origObjectY = $coords[1] $screenPos = determineScreenPos($center_x, $center_y, $coords) ;Determine the quadrant of a square with the division being the center position of that square $pathClear = startWalking($coords, $center_x, $center_y, $screenPos, $shade, $handle, $arrayColorcheck) ;Start the function that will start walking to the found object Return $pathClear EndIf EndFunc Func determineScreenPos($center_x, $center_y, $coords) If $coords[0] >= $center_x And $coords[1] >= $center_y Then $screenPos = 1 ; Lower right quadrant ElseIf $coords[0] >= $center_x And $coords[1] <= $center_y Then $screenPos = 2 ; Upper right quadrant ElseIf $coords[0] <= $center_x And $coords[1] >= $center_y Then $screenPos = 3 ; Lower left quadrant ElseIf $coords[0] <= $center_x And $coords[1] <= $center_y Then $screenPos = 4 ; Upper Left quadrant EndIf Return $screenPos EndFunc Func startWalking($coords, $center_x, $center_y ,$screenPos, $shade, $handle, $arrayColorcheck) Select ;Setup the modifier x and y coordinates to determine which way to walk Case $screenPos = 1 $center_x_modify = 1 $center_y_modify = 1 Case $screenPos = 2 $center_x_modify = 1 $center_y_modify = -1 Case $screenPos = 3 $center_x_modify = -1 $center_y_modify = 1 Case $screenPos = 4 $center_x_modify = -1 $center_y_modify = -1 EndSelect Do Sleep(10) ;Don't overwhelm the system $orig_center_x = $center_x ;Keep the modified center_x position for later use $orig_center_y = $center_y ;Keep the modified center_y position for later use If $center_x = $coords[0] And $center_y = $coords[1] Then ExitLoop ;Determine if we have reached the object if we have then exit the do loop If $center_x <> $coords[0] Then $center_x = $center_x + $center_x_modify ;Are we horizontally in line with the object if not increment by $center_x_modify If $center_y <> $coords[1] Then $center_y = $center_y + $center_y_modify ;Are we vertically in line with the object if not increment by $center_y_modify $blockage = checkBlockage($orig_center_x, $orig_center_y, $center_x, $center_y, $shade, $handle, $screenPos, $arrayColorcheck) ;Check if we have run into an object with the color array $arrayColorcheck If $screenPos = 1 Then ;~ _WinAPI_DrawLine($drawHandle,$orig_center_x, $orig_center_y, $center_x, $center_y) ;Lower right quadrant ElseIf $screenPos = 2 Then ;~ _WinAPI_DrawLine($drawHandle,$orig_center_x, $center_y, $center_x, $orig_center_y) ;Upper right quadrant ElseIf $screenPos = 3 Then ;~ _WinAPI_DrawLine($drawHandle,$center_x, $orig_center_y, $orig_center_x, $center_y) ;Lower left quadrant ElseIf $screenPos = 4 Then ;~ _WinAPI_DrawLine($drawHandle,$center_x, $center_y, $orig_center_x, $orig_center_y) ;Upper Left quadrant EndIf Until IsArray($blockage) If IsArray($blockage) Then ;If we hit a blockage then draw a marker on the found object so that the next pixel search will skip it _WinAPI_DrawLine($drawHandle,$coords[0],$coords[1],$coords[0],$coords[1]) Return False ;Return False stating that we could not get to object Else Return True ;If we did not reach a blockage then we got to the object, return true EndIf EndFunc Func checkBlockage($orig_center_x, $orig_center_y, $center_x, $center_y, $shade, $handle, $screenPos, $arrayColorcheck) For $i = 0 To $arrayColorcheck[0] Step 1 ;Step through each color of the array $arrayColorcheck If $screenPos = 1 Then $blockage = PixelSearch($orig_center_x, $orig_center_y, $center_x, $center_y, $arrayColorcheck[$i], $shade, 0, $handle) ;Lower right quadrant if you find a blockage then $blockage will have an array of coordinates else it will have a 1 ElseIf $screenPos = 2 Then $blockage = PixelSearch($orig_center_x, $center_y, $center_x, $orig_center_y, $arrayColorcheck[$i], $shade, 0, $handle) ;Upper right quadrant if you find a blockage then $blockage will have an array of coordinates else it will have a 1 ElseIf $screenPos = 3 Then $blockage = PixelSearch($center_x, $orig_center_y, $orig_center_x, $center_y, $arrayColorcheck[$i], $shade, 0, $handle) ;Lower left quadrant if you find a blockage then $blockage will have an array of coordinates else it will have a 1 ElseIf $screenPos = 4 Then $blockage = PixelSearch($center_x, $center_y, $orig_center_x, $orig_center_y, $arrayColorcheck[$i], $shade, 0, $handle) ;Upper Left quadrant if you find a blockage then $blockage will have an array of coordinates else it will have a 1 EndIf If Not @error Then Return $blockage EndIf Next EndFunc
  4. I love this lol. Totally implementing.
  5. They could be error codes of the Winexists() function. Consult the help file and check to see what is success and failure.
  6. I am looking to make my own sms texting app, and I am looking for some good material to possibly view others that have already done this. This app will run on a pc, and basically I want to use this app to text my phone and vice versa. I have already used some scripts that use my g-mail account, of which I am not very satisfied with. The send is slow and takes about 20 seconds to finish executing from my computer. So, I am just curious if anyone has some threads I could look at and possibly some direction that can help me accomplish this. I want to build an executable that I could basically pass a string into and then have the exe go from there and send my message. So I have tried the gmail version but I am curious if anyone has seen something faster. I am currently automating the Pidgin interface with my aol account to send messages to my phone, which of course at times can be completely inaccurate if the environment changes. Any help would be greatly appreciated. Thanks, Steven
  7. Cant you download the earlier versions from the website and use the correct compiler? This should have the decompiler you want: Go HERE
  8. Another thing too is that as soon as your song changes its going to get a new window title and the controlclick will no longer work, or will the window title stay the same always? Anyway if it changes you want to get the handle to your gui at the very beginning and then you wont have to reference the window title any more so something like this: $handle = controlgethandle("LaZy Slasher by Jebus","","CLASS CRAP HERE") controlclick("","",$handle,"left",1,x,y)
  9. Leave the text section blank. Unless Auto IT window info tool really states that the control has text then dont worry about it. Now, the "title" need to be the title of the window that your clicking into. So whatever the window info tools tells you is the title I would use that. Biggest problem your having is not specifying which control to click. That section is blank and we need to fix this: $oIE.navigate("website...") $GUIActiveX = GUICtrlCreateObj($oIE, 10, 100, 660, 515) ControlClick("LaZy Slasher by Jebus","","Handle to control goes here", "left", 2, 332, 228) Use the window info tool and grab the info that says something like this "[CLASS:MozillaWindowClass; INSTANCE:5]" put that where your handle goes and u should be good to go. Post back
  10. Let's modify this pixelsearch. If $akara is your char on screen then I wouldnt skip even 1 pixel. People complain about pixelsearch being slow but those are critical statements its by like the milliseconds that its slow. Use this instead: $akara = PixelSearch(182, 100, 745, 419, 381444, 8, 0,$handle) Try running the script in Scite and you will see what line its erroring at instead of compiling it into an .exe first. The error -1 is just the common error that occurs. Also, are you only wanting to search the client area of the game? If so then you need to put in: Opt("PixelCoordMode", 2) And possible need to re-do your square in which your searching. Anyway, run the script in Scite and see what line your erroring at.
  11. Yeah just use this code here. Go to that link first and find the key thats getting stuck for you. Find its value and replace my 16 for vkvalue with the key you have being stuck down.
  12. Well, stick with this. I just started to learn programming last year or scripting and programming. Now I have learned alot, but dont mess with VB this is much much much much easier, k.
  13. ;I think the color for your pixelsearch is messed up but if it works then awesome! ;I think it needs to be a hex value. Plus your skipping pixels i wouldnt do that. ;Doing control clicks you dont have to have the window active. $handle = WinGetHandle("Diablo II") $akara = PixelSearch(182, 100, 745, 419, 381444, 8, 1,$handle) If Not @error Then ControlClick("","",$handle,"left",1,$akara[0],$akara[1]); or do something like this. Sleep(1000) ; MouseMove($x, $y, 15) ControlClick("","",$handle,"left",1,$akara[0],$akara[1]) Sleep(10000) EndIf While 1 ;this loop will run forever. Need to fix this part. $RedHealth = PixelGetColor(86, 545,$handle) $HealthLow = 0 While $HealthLow < 1 $RedHealthMiddle = PixelGetColor(86, 545) If $RedHealthMiddle <> $RedHealth Then Send("1") Sleep(5000) EndIf WEnd WEnd Exit Or you may want the loop there I guess.
  14. Use the help file that came with autoit. Its in the start menu program -----> autoit
×
×
  • Create New...