Pixel search and mouseclick - c#

06/21/2013 13:26 fuso98#1
How i want to use AutoitX.dll in c# for to make a pixelbot with c# but with some function of autoit like PixelSearch and Mouseclick. Is this possible? if yes, what i must write in the code of c# source?
06/21/2013 15:54 Shishidump#2
I dont know of c# but in AutoIt is it like this :
Code:
$resultxy = PixelSearch(0, 0 , 20, 300, 0x343434)
If Not @error Then
	MouseClick("Left", $resultxy[0], $resultxy[1])
EndIf
06/21/2013 16:00 Futur94#3
Code:
HotKeySet("{F6}","_Exit")

While 1
      $Variable=PixelSearch(left,top,right,bottom,color)
      If IsArray($Variable) = True Then
         MouseMove($Variable [0], $Variable [1],1)
         MouseClick ("left")
      EndIf
WEnd

Func _Exit()
      Exit
EndFunc
MFG, Futur94 :)
06/21/2013 18:13 YatoDev#4
Quote:
Originally Posted by Shishidump View Post
I dont know of c# but in AutoIt is it like this :
Code:
$resultxy = PixelSearch(0, 0 , 20, 300, 0x343434)
If Not @error Then
	MouseClick("Left", $resultxy[0], $resultxy[1])
EndIf
:facepalm:
Quote:
Originally Posted by Futur94 View Post
Code:
HotKeySet("{F6}","_Exit")

While 1
      $Variable=PixelSearch(left,top,right,bottom,color)
      If IsArray($Variable) = True Then
         MouseMove($Variable [0], $Variable [1],1)
         MouseClick ("left")
      EndIf
WEnd

Func _Exit()
      Exit
EndFunc
MFG, Futur94 :)
:facepalm:

@fuso98 : import that .dll in c# and greate a namespace for it
06/23/2013 03:12 Requi#5
Add the dll as reference in your project.
Then you need to declare a variable, for the autoit object:
Code:
public AutoItX3 a = new AutoItX3;
You can use it in your script on that way:
Code:
a.PixelSearch(....)
06/27/2013 10:12 fuso98#6
thank's to fluttershy and requi ;)
06/27/2013 10:17 Requi#7
Quote:
Originally Posted by fuso98 View Post
thank's to fluttershy and requi ;)
No plan.
But you can't use all functions from autoit ;)
06/27/2013 10:25 fuso98#8
yes i know it xD i only whant to use some function that in c# there's not ;)
06/27/2013 10:30 Requi#9
You can do everything as I know.
You just need to write that function yourself.