NPC Clicker Code question

11/27/2016 20:43 Drollex#1
Hello guys, I have a question.
Whats wrong with the following code? when I press the i key mouse wont move and click a npc :/
Code:
#include <ImageSearch.au3>

HotKeySet("i", "Start")

$X = 0
$Y = 0

Func Start()
	$Search = _ImageSearch('ui.png', 0, $X, $Y, 0)
	If $Search = 1 Then
		MouseMove($X, $Y, 10)
	EndIf
EndFunc

while 1
		sleep(100)
	WEnd
11/27/2016 21:00 lollo900#2
Change image
11/27/2016 21:04 Drollex#3
Quote:
Originally Posted by lollo900 View Post
Change image
do you mean the .png to .bmp? I already tried many different images
11/27/2016 21:15 skeith_sk8#4
Can you upload the image you are using?.... Increase the shade too
11/27/2016 21:17 lollo900#5
Quote:
Originally Posted by Drollex View Post
do you mean the .png to .bmp? I already tried many different images
I mean ui.png
11/27/2016 21:18 PNTX#6
[Only registered and activated users can see links. Click Here To Register...]
11/27/2016 21:23 Drollex#7
Quote:
Originally Posted by skeith_sk8 View Post
Can you upload the image you are using?.... Increase the shade too
[Only registered and activated users can see links. Click Here To Register...]

This is what I was using at the first try
11/27/2016 21:34 skeith_sk8#8
Quote:
Originally Posted by Drollex View Post
[Only registered and activated users can see links. Click Here To Register...]

This is what I was using at the first try
Try this code with the following image

Code:
#include <ImageSearch.au3>
HotKeySet("i","normal")

$X=0
$Y=0

Func normal()
   $Search = _ImageSearch('ui.bmp', 0, $X, $Y, 0)
   If $Search = 1 Then
	  MouseClick("left",$x+45+Random(-2,2,1),$y-50-Random(-2,2,1),1,1)
          sleep(Random(300,350,1))
	  Send("{LCTRL}")
   EndIf
EndFunc

while 1
	sleep(100)
WEnd

This is a little part of the code of my tool (not exactly but very similar). I think that the problem you have its the image. Search the names, not the alien.
12/01/2016 17:33 Drollex#9
Still not working :/ When I hit the i button the function works but its not moving the mouse or smth like that
12/01/2016 18:58 ~Demetrio~#10
Quote:
Originally Posted by Drollex View Post
Still not working :/ When I hit the i button the function works but its not moving the mouse or smth like that
are you using shades of variation??
12/01/2016 19:08 skeith_sk8#11
Quote:
Originally Posted by ~Demetrio~ View Post
are you using shades of variation??
I already advised him to use it. Anyways the code i provided works properly (at least on my pc)
12/01/2016 20:24 Drollex#12
I tried now many multiple images to search on my desktop absolutely nothing works
12/01/2016 22:06 Freshek#13
Quote:
Originally Posted by Drollex View Post
I tried now many multiple images to search on my desktop absolutely nothing works
Try to use another ImageSearch library. This one is crap.
12/02/2016 13:50 Drollex#14
Quote:
Originally Posted by Freshek View Post
Try to use another ImageSearch library. This one is crap.
I already tried 5 different libraries
12/02/2016 13:58 skeith_sk8#15
This is the one i use