Ok i will star tof by saying im a noob at this but have been playign with auto it on and off for the past week or so, mainly to see how much i could do and ive done abit code wise but loops always seem to confuse me, specially when im needing an array too.
Anyway i'll try and explain the best i can.
The code below is to search for an image, one the image is found it contines with more code, what i would like to do is make it so that "if" it does not find the image its looking for it checks for an alternative image example: "warehouse1.png|warehouse2.png|warehouse3.png" this is what i have so far but it will not loop though images in my tests.
Second lot im just confused with how i would do it so many someone can help. Basically i want the code to run to a certain point and then "search" for an image before proceeding further, so far though all i ahve had is the code running in a loop repeating actions:
Code:
Func DoInstance()
logfile("Setting up instance")
ConsoleWrite("Setting up instance")
MouseClick ("left", 500 , 608)
sleep(Random(1000,1500))
MouseClick ("left", 490 , 660)
sleep(Random(1000,1500))
MouseClick ("left", 290 , 580)
sleep(Random(1000,1500))
MouseClick ("left", 700 , 440)
sleep(Random(1000,1500))
logfile("Selecting fleets")
ConsoleWrite("Setting up fleets")
call("fleet")
logfile("Starting instance")
ConsoleWrite("Starting instance")
MouseClick ("left", 700 , 380); OK
sleep(Random(1000,1500))
logfile("End of instance")
ConsoleWrite("End of instance") ; <====== need the code to stop here and wait till image below is found before restarting the loop
$img = _ImageSearchArea($pngLoc & "close.png", 1, 0, 0, @Desktopheight, @DesktopWidth, $x, $y, 100)
If $img = True Then
logfile("collecting mail")
ConsoleWrite("collecting mail")
call ("mail")
EndIf
Why StringSplit($FileList[$i],"|")?
According to you should be able to just use $FileList[$i].
_ImageSearchArea() does not return a boolean on success. It's actually an array with x and y coordinates.
-> If IsArray($img) ...
--> X-Coord: $img[0] // Y-Coord: $img[1]
If you want to store the certain value of the array on another var, you better use $image = $array[$i], instead of $image = $array[1].
Thanks for the reply Imaginar, i used it because it was from code i saw if im honest. So thught it was needed if not then when i look at the script again i will remove it.
As for your other answer i'll have a play when i open up the script again. Like i said im new to all this and arrays, loops and what not confuse me lol i just want to cut the code down and improve it a little.
Thansk for your time and like i said soon a i get hance i'll play about =)
SRO-db Bot Loop Issue 07/28/2010 - SRO Private Server - 10 Replies Can someone clarify it please? What we are going do EXACTLY? I ask this again and again because it is not really clear.
[zszc] loop issue. 07/11/2010 - SRO Private Server - 2 Replies hey guys atm im trying to bot at zszc.
and it start looping going to storage and stuck.
is there anyway to bypass it?
i mean not even putting stuff inside the storage just keep going or i have to do it manually to take him to the spot?
thanks in advance
Lag delay issue (SWSRO-Updated) 09/02/2009 - SRO Private Server - 27 Replies Tell me guys if lags are still in SWSRO horrible as they were before updating client or NOT. :handsdown:
I quit SWSRO only for delay reason, i will rather play AdventureQuest then on swsro with such lags :mad:
Main question : The current situation of SWSRO server ?
:pimp: