|
You last visited: Today at 08:27
Advertisement
Script clicks all the time
Discussion on Script clicks all the time within the AutoIt forum part of the Coders Den category.
08/23/2014, 14:48
|
#1
|
elite*gold: 0
Join Date: Jun 2014
Posts: 5
Received Thanks: 0
|
Script clicks all the time
Hello!
I used to use autohotkey, but since it is not possible to use on the server I play, i have found autoit. It is completely new for me. After few days of reading I have created my own script where
1)pixel should be read at given coordinates
2)if pixel is not there F4 should be sent
Script should be working over and over. Unfortunately for me -
script is not doing anything.
If i use "Not @error" then it is pressing f4 all the time even I'm 100% sure pixel is there.
To explain what this script should do - use mana potion in Lineage2 when mp gets lower.
Can anybody please guide me through the wrong part of my code?
Code:
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
_WinWaitActivate("Lineage*II * ","")
HotKeySet("{ESC}", "Terminate")
While 1
PixelSearch( 234, 54, 0, 0, 0x234B88)
If @error Then
Send("{F4}")
Sleep (500)
EndIf
WEnd
Func Terminate()
Exit 0
EndFunc
|
|
|
08/23/2014, 17:20
|
#2
|
elite*gold: 113
Join Date: Dec 2009
Posts: 16,685
Received Thanks: 4,450
|
Code:
While True
$bPixel = PixelSearch( 234, 54, 0, 0, 0x234B88)
If $bPixel = 0 Then
Send("{F4}")
Sleep (500)
Else
Sleep(50)
EndIf
WEnd
Sorry, didn't use Scite to write this, but this should actually work out.
As far as I know, Pixelsearch does not throw @error, if the pixel is not found, but simply returns 0.
|
|
|
08/23/2014, 18:31
|
#3
|
elite*gold: 0
Join Date: Jun 2014
Posts: 5
Received Thanks: 0
|
Quote:
Originally Posted by Shanks
Code:
While True
$bPixel = PixelSearch( 234, 54, 0, 0, 0x234B88)
If $bPixel = 0 Then
Send("{F4}")
Sleep (500)
Else
Sleep(50)
EndIf
WEnd
Sorry, didn't use Scite to write this, but this should actually work out.
As far as I know, Pixelsearch does not throw @error, if the pixel is not found, but simply returns 0.
|
Thanks for your input, but most of the sources says that @error should work.
I just tried your version and again, it just keeps spamming F4.
Looks like I have to find better way how to determine x,y and color of Lineage II client. Maybe the problem is in x, y, and color itself?!
I was using autoit tool.
|
|
|
08/23/2014, 18:56
|
#4
|
elite*gold: 113
Join Date: Dec 2009
Posts: 16,685
Received Thanks: 4,450
|
Use the
Code:
PixelGetColor ( x , y [, hwnd] )
method to find out, wether or not your Color Hex is right.
|
|
|
08/23/2014, 21:03
|
#5
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
Quote:
Originally Posted by Shanks
Code:
While True
$bPixel = PixelSearch( 234, 54, 0, 0, 0x234B88)
If $bPixel = 0 Then
Send("{F4}")
Sleep (500)
Else
Sleep(50)
EndIf
WEnd
Sorry, didn't use Scite to write this, but this should actually work out.
As far as I know, Pixelsearch does not throw @error, if the pixel is not found, but simply returns 0.
|
It throws @error but better check with IsArray because @error can fail in some cases
|
|
|
08/24/2014, 06:53
|
#6
|
elite*gold: 0
Join Date: Jun 2014
Posts: 5
Received Thanks: 0
|
Thanks guys!
The secret was in
HTML Code:
Opt('PixelCoordMode',0)
It is 5.51AM but i got it done.
I have a million of questions, but lets leave them to other day.
Cheers again!
|
|
|
Similar Threads
|
[SCRIPT] P.E.T. Auto-Kamikaze (working in background, no mouse clicks)
01/16/2012 - DarkOrbit - 88 Replies
With the new version client of darkorbit 5.x, this tool is not working anymore, if an update will be I will post here
Short info:
This script will auto-repair, auto-start, auto-select kamikaze. Is all working in background so it wont use your mouse as coordinates, so you can battle easy in PvP or use on cubikons.
Also you can have multiple modules and still working like a charm.
Download and use:
PET Kamikaze 1.3
Must do to work:
|
Server time script(A very easy java script)
12/22/2008 - CO2 Private Server - 4 Replies
Put this in ur body tag
<table>
<td>
<span id="liveclock" style="position:absolute;Change this to left or right:1;change this to bottom or top:1;"></span>
<script language="JavaScript">
<!--
|
All times are GMT +1. The time now is 08:27.
|
|