Sign in to follow this  
Followers 0
lolifox

Hello. I could use some assistance

7 posts in this topic

Hi. Im new here and at autoit scripting, soo i decided to start with simple (well i thought it would be simple) commands, but reading some manuals examples went to nowhere. Well basicly i want just that script enters some url's with IF commands, and should wait 4 seconds after opening link, mkey ill explain with more details, this site has pet growing game like in first screen

Posted Image

so as you see in that screen first i need to enter in map, so i just use http://www.l2021.com/bbs/pet.php?index=petpknpc&mapid=3 (1) , so as i enter in map i need enter next url http://www.l2021.com/bbs/pet.php?index=pet...action=fightnpc (2) and repeat it till i get text like (The monster is dead, search another one), then enter (1) url and then keep entering (2) till get (The monster is dead, search another one) and do the same thing over and over, except IF on the opened window there is text like (patrolling) click (F5 - refresh), sooo i hope you didnt droped it already :) and heres is the somethin i maked :/

WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox")
ShellExecute("http://www.l2021.com/bbs/pet.php?index=petpknpc&mapid=3")
    If text ("A monster frowns on you and start to attack. or A monster frowns on you and start to attack.") Then ShellExecute(http://www.l2021.com/bbs/pet.php?index=petpknpc&action=fightnpc")
    Repeat it till get text ("The monster is dead, search another one")
        If text ("patrolling")
            Send("F5")
            If text ("This monster is dead!")
                Send("F5")

P.S if you have more questions please to write them :P

Share this post


Link to post
Share on other sites



in other words i just need to know the IF probability like ex.: if there is text do that, ill handle other codes (well will try :)

)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You should have something like:

$x = pixelgetcolor(;the coordinates of a point IN the text)
If $x = 0x000000 Then ;colour black => the text appeared
;Do this:
Else if $x = colour white Then
;The text didn't appeared, and do this
EndIf

It's a rough example, because my internet sucks so I couldn't open your link. Just set the coordinates and the color of text/background .

Cheers!

Edited by Kiti

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

hmm i get error on coords :/

Opt("WinWaitDelay", 4000)
Opt("WinTitleMatchMode", 4)

WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
$Coord = pixelgetcolor(232, 250, 476, 446, 0xF5FBFF, 5 )
If $Coord = 0xF5FBFF Then
Send("F5")
EndIf

i want it to triger then patroling text appear in that location and hit F5

Edited by lolifox

Share this post


Link to post
Share on other sites

well since no one replies, ill add another screen an example what i would like

Posted Image

(maybe it seems very easy, but any help would be appreciated)

Share this post


Link to post
Share on other sites

hmm i get error on coords :/

Opt("WinWaitDelay", 4000)
Opt("WinTitleMatchMode", 4)

WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
$Coord = pixelgetcolor(232, 250, 476, 446, 0xF5FBFF, 5 )
If $Coord = 0xF5FBFF Then
Send("F5")
EndIf

i want it to triger then patroling text appear in that location and hit F5

That's because you've used pixel get color in a wrong way (pixelsearch way). The correct syntax. You can find yourself the right way of doing it: Why do you need to specify the colour if the colour is what you need to find? It color drops. You can't get the color of an entire retangle, but just of a one single pixel => 2nd, 3rd and the step drops. The result is:

$coord = pixelgetcolor(232,250)

or whatever pixel is always changing when the text appears.

If you change this, it will work fine.

Cheers!

Kiti

Share this post


Link to post
Share on other sites

well since no one replies, ill add another screen an example what i would like

you should be using the _IE* functions to navigate through webpages -- usings firefox with pixelsearch etc : not really working at all : so thats why noone can help much

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