Jump to content

Recommended Posts

Posted

Hello,

I need your help because I am new at entering code.

I added also gif file and my problem is how the code must be If there is green colour, it goes on with "For $i = 2 To 1000" loop or If there is no green light, it resumes from where it stayed.

Complete of codes are like below;

 

whether the green color will activate 168. It is the line

153   ;Hafızaya alınmış kopyalanan değer Sayfa2 deki satir ve sutuna yapıştırılır.
154    ;Değerler excel de sağa doğru yapıştırılacak ise $satir, 1 deki değer 2,3,4 olarak değiştirilir.
155    sleep(1000)
156    $satir=$satir+1
157    $oExcel.Sheets("Sayfa2").cells($satir, 9).value=ClipGet()
158    ClipPut("")
159  
160  sleep(1000)
161  send("{TAB 3}")

http://s2.dosya.tc/server9/kypvrn/RENK_TESTI_ICIN_BSA_BSB_MUSTERI_11.rar.html

 

Posted (edited)

Firstly, thanks FrancescoDiMuro for your support.

 

Did you check this file at link below ?

http://s2.dosya.tc/server9/4b9s3k/COLOR_NEXT.gif.html

http://s2.dosya.tc/server9/kypvrn/RENK_TESTI_ICIN_BSA_BSB_MUSTERI_11.rar.html

The process is like that ; Autoit runs, excel opens, copies data first and pastes to a program called IFS, after that IFS opens

and start coping data from IFS.

 

But there is a limit of coping and it is 161st line.

 

160        sleep(1000)

161        send("{TAB 3}")

 

After 161st line, autoit needs to decide. If there is green colour, autoit have to pass to 26st line. If there is no green colour, autoit have to continue from 161st line.

 

Colour code : 0xC0E16E

Edited by mustilem23
Posted
52 minutes ago, mustilem23 said:

After 161st line, autoit needs to decide. If there is green colour, autoit have to pass to 26st line. If there is no green colour, autoit have to continue from 161st line.

What's difficult then?
Did you read the provided link?
You just need to obtain the color from the 161th row and so on, and compare it to the green colour; it's just an If...Else...EndIf statement :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Posted (edited)
Quote

  $oExcel.Sheets("Sayfa2").cells($satir, 9).value=ClipGet()

 

This way you can read color of text in given cell (I used this in one of my projects)

$color =  $oExcel.Sheets("Sayfa2").cells($satir, 9).Font.Color

I think maybe there is also something similar like this (try to investigate if you need background color of cell ...)

...cells($satir, 9).Font.Background.Color

 

Edited by Zedna
Posted

First of all, thank you for helping.

Dear Zedna,
I tried, but failed,
If you have the opportunity to watch the file in the file called ıfs a point in the green is going to be right here for $ i = 1 to 10000 will return to the green point if the project will continue from the point.

https://s2.dosya.tc/server9/4b9s3k/color_next.gif.html

In other words, the process does not excele the copy of the data in the program I get the name (IFS)

Can you check out the possible map again? There is a very short cycle.

Every customer is copying 3 data from the card, but the line is very much that the customer cards should autoit you :)

My head was officially like a potato :)
I'm just going to do software coding training for this. :):):)🙏

Posted

If you're trying to navigate through an Excel spreadsheet, DON'T use Send, use the Excel UDFs.

Send is highly unstable and is the last resort to be used when automating something. Unfortunately FAR too many newcomers think that it's the first thing to try and never really learn how to automate anything properly.

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

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
  • Recently Browsing   0 members

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