Reptos

Input Box ( Loop Number ) ?

14 posts in this topic

Hello! I'm kinda new to autoit so i'd like to know how to do something. I have a bot that i want to have a input box to choose the amount of numbers the script loops. After the total amount of loop's have been done i want it to do another script once and then loop back to the first script? How is this done?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I have removed your duplicate thread. 
Seems you have already tried something so what about you share what you have that isn't working yet?

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I have removed your duplicate thread. 
Seems you have already tried something so what about you share what you have that isn't working yet?

Jos

This is my first thread? I just signed up lol.

Share this post


Link to post
Share on other sites
While 3
    $iLoops = Number(InputBox("", ""))
    For $i = 1 To $iLoops
        _DoSomething_1($i)
    Next
    _DoSomething_2()
WEnd

Func _DoSomething_1($i)
    ConsoleWrite("-Doing something 1 " & $i & @LF)
EndFunc

Func _DoSomething_2()
    ConsoleWrite("+Doing something 2" & @LF)
EndFunc

 


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Local $input,$num

While 1
    $num+=1
    $input=InputBox("Enter Somethink","You Enter: "&$input,"","",-1,130)
    If @error=1 Then ExitLoop
    ConsoleWrite($input&@CRLF)
    If $input="xxx" Or $num>5 Then 
        OtherScript()
        $num=0
    EndIf
WEnd
    
Func OtherScript()
    MsgBox(48,"Other Script","Some think!")
EndFunc

 


Regards,
 

Share this post


Link to post
Share on other sites
Local $input,$num

While 1
    $num+=1
    $input=InputBox("Enter Somethink","You Enter: "&$input,"","",-1,130)
    If @error=1 Then ExitLoop
    ConsoleWrite($input&@CRLF)
    If $input="xxx" Or $num>5 Then 
        OtherScript()
        $num=0
    EndIf
WEnd
    
Func OtherScript()
    MsgBox(48,"Other Script","Some think!")
EndFunc

 

Thanks! It worked but could you show me how to do something via skype? My skype is ChipinOw

Share this post


Link to post
Share on other sites

This is my first thread? I just signed up lol.

So you mean to say you haven't tried anything yet nor researched what information is already available and thought I start fishing right away?
Well you have 2 who did bite. :)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

So you mean to say you haven't tried anything yet nor researched what information is already available and thought I start fishing right away?
Well you have 2 who did bite. :)

Jos

Ahh, I get what you're saying. I did do research on the topic but i couldn't find out how to do it how i wanted it so i thought i'd come here.

Share this post


Link to post
Share on other sites

Thanks! It worked but could you show me how to do something via skype? My skype is ChipinOw

I was a goof (it is how people describe me)
english is not my primary language.
I'm not good AutoIt and english too.
And this forums is support to use AutoIt, not where the request to write programs
I finally do not use skype.
Sorry.


Regards,
 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Hello! I'm in need of help. I'm trying to figure out how to make someone choose the amount of times a script loops instead of just being on infinite loop with While 1? After it looped the chosen amount of times i want it to run another function and then loop back to the 1st function.

Func $stay
   MouseClick("Left",304,203)
   EndFunc
If $Input1 = +1> Then
   $Stay

Func $Input1

      while 1 = +1 loop = $Stay

Also How would i go about them putting their username into a textbox and then it typing it into the position where i have the send command? 

Edited by Reptos

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Why did you open a new topic in stead of sticking to the previous one?
Weren't the answers what you were expecting?

Merged and let's not do this again.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Why did you open a new topic in stead of sticking to the previous one?
Weren't the answers what you were expecting?

Merged and let's not do this again.

Jos

No one is going to come back here... So i just opened a new one

Share this post


Link to post
Share on other sites

Hello! I'm in need of help. I'm trying to figure out how to make someone choose the amount of times a script loops instead of just being on infinite loop with While 1? After it looped the chosen amount of times i want it to run another function and then loop back to the 1st function.

Func $stay
   MouseClick("Left",304,203)
   EndFunc
If $Input1 = +1> Then
   $Stay

Func $Input1

      while 1 = +1 loop = $Stay

Also How would i go about them putting their username into a textbox and then it typing it into the position where i have the send command? 

You may need:

#NoTrayIcon
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_CHECKED = 1
Global Const $GUI_UNCHECKED = 4

Global $hGUI = GUICreate("Mouse Click", 360, 76, -1, -1)
GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -77, 0, 0, 72, 72)
GUICtrlCreateLabel("Mouse:", 80, 0, 39, 17)
GUICtrlCreateLabel("X:", 104, 24, 14, 17)
Global $iX = GUICtrlCreateInput("123", 136, 24, 33, 21)
GUICtrlCreateLabel("Y:", 200, 24, 14, 17)
Global $iY = GUICtrlCreateInput("456", 216, 24, 41, 21)
GUICtrlCreateLabel("Clicks:", 184, 56, 30, 17)
Global $iC = GUICtrlCreateInput("5", 216, 48, 41, 21)
GUICtrlCreateLabel("Speed:", 88, 56, 34, 17)
Global $iS = GUICtrlCreateInput("10", 136, 48, 33, 21)
Global $bLeft = GUICtrlCreateRadio("Left", 136, 0, 41, 17)
GUICtrlSetState($bLeft, $GUI_CHECKED)
Global $bRight = GUICtrlCreateRadio("Right", 208, 0, 49, 17)
Global $bClickNow = GUICtrlCreateButton("Click Now", 272, 0, 81, 73)
GUISetState(@SW_SHOW)
HotKeySet("{ESC}", "_Exit") ;If you press ESC the script will stop
Global $nMsg, $x, $y, $Speed, $Button, $ClickTime

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            _Exit()
        Case $bClickNow
            Clicks()
    EndSwitch
WEnd

Func Clicks()
    $x = GUICtrlRead($iX, 0)
    $y = GUICtrlRead($iY, 0)
    $ClickTime = GUICtrlRead($iC, 0)
    $Speed = GUICtrlRead($iS, 0)
    If GUICtrlRead($bLeft, 0) = $GUI_CHECKED Then $Button = "left"
    If GUICtrlRead($bLeft, 0) = $GUI_CHECKED Then $Button = "right"
    ;MouseClick ( $Button, $x, $y , $ClickTime , $Speed)
    If $ClickTime > 1 Then
        While $ClickTime
            $ClickTime -= 1
            MouseClick($Button, $x, $y, 1, $Speed)
        WEnd
    Else
        MouseClick($Button, $x, $y, 1, $Speed)
    EndIf
EndFunc   ;==>Clicks

Func _Exit()
    Local $ask=MsgBox(36,"Mouse Click","Are you sure want to exit?",Default,$hGUI)
    If $ask=6 Then Exit
EndFunc   ;==>_Exit

 

Or:

 

While True <> False
    Local $input = Input1()
    If $input > 0 Then Click($input)
WEnd

Func Input1()
    Local $input = InputBox("Mouse Click", "Loop: ", "", "", -1, 130)
    If @error = 1 Then Exit
    Return $input
EndFunc   ;==>Input1

Func Click($input)
    While $input
        $input -= 1
        MouseClick("Left", 304, 203)
        If $input < 1 Then ExitLoop
    WEnd
EndFunc   ;==>Click

 


Regards,
 

Share this post


Link to post
Share on other sites

No one is going to come back here... So i just opened a new one

Don't think that is the case when you show progress keep posting here.

Either way: Just stick to one topic.

Jos 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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