Sign in to follow this  
Followers 0
s3xt0y

if then pixelsearch truble

19 posts in this topic

Alright basicaly , it wont work , can anyone spot the broken code?

MsgBox ( 64 , "Bot", "waiting.." )
WinWaitActive ( "EverQuest II (Nov 14 2006 16:36:00) USER OPTIMIZED: SOEBuild=3662T" )
If 
PixelSearch ( 0,0,@1024, @768, 0x02E800 ) then
send ("{F8}" )
send ( "1" )
send ( "2" )
send ( "3" )
EndIf

If 
PixelSearch ( 0,0,@1024, @768, 0xB90000 ) then
send ( "x" )
EndIf

Share this post


Link to post
Share on other sites



MsgBox ( 64 , "Bot", "waiting.." )

You don't have anything linked to this MsgBox?

WinWaitActive ( "EverQuest II (Nov 14 2006 16:36:00) USER OPTIMIZED: SOEBuild=3662T" )

I am assuming that the Date/Time will change every time this is ran. Perhaps look into the built in time macros.

If

PixelSearch ( 0,0,@1024, @768, 0x02E800 ) then

send ("{F8}" )

send ( "1" )

send ( "2" )

send ( "3" )

EndIf

Are you certain you wish to spam the keys as fast as your computer will process them?

Perhaps add a small sleep in between.

send ("{F8}" )
sleep(1000) ;<--
send ( "1" )
sleep(1000) ;<--
send ( "2" )
sleep(1000) ;<--
send ( "3" )

If

PixelSearch ( 0,0,@1024, @768, 0xB90000 ) then

send ( "x" )

EndIf

Are you meaning to run this only once, or is it supposed to be a continuous PixelSearch?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the reply , i am aware that the title will change , thats fine thought

also, thanks for the sleep inbetween commands.

also , why is the pixelsearch still broke , what did i do rong?

-edit- yes , continuous PixelSearch

and it needs to be a looped script all around , besides the msgbox.

Edited by s3xt0y

Share this post


Link to post
Share on other sites

From the Help File:

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

Your Modified Code:

If PixelSearch ( 0, 0, 1024, 768, 0xB90000 ) then
send ( "x" )
EndIf

Remember:

Top then Left then Right then Bottom

X: 0 then Y: 0 then W: 1024 then H: 768

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I'm pretty noob too but this is how I would do it

MsgBox ( 64 , "Bot", "waiting.." )
WinWaitActive ( "EverQuest II (Nov 14 2006 " & @HOUR & ":" & @MIN & ":" & @SEC & ") USER OPTIMIZED: SOEBuild=3662T" )

While 1 ;; It's the loop
    
Sleep(250)
    
PixelSearch ( 0, 0, 1024, 768, 0x02E800 ) ;Do the pixelsearch
If Not @error = 1 then ;If the color is found anywhere it will do that
send ("{F8}" )
Sleep(250)
send ( "1" )
Sleep(250)
send ( "2" )
Sleep(250)
send ( "3" )
Sleep(250)
EndIf

Sleep(250)

PixelSearch ( 0, 0, 1024, 768, 0xB90000 ) ;Do the pixelsearch
If Not @error = 1 then ;If the color is found anywhere it will do that
send ( "x" )
Sleep(250)
EndIf

WEnd

I'm not sure of the "IF" statement, what do you want to do about the pixelsearch ?? What i understand for the moment is that your search on all the screen for any pixel of this color and then it'll do the sendkey ... But i'm pretty sure this is'nt what you want to do. Could you explain more ?

Edited by newb_powa'

Share this post


Link to post
Share on other sites

As per your Edit:

To my knowledge, You cannot preform two separate PixelSearchs simultaneously, as AutoIt does not support multi threading.

If you merely wish for the script to run forever, you might try looking into whiles.

i.e.

while 1
 ;Insert Code
Wend
oÝ÷ ØZèØ^éi)^jëh×6
Example

$i = 0
While $i <= 10
    MsgBox(0, "Value of $i is:", $i)
    $i = $i + 1
WEnd

Share this post


Link to post
Share on other sites

ah , is there any alt way to get more then one pixel search , well , look for the color anyway?

Share this post


Link to post
Share on other sites

To my knowledge, no.

However, you can run them at separate times, merely very close to each other. As newb_powa' has done.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

ah , is there any alt way to get more then one pixel search , well , look for the color anyway?

I think you can do multiple pixelsearch at the time, but I would recommanded (is it the good word ??) to use small search area because it use a lot of CPU.

Look at my example, it is doing the twice pixelserch in like a second, or it should, not tested yet.

Sorry for bad english :S / Edit : some mistakes

Edited by newb_powa'

Share this post


Link to post
Share on other sites

thanks guys , worked like a charm! , now for me to finish it up.

Share this post


Link to post
Share on other sites

thanks guys , worked like a charm! , now for me to finish it up.

No problem :whistle:

If we can help you in any way, ask here.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Very welcome, if I was actually any help. :whistle: Just study the help file, it works miracles. http://www.autoitscript.com/autoit3/docs/

Edit:

I happened to think about something with your title.

add this to the top of the script :

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced

To get past your EverQuest Title problems.

Edited by jacob_1998_1999

Share this post


Link to post
Share on other sites

sorry too bump this , but i cant seem to get my hotkey too work, check this out

Hotkeyset ( "{F12}" , "Exit" )

i have tryed Func_quit and just Quit , im a nub , and i looked but i didnt find anything on it.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

sorry too bump this , but i cant seem to get my hotkey too work, check this out

Hotkeyset ( "{F12}" , "Exit" )

i have tryed Func_quit and just Quit , im a nub , and i looked but i didnt find anything on it.

Did you only read the helpfile ??

It's really easy

In ==> "" Hotkeyset ( "{F12}" , "Exit" ) "" Exit is the name of the function you want to call

Try that:

Hotkeyset ( "{F12}" , "_Exit" )

Func _Exit()

exit

Endfunc

Edited by newb_powa'

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Did you only read the helpfile ??

It's really easy

In ==> "" Hotkeyset ( "{F12}" , "Exit" ) "" Exit is the name of the function you want to call

Try that:

Hotkeyset ( "{F12}" , "_Exit" )

Func _Exit()

exit

Endfunc

1.) Use Code/Autoit Tags for easy reading

2.) Your missing a loop ;)

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

1.) Use Code/Autoit Tags for easy reading

2.) Your missing a loop :evil:

I know for AutoIt tag, only forget, thanks :lmao:

For the loop, it's only an exemple, it's not the main script, i think ;)

Share this post


Link to post
Share on other sites

well for an example yes but if you were to execute your code it would end instantly

Share this post


Link to post
Share on other sites

well for an example yes but if you were to execute your code it would end instantly

Lol I know, I'm not such a noob ;)

Anyway, nextime I'll make a loop :lmao: (just for you :evil: )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0