Sign in to follow this  
Followers 0
powerpoison

Bunch of Question i need the answear of :D

8 posts in this topic

Hello everyone,

well direct to the point, i'm creating a automation script that will run without any GUI so no problem concering the creation of one still I'm quite blocked in some points i can not think a way off my self, and some suggestion would be great :)

First of all, i'm doing a main cycle like this

For $i=0 To 1000000 Step 1
    Function()
    $i=$i+1
Next
exit_Function()

and since i had a stack overflow problem i wanted to ask if the stack get freed up each time the cycle go into a new step, in addition i would like to know if step 1 is the right way to make it keep increasing of 1 each time it runs ( it is currently working but i dunno if this behave like this or do something like currently returning TRUE and keep going since i'm not used to this "for" syntax style...)

it would be great if some1 could tell me where i could find in the help file the basic things like the Do while , for while etc.. syntax since i searched it by my self but i was unsuccesfull of finding it :S

That said i would like to know if there is a way to find a Pixel rectangle structured like a predefinied bitmap, dunno like the function PixelSearch but instead of giving a colour, giving actually a pixel checksum ( like the one returned from PixelChecksum) to find a image inside another image, like a T (wich have EVERYTIME the EXACTLY same dimension,color shade and things, so perfectly Equal)inside the image of a text could it be i dunno like "Don'T" and returning a x and y coordinate where it was found, if there is one way, how to and what does it return as a value?

last but not least i'm doing something like this:

Func Function()
$var =PixelGetColor ( 726, 28 )
$varhex=Hex($var, 6)
If $varhex < "FFFFFF" Or $varhex > "FFFFF9" then
Send("!Q");//step 1
EndIf
Sleep(500)
$var =PixelGetColor ( 726, 28 )
$varhex=Hex($var, 6)
If $varhex < "FFFFFF" Or $varhex > "FFFFF9" then
mouseclick ( "left", 255, 255,2,100 );//step 2
Sleep(500)
EndIf
$var =PixelGetColor ( 726, 28 )
$varhex=Hex($var, 6)
If $varhex < "FFFFFF" Or $varhex > "FFFFF9" then
mouseclick ( "left", 285, 251,1,100 );//step 3
Sleep(500)
EndIf
$var =PixelGetColor ( 726, 28 )
$varhex=Hex($var, 6)
If $varhex < "FFFFFF" Or $varhex > "FFFFF9" then
mouseclick ( "left", 355, 655,1,100 );//step 4
Sleep(500)
EndIf
EndFunc

Because i need it to Constantly check if the condition is true before proceding, if the condition is true untill step 2 and then suddendly (and i really mean "SUDDENDLY") changes it Must block and exit the Func called Function()

i dunno if this can be done in any other way, this way it doesn't give me the timing precision i need, because indeed when the condition change sometimes it doesn't detect it if not after actually doing the step ( could it be the first step second step third or 4th etc...)

Thanks for the time and effort you are spending to read and answear me ^^

Share this post


Link to post
Share on other sites



Step 1 is not necessary as that is the default, see this section of the Help file for loop syntax - Language Reference - Loop Statements.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

First off, no need to put in the step parameter as a For Next loop always defaults to step 1. Also, you're incrementing $I by 1 each time through the loop, is there a reason for that?

Without a reproducer script, one that runs and shows the problem, without having to be your whole script, it's impossible to know why you're getting a stack overflow problem.

The last question you asked, the way your code is written right now the only time it will detect a change at step 2 is when it is running the code at step 2, not before and not after. Other than making each check an independent check there's really no way around a top down execution process.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Step 1 is not necessary as that is the default, see this section of the Help file for loop syntax - Language Reference - Loop Statements.

thanks that solved one of my problems and Language Reference - Loop Statements was the thing i was looking for ^^ thanks dude

First off, no need to put in the step parameter as a For Next loop always defaults to step 1. Also, you're incrementing $I by 1 each time through the loop, is there a reason for that?

Without a reproducer script, one that runs and shows the problem, without having to be your whole script, it's impossible to know why you're getting a stack overflow problem.

The last question you asked, the way your code is written right now the only time it will detect a change at step 2 is when it is running the code at step 2, not before and not after. Other than making each check an independent check there's really no way around a top down execution process.

actually there is no reason for the $i to be increased gosh, i did not noticed it, i did all the whole script in a 7 hours stand so something like this can happen :) thanks for the fix ^^

about the stack overflow i readed around this forum and found out i was actually doing a funtion to function to function call that had no actual ending so this will never clear my stack, the question i was asking was, if i call each funtion in the loop, while the stack clear itself after each esecution or it will be the same as a funtion to funtion to function call?

about the last question, the condition seems to be checked with a timing of like i dunno 80% so it actually do the step a little before doing the step itself, dunno like if it was

if condition =true

sleep(300)

step2

while i want it to do step2 just after checking... else it will lead to a misworking...

thanks for the fixes and the time ^^

Edited by powerpoison

Share this post


Link to post
Share on other sites

thanks

You bet. Also, as BrewManNH pointed out (and I missed..) , it is not necessary to manually increment $i as it is the parameter for the For..Next loop.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

about the last question, the condition seems to be checked with a timing of like i dunno 80% so it actually do the step a little before doing the step itself, dunno like if it was

if condition =true

sleep(300)

step2

while i want it to do step2 just after checking... else it will lead to a misworking...

okay i found out the problem was not in this portion of the code, but in another function in wich i did not the step by step check routine and that caused the problem in timing i was searching of... now the last question that is still unsolved is :

That said i would like to know if there is a way to find a Pixel rectangle structured like a predefinied bitmap, dunno like the function PixelSearch but instead of giving a colour, giving actually a pixel checksum ( like the one returned from PixelChecksum) to find a image inside another image, like a T (wich have EVERYTIME the EXACTLY same dimension,color shade and things, so perfectly Equal)inside the image of a text could it be i dunno like "Don'T" and returning a x and y coordinate where it was found, if there is one way, how to and what does it return as a value?

Anyone have some clue about this ?

thanks for the time and efforts ^^

Share this post


Link to post
Share on other sites

powerpoison,

Perhaps this might help? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

powerpoison,

Perhaps this might help? :)

M23

it was something similar i was trying to do, thanks for the hint ^^ well solved everything ^^ thanks guys keep up the good work :)

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