Jump to content

if then pixelsearch truble


s3xt0y
 Share

Recommended Posts

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
Link to comment
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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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'
Link to comment
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
Link to comment
Share on other sites

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'
Link to comment
Share on other sites

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
Link to comment
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.

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'
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...