Jump to content
Sign in to follow this  
Amiekbir

Need help in making a script

Recommended Posts

Amiekbir

Hi I am new to this forum. And pretty new to auto-it. My friend directed me to here for help.

I just want to know how to read from text file and write it according to the order.I want to modify the names in text file as according to my wish.Also no matter whenever i start the script it should start from the last name written until it ends. When it ends if i start the script again it is gonna start from word 1

Example text file.

word1,word2,word3

for word1 write dada,word2-asda etc.

Please help! :

Edited by Amiekbir

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

Can you please tell us why you need to create so many (how many?) Gmail addresses? What do you want to do with this mail accounts?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

Its just an example. I just wanna learn how to read files into autoit and write accordingly. And get used to know the pixel or id function. Just practice as i am learning. Does not necessarily be creating new accounts.

Share this post


Link to post
Share on other sites
Amiekbir

Any help would be appreciated. Thanks in advance. I hope i will learn how to do it.

Share this post


Link to post
Share on other sites
water

If you just want to learn AutoIt I suggest to read the tutorial section of the Wiki as a start.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

Read it but could not figure out that part. :(.

Got 7 posts left today anyways lolz.

Thanks for the advice.

Share this post


Link to post
Share on other sites
water

As a start:

Reading files: See function FileReadLine or _FileReadToArray.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

thanks but how it detects the file path say my text file is in d drive. It will still read it?

Share this post


Link to post
Share on other sites
water

You have to specify the file path in the FileReadLine statement. Please check the help file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

Figured out the pixel and most of it. Only problem is the reading from a text file.

Anyone wanna give me an example please.

Share this post


Link to post
Share on other sites
water

The help file has examples at the end of every function.

So please search the help file for FileReadLine and scroll down to the end for an example.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

ok done and now how you make it read the consecutive in the order? Say in a while loop. And i can modify that in word or text file.

sad,bad,had

dad,take,make.

Thanks Water.

Share this post


Link to post
Share on other sites
water

To read a file, change the content and then write the file I would use:

  • _FileReadToArray
  • Loop through the array and change the content as needed
  • _FileWriteFromArray to write the data to a file

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

Thanks.I read the help file and the examples but harder for me lolz.

is it possible to read from one text file while write those words in another text file. Any example script that you can show. I learn more from actual examples or videos.

Anyways thank you very much for replying to newbie like me :D

Share this post


Link to post
Share on other sites
Melba23

Amiekbir,

I have lifted the 10 post "New Member" limit for you - it looked as if you were going to bump into it very quickly. ;)

However, please take the time to read the Forum rules (there is also a link at bottom right of each page) as asking for an email creation spammer in your first post was not the best way to begin here. :naughty:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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
Amiekbir

oh sorry.....i though that wld be good example. I just wanna learn lolz the 1st example came to me was that.....u can edit it or advice me to change it.Thanks

Share this post


Link to post
Share on other sites
water

Sample script to read a whole file to an array, loop through the array and change some content, then write the array to another file:

#include <Array.au3>
Global $aFileIn
_FileReadToArray("path of file to read from goes here", $aFileIn)
For $iIndex = 1 To $aFileIn[0]
    If $aFileIn[$iIndex] = "Old value...." Then $aFileIn[$iIndex] = "New value"
Next
_FileWriteFromArray("path of file to write to goes here", $aFileIn)

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

Arigato gozaimas water taicho san :D.

And in the file path _FileReadToArray("path of file to read from goes here")

do i type something like A:Autoit Tutorials ?

Share this post


Link to post
Share on other sites
water

Yes, insert the whole path to a file you want to read e.g. "C:temptest.txt"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Amiekbir

Ok done but i have one more problem .

#include <ImageSearch.au3>

sleep (5000)

$A= 0

$B= 0

Func Start()

$Search = _ImageSearch('Capture.PNG',0,$A,$B,0)

If $Search=1 Then

MouseMove($A,$B,10)

EndIf

EndFunc

While 1

sleep(100)

WEnd

Not doing what it shld do. I want to click on that image no matter where it is on desktop.But it is not doing that.

One note is i use 64 bit windows 7 home premium.

Edited by Amiekbir

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  

×