Jump to content

Help please


idaser
 Share

Recommended Posts

Hello again. I want to "copy and past" thousands of names that I got saves in a notepad to another place. I wanna know if there is anyway to copy them one by one. For example if I got 3 names:

Mike

John

Charlie

I'd like to have a script that copies one name, the one that I indicate to it.

Thanks. :)

First of all, the way to identify the names (which are thousands and separated as seen on the example (one name per a txt line)), should be like this: The first round (or the first time)(notice that the program is overall an automatic clicking of the mouse (and some send's..) that repeats infinitely) it should take the 1st line name, then at the second round (or the first repeat), it should take the second line name, and so infinitely.

Here I give you the whole script which is not so large. I still needing to add the func that repeats all the process, anyway i'll mark you where the "copy" or "take the name" process should go, and also where I'll "past" or "send it".

WinActivate("A WINDOW")
sleep(500)
MouseClick("left", 499, 397,1)
Sleep(6100)
$var = PixelGetColor(634,295)
if $var = 8496036 Then
sleep(500)
MouseClick("left", 692,544,1)
sleep(500)
MouseClick("left", 881,690,1)
sleep(500)
MouseClick("left", 627,556,1)
sleep(500)
------------HERE I MUST "SEND" OR "COPY" THE NAME------------------
sleep(500)
MouseClick("left",633,581,2)
sleep(1500)
Send( "mokito13")
Else
    _DoSomethingElse()

The most important thing is that after doing the 1st time script, it must take the 2nd line name from the .txt, and then at the 3rd time take the 3rd line name.

Idk if i've been clear enough, but if need more help, please tell me.

THANKS

Link to comment
Share on other sites

That sounds terribly close to a bot having suspicious aims. You did read the top post about bots and game automation, didn't you?

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I have no clue if what you are trying to do will work well (if at all). But answering your question, here is one way.

Local $TextFile = "PathToYourTextFile.txt"
Local $String = FileRead($TextFile)
$Array = StringSplit($String, @LF)
For $i = 1 To $Array[0]
    If Not $Array[$i] Then ContinueLoop ;If the line is blank, skip to next
    WinActivate("A WINDOW")
    Sleep(500)
    MouseClick("left", 499, 397, 1)
    Sleep(6100)
    $Var = PixelGetColor(634, 295)
    If $Var = 8496036 Then
        Sleep(500)
        MouseClick("left", 692, 544, 1)
        Sleep(500)
        MouseClick("left", 881, 690, 1)
        Sleep(500)
        MouseClick("left", 627, 556, 1)
        Sleep(500)
        Send($Array[$i])    ;the line you requested
        Sleep(500)
        MouseClick("left", 633, 581, 2)
        Sleep(1500)
        Send("mokito13")
    Else
        _DoSomethingElse()
    EndIf
Next

EDIT: Why are you posting the same question with 2 different names!!!! This is not a pay-forum, so your questions do not have to be answered on your schedule...Hell, they do not have to be answered at all!!!

Edited by Varian
Link to comment
Share on other sites

So you got scolded for bumping a thread, so you copied the piece of code offered and started another thread of the exact same topic? That is some ridiculously horrible forum etiquette.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Not to mention the fact the person could get banned for multiple accounts and that can happen very quickly.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Im mokitooo, the one who created the 1st thread about this. I don't care if you are going or not to trust me, but idaser is a friend of mine that is working with me on the script, so he bumped my thread, so it would not be multiple account. I know it's maybe spam or thread copy, or whatever the admins of this forum could condemn, but exclude the multiple account idea, I do not support the spam or the multiple account.

Link to comment
Share on other sites

I have no clue if what you are trying to do will work well (if at all). But answering your question, here is one way.

Local $TextFile = "PathToYourTextFile.txt"
Local $String = FileRead($TextFile)
$Array = StringSplit($String, @LF)
For $i = 1 To $Array[0]
    If Not $Array[$i] Then ContinueLoop ;If the line is blank, skip to next
    WinActivate("A WINDOW")
    Sleep(500)
    MouseClick("left", 499, 397, 1)
    Sleep(6100)
    $Var = PixelGetColor(634, 295)
    If $Var = 8496036 Then
        Sleep(500)
        MouseClick("left", 692, 544, 1)
        Sleep(500)
        MouseClick("left", 881, 690, 1)
        Sleep(500)
        MouseClick("left", 627, 556, 1)
        Sleep(500)
        Send($Array[$i])    ;the line you requested
        Sleep(500)
        MouseClick("left", 633, 581, 2)
        Sleep(1500)
        Send("mokito13")
    Else
        _DoSomethingElse()
    EndIf
Next

EDIT: Why are you posting the same question with 2 different names!!!! This is not a pay-forum, so your questions do not have to be answered on your schedule...Hell, they do not have to be answered at all!!!

Man, I've used that script to get the names from the notepad, but that script what is doing is to get the all the names (one by one) at same time. Lemme explain, I would need a script that gets the second name after the whole script has been executed. Well, here i will post the whole script and explain you what I precisely need, and please tell me if it's or it's not possible if you have idea. Here goes the script:

WinActivate("A WINDOW")
sleep(500)
MouseClick("left", 499, 397,1)
Sleep(4500)
$var = PixelGetColor(634,295)
    if $var = 8496036 Then
        sleep(500)
        MouseClick("left", 692,544,1)
        sleep(500)
        MouseClick("left", 881,690,1)
        sleep(500)
        MouseClick("left", 627,556,1)
        sleep(500)
        -------HERE I NEED TO SEND THE NAME-------
        sleep(500)
        MouseClick("left",633,581)
        sleep(1500)
        Send( "majosa")
        sleep(2000)
    Else
        _DoSomethingElse()
    EndIf


$var_1 = PixelGetColor(638,579)
if $var_1 = 0 Then
    sleep(2000)
    Send("{ENTER}")
    sleep(3500)
    Else
    _DoCacota()
EndIf

MouseClick("left",494,388)
Send("201294")
sleep(1000)
Send("{TAB}")
Send("201294")
MouseClick("left",490,462)



sleep(1000)
    $13 = PixelGetColor(554,357)
    if ($13 = 4503510) Then
        _DoCacota15()
    EndIf


MouseClick("left",647,592)
$14 = PixelGetColor(859,596)
if not ($14 = 11657443) Then
    MouseClick("left",512,861)
Else
    _DoCacota16()
EndIf





sleep(2000)
$4 = PixelGetColor(577,752)
if not ($4 = 8153942) then
    MouseClick("left",493,543)
    sleep(500)
Else
    _DoCacota4()
    EndIf

$5 = PixelGetColor(541,356)
if not ($5 = 13998039) Then
    MouseClick("left",698,587)
    sleep(300)
Else
    _DoCacota5()
EndIf


$18 = PixelGetColor(564,271)
if not ($18 = 16758273) Then
    MouseClick("left",294,801)
Else
    _DoCacota20()
EndIf



sleep(200)
$random=random(20,100000,1)
$6 = PixelGetColor(181,189)
if not ($6 = 1664157) Then
    send("JJJ")
    send($random)
Else
    _DoCacota6()
EndIf


$7 = PixelGetColor(857,368)
if not ($7 = 14079697) Then
    MouseClick("left", 743,674)
    sleep(50)
Else
    _DoCacota7()
EndIf

$21 = PixelGetColor(720,561)
if ($21=4431555) Then
    MouseClick("left", 601,555)
Else
    _DoCacota21()
EndIf



sleep(3000)
$8 = PixelGetColor(721,559)
if not ($8 = 5088456) Then
    MouseClick("left",642,572)
Else
    _DoCacota8()
EndIf


$15 = PixelGetColor(886,582)
if not ($15 = 8443108) Then
    MouseClick("left",629,858)
Else
    _DoCacota17()
EndIf



$var_3 = PixelGetColor(715,816)
    if not ($var_3 = 7891024) Then
        sleep(5000)
    Else
        _doCacota3()
    EndIf

MouseClick("left",892,572)
$CloseToWindow = PixelGetColor(776,517)
if $CloseToWindow = 4302284 Then
    Send("{ENTER}")
Else
    _DoCacota22()
EndIf




sleep(500)
MouseClick("left",1117,899)
$10 = PixelGetColor(646,377)
if not ($10 = 10463144) Then
    _DoCacota10()
Else
    MouseClick(594,565)
EndIf


$11 = PixelGetColor(598,566)
if not ($11 = 9828095) Then
    MouseClick(600,557)
Else
    _DoCacota12()
EndIf


sleep(3000)
$12 = PixelGetColor(598,552)
if not ($12 = 13036538) Then
sleep(3000)
_DoCacotaMaxima()
Else
    _DoCacota13()
EndIf



Func _DoCacota22()
    MouseClick("left",892,572)
$CloseToWindow = PixelGetColor(776,517)
if $CloseToWindow = 4302284 Then
    Send("{ENTER}")
Else
    _DoCacota22()
EndIf
EndFunc


Func _DoCacota()
    MouseClick(627,556,1)
    Sleep(1000)
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Sleep(1000)
    MouseClick("left", 633,581,2)
    Send("majosa")
    $var_1 = PixelGetColor(638,579)
if $var_1 = 0 Then
    sleep(2000)
    Send("{ENTER}")
    sleep(5000)
Else
    _DoCacota()
EndIf
EndFunc


Func _DoCacota2()
    MouseClick("left",686,552)
    sleep(5000)
    $var_2 = PixelGetColor(702,676)
    if $var_2 = 9862528 Then
        sleep(1000)
        MouseClick("left",639, 860)
    ElseIf $var_2 = 9731199 Then
        sleep(2000)
        MouseClick("left", 639, 860)
    Else
        _DoCacota2()
    EndIf
EndFunc



Func _doCacota3()
    MouseClick("left",629,858)
    $var_3 = PixelGetColor(715,816)
    if not ($var_3 = 7891024) Then
        sleep(5000)
    Else
        _doCacota3()
    EndIf
EndFunc



Func _DoSomethingElse()
    sleep(500)
    MouseClick("left", 499, 397,1)
    Sleep(4500)
    $var = PixelGetColor(634,295)
    if $var = 8496036 Then
        sleep(500)
        MouseClick("left", 692,544,1)
        sleep(500)
        MouseClick("left", 881,690,1)
        sleep(500)
        MouseClick("left", 627,556,1)
        sleep(500)
        send("JJJ55165")
        sleep(500)
        MouseClick("left",633,581)
        sleep(1500)
        Send( "majosa")
    Else
        _DoSomethingElse()
    EndIf
EndFunc


Func _DoCacota4()
    MouseClick("left",512,861)
    sleep(2000)
    $4 = PixelGetColor(577,752)
    if not ($4 = 8153942) then
        MouseClick("left",493,543)
        sleep(500)
    Else
        _DoCacota4()
    EndIf
EndFunc


Func _DoCacota5()
    MouseClick("left",493,543)
    $5 = PixelGetColor(541,356)
    if not ($5 = 13998039) Then
        MouseClick("left",698,587)
        sleep(300)
    Else
        _DoCacota5()
    EndIf
EndFunc

Func _DoCacota6()
    MouseClick("left",294,801)
    sleep(200)
    $random=random(20,100000,1)
    $6 = PixelGetColor(181,189)
    if not ($6 = 1664157) Then
        send("JJJ")
        send($random)
    Else
        _DoCacota6()
    EndIf
EndFunc


Func _DoCacota7()
    MouseClick("left",743,674)
    sleep(100)
    $7 = PixelGetColor(857,368)
    if not ($7 = 14079697) Then
        MouseClick("left", 716,607)
        sleep(50)
    Else
        _DoCacota7()
    EndIf
EndFunc


Func _DoCacota8()
    MouseClick("left", 601,555)
    sleep(3000)
$8 = PixelGetColor(721,559)
if not ($8 = 5088456) Then
    MouseClick("left",642,572)
Else
    _DoCacota8()
EndIf
EndFunc

Func _DoCacota9()
    Send("{ESC}")
    MouseClick("left",892,572)
    $9 = PixelGetColor(701,537)
    if not ($9 = 9603926) Then
        MouseClick("left",646,559)
    Else
        _DoCacota9()
    EndIf
EndFunc

Func _DoCacota10()
sleep(500)
MouseClick("left",1117,899)
$10 = PixelGetColor(646,377)
if ($10 = 10463144) Then
    MouseClick(594,565)
Else
    _DoCacota10()
EndIf
EndFunc


Func _DoCacota11()
    MouseClick("left", 645,558)
if not ($9 = 14613247) Then
    sleep(1000)
Else
    _DoCacota11()
EndIf
EndFunc


Func _DoCacota12()
    MouseClick(594,565)
    $11 = PixelGetColor(598,566)
if not ($11 = 9828095) Then

Else
    _DoCacota12()
EndIf
EndFunc


    Func _DoCacota13()
        MouseClick(600,557)
        sleep(3000)
$12 = PixelGetColor(598,552)
if not ($12 = 13036538) Then

Else
    _DoCacota13()
EndIf
EndFunc


Func _Docacota14()
    MouseClick("left",533,389)
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    Send("{BS}")
    MouseClick("left",491,414)
Send("201294")
$12 = PixelGetColor(510,410)
if $12 = 0 Then
    MouseClick(490,462)
Else
    _DoCacota14()
EndIf
EndFunc


Func _DoCacota15()
    MouseClick("left",490,462)
    sleep(1000)
    $13 = PixelGetColor(554,357)
    if $13 = 4503510 Then
        _DoCacota15()
    EndIf
EndFunc


Func _DoCacota16()
    MouseClick("left",647,592)
    $14 = PixelGetColor(859,596)
    if not ($14 = 11657443) Then
        MouseClick("left",512,861)
    Else
        _DoCacota16()
    EndIf
EndFunc


Func _DoCacota17()
    MouseClick("left",642,572)
$15 = PixelGetColor(886,582)
if not ($15 = 8443108) Then
    MouseClick("left",629,858)
Else
    _DoCacota17()
EndIf
EndFunc


Func _DoCacota20()
    MouseClick("left",698,587)
    sleep(300)
    $18 = PixelGetColor(564,271)
if not ($18 = 16758273) Then
    MouseClick("left",294,801)
Else
    _DoCacota20()
EndIf
EndFunc

Func _DoCacota21()
    MouseClick("left", 743,674)
    $21 = PixelGetColor(720,561)
if ($21=4431555) Then
    MouseClick("left", 601,555)
Else
    _DoCacota21()
EndIf
EndFunc

Func _DoCacotaMaxima(); IN THIS FUNC. I PUT THE WHOLE SCRIPT AGAIN, AND THEN AT THE FINAL OF THE FUNC. ALSO I'LL PUT A _DoCacotaMaxima TO REPEAT IT INFINITELY

So, as you see, this script is just a repeat of commands and at the final the whole script repeats himself, infinitely times. What I want is to send the name which is on the line (1st, 2nd, 3rd....) that is equal to the numer of times that the whole script has been executed. :S Hope you've understood it, I rly need help, it's just the last step...

Link to comment
Share on other sites

If this program runs infinitely then you will need a separate script to call this script for every instance that you want to change the name. Unless you want 1000 instances of this program running simultaneously (which I doubt is possible) you will need to provide a mechanism for closing other instances of your script when a new one starts (look up _Singleton). An example of what I am proposing is to compile your script, replacing your line:

-------HERE I NEED TO SEND THE NAME-------
with
Send($CmdLine[1])
and calling the script from another script or command-line like: YourScript.exe "Charlie"

This is the most that I help that provide because I cannot really understand the logic behind a script that interacts and sends text to a window or windows but that program runs infinitely.

Link to comment
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
 Share

  • Recently Browsing   0 members

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