Jump to content

What's Wrong With My **** script :)


Recommended Posts

here is the source code

#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#Include <Misc.au3>
#Include <Constants.au3>

$Main = GUICreate("Easy Write", 350, 200)
GUISetState(true)
$Input = GUICtrlCreateInput("", 5, 33, 300)
$Input2 = GUICtrlCreateInput("Input Client Name", 5, 65, 300)
$Input3 = GUICtrlCreateInput("Delay", 280, 140, 55)
$But1 = GUICtrlCreateButton("Start", 110, 160, 80)
$CH1 = GUICtrlCreateCheckbox("Check The Box If U Want To Continue Sending", 5, 140)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $But1 Then Start()
    If $MSG = $GUI_EVENT_CLOSE Then Exit
    If $Msg = $CH1 Then Continue()
    WEnd
    
Func Start()
    Local $read = GUICtrlRead($Input)
    Local $read2 = GUICtrlRead($Input2)
    WinActivate($read2)
    Send($read)
    Send("{Enter}")
EndFunc

Func Continue()
    While 1
    If $msg = $But1 And $CH1 And BitAND(GUICtrlRead($CH1), $GUI_CHECKED) = $GUI_CHECKED Then
    Local $Delay, $read, $read2
    $Delay = GUICtrlRead($Input3)
    $read = GUICtrlRead($Input)
    $read2 = GUICtrlRead($Input2)
    WinActivate($read2)
    Send($read)
    Send("{Enter}")
            Sleep($Delay)
        Else
            Local $read, $read2
            $read = GUICtrlRead($Input)
    $read2 = GUICtrlRead($Input2)
    WinActivate($read2)
    Send($read)
    Send("{Enter}")
        EndIf
    WEnd
    EndFunc

dunno i just wanna make it if the checkbox is checked to add the delay function aswell and if not checked just to write it 1 time can someone help ? lolz :)

Edited by Cha0sBG

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

In your continue function you have 2 while 1 statements, but only one wend, and 2 IF statements, but only 1 endif.

if I take out the Else and second While 1 and replace with an EndIf that seems to make sense, at least SciTE doesn't give me errors.

Edited by Kerros

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

ye i saw that i modded it sec i post new code

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

ok i only need 1 thing now when i check the checkbox it dousnt wait antill i press start and then to start spamming etc ... directrly starts

why is that ?

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

thats because of your if statements in the beginning, it says that if $msg = $ch1 then run function Continue(). I would suggest putting those two functions together, something like this:

#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#Include <Misc.au3>
#Include <Constants.au3>

$Main = GUICreate("Easy Write", 350, 200)
GUISetState(true)
$Input = GUICtrlCreateInput("", 5, 33, 300)
$Input2 = GUICtrlCreateInput("Input Client Name", 5, 65, 300)
$Input3 = GUICtrlCreateInput("Delay", 280, 140, 55)
$But1 = GUICtrlCreateButton("Start", 110, 160, 80)
$CH1 = GUICtrlCreateCheckbox("Check The Box If U Want To Continue Sending", 5, 140)
    Local $Delay, $read, $read2
While 1
    $msg = GUIGetMsg()
    Select
        case $msg = $But1
        Continue()
    Case $MSG = $GUI_EVENT_CLOSE 
        Exit
    Case Else
        Sleep(100)
    EndSelect
    WEnd
    

Func Continue()
    $read = GUICtrlRead($Input)
    $read2 = GUICtrlRead($Input2)
    While 1
    If GUICtrlRead($CH1, $GUI_CHECKED) Then
    $Delay = GUICtrlRead($Input3)
    WinActivate($read2)
    Send($read)
    Send("{Enter}")
            Sleep($Delay)
    Else
    WinActivate($read2)
    Send($read)
    Send("{Enter}")
        EndIf
    WEnd

    EndFunc

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

you forgot local >.< nvm i will see

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

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...