Jump to content

Recommended Posts

Posted

Hi, i wrote this script (yeah, I know I make so much mistakes, cause I'm a beginner):
 

HotKeySet("{F1}" , "start")
HotKeySet("{END}" , "koniec")
WinActivate("")

$tytul = ""
$lapka = WinGetHandle($tytul)

While 1
Sleep(100)
WEnd
Func koniec()
   Exit
EndFunc
Func start()
        MouseClick("",902, 312)
        Sleep(100)
        Send("^a")
        Sleep(100)
        Send("{BACKSPACE}")
        Sleep(100)
        Send(500000)
        Sleep(100)
        Send("{ENTER}")
        Sleep(6000)
    While 1
$pixel = PixelSearch( 581, 177, 591, 191, 0xFF0000)

If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(1000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(2000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send("4000000")
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(8000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(16000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(32000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(64000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(128000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
    EndIf
    If @error then
    ExitLoop
EndIf
    If Not @error Then
    MouseClick("",902, 312)
    Sleep(100)
    Send("^a")
    Sleep(100)
    Send("{BACKSPACE}")
    Sleep(100)
    Send(256000000)
    Sleep(100)
    Send("{ENTER}")
    Sleep(5000)
EndIf
WEnd
EndFunc

I work with him from midnight :/ 
I want to, this program'll functioning with this parameters(I think about Func start):
Paste a value five hundred thousend(I can;t enter a normal numbers) and if error doesn't exist this program multiplies value two times, to the maximum(256 million's)500(i can't enter  and if error exist back to beginning of the function and repeat. In the ned of the script if error doesn't exist(after value two hundred fifty six million's ) it back to the beginning and repeat. Program'll still working before i press END

Can You help me? How can I do that? 
I thankful for the answers ;)

  • Developers
Posted

Not sure what the question really is here, but it's for me pretty unclear what you are trying to automate with this script.
So what about explaining what it is you are trying to do first?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

initially value=500 000

1. Script in Func start click at

MouseClick("",902, 312)

selecting all, send backspace to erase everything is checked and send a value 500 000 

2. Script searching a pixel,

$pixel = PixelSearch( 581, 177, 591, 191, 0xFF0000)

and if script found this pixel then doubles a value and do the same as in point 1. but with doubled value <== repeat until value >256 000 000, if this think happened, script do the same as in the case not finding pixel(explained below) 

but if script not found this pixel then scripts returns to the top of Func start and work with initially value
 

My skills in English language is not big, sorry for that :/


 

 

 

 

Posted

Oh, You have right Jos. I want to automatic some games I writing this for earning a experienced in AutoIT, but it still breaking the rules. Then I have one option now, learning more about AutoIT to do it by myself. 
 

In that case I'm sorry for thetrouble to answering me, but thanks, somegow it's motivate me to learn more aout that script laguage

  • Moderators
Posted

@Chonilo as you have come to realize, we do not support game automation on this forum. Please read through our forum rules before you post again. Hope to see you again with a legitimate question.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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