Jump to content

How to create script


Recommended Posts

Welcome to AutoIt and the forum!

When I click on your link I get an error message.

Can you please be a bit more specific what you try to achieve? What have you coded so far?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

sorry I am a beginner in programing

picture can see :http://flic.kr/ps/2wykPe

I want to follow this program, is there anything that can help open or view script this program: http://ge.tt/3Vizwoo/v/0 or http://www.sendspace.com/file/nzwzrp

I am wondering how to add the scipt on "GUICtrlCreateInput"

so far My scrip up here:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:documents and settingsmac osmy documentsdownloadsvideosoft autoittool erry.kxf
$Form1_1 = GUICreate("Form1", 438, 376, 258, 182)
$Group1 = GUICtrlCreateGroup("Group1", 256, 64, 225, 233)
$erry = GUICtrlCreateInput("erry", 344, 80, 121, 21)
$tes = GUICtrlCreateInput("tes", 344, 112, 121, 21)
GUICtrlCreateInput("", 344, 144, 121, 21)
GUICtrlCreateInput("", 344, 176, 121, 21)
GUICtrlCreateInput("", 344, 208, 81, 21)
$Label1 = GUICtrlCreateLabel("USER", 264, 80, 38, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("PASSWORD", 264, 112, 75, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("HOST ", 264, 144, 42, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("PORT", 264, 176, 38, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("PORT INJEK", 264, 208, 77, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("SIMPAN", 272, 256, 81, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button6 = GUICtrlCreateButton("Reconnect", 368, 256, 97, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic2 = GUICtrlCreatePic("C:Documents and Settingsmac osMy DocumentsMy PicturesR2.jpg", 56, 32, 409, 33)
$Button2 = GUICtrlCreateButton("XL", 56, 312, 65, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Button3 = GUICtrlCreateButton("TSEL", 136, 312, 65, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFF0000)
$Button4 = GUICtrlCreateButton("START", 264, 312, 65, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFBF0)
$Button5 = GUICtrlCreateButton("STOP", 368, 312, 73, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Label6 = GUICtrlCreateLabel("CREATED BY ISS CREW", 64, 352, 170, 20)
GUICtrlSetFont(-1, 10, 800, 2, "MS Serif")
$Label7 = GUICtrlCreateLabel("2013", 248, 352, 36, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
 

Link to comment
Share on other sites

Here is a simple example.  Run the code using SCiTE, input something, hit enter and watch the console area.

#include <GUIConstantsEx.au3>

local $gui010   =   guicreate('')
local $input    =   guictrlcreateinput('',20,20,100,20)
                    guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            Exit
        case $input
            ConsoleWrite('You inputed this >>>>  ' & guictrlread($input) & @LF)
    EndSwitch
WEnd

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

 

Here is a simple example.  Run the code using SCiTE, input something, hit enter and watch the console area.

#include <GUIConstantsEx.au3>

local $gui010   =   guicreate('')
local $input    =   guictrlcreateinput('',20,20,100,20)
                    guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            Exit
        case $input
            ConsoleWrite('You inputed this >>>>  ' & guictrlread($input) & @LF)
    EndSwitch
WEnd

 

How about this :

I made 2 forms, namely form 1 and form 2, my question is how to make a script that fills the data in form 1 then automatically fill in the form 2?

can give me example please?

scrpt form 1 :

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 351, 156, 192, 144)

$Input1 = GUICtrlCreateInput("Input1", 40, 32, 217, 21)

$Label1 = GUICtrlCreateLabel("DATA", 40, 8, 33, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

    $nMsg = GUIGetMsg()

    Switch $nMsg

        Case $GUI_EVENT_CLOSE

            Exit

    EndSwitch

WEnd

 

Script form2 :

 

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 351, 156, 192, 144)

$Input1 = GUICtrlCreateInput("Input1", 40, 32, 217, 21)

$Label1 = GUICtrlCreateLabel("HASIL", 40, 8, 35, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

    $nMsg = GUIGetMsg()

    Switch $nMsg

        Case $GUI_EVENT_CLOSE

            Exit

    EndSwitch

WEnd

 

Link to comment
Share on other sites

fickri1979,

You have several misconceptions regarding message loop processing and multiple gui management.  I suggest that you start simple, read the Help file, understand the code that I posted, define exactly what you want to do, and, finally, start coding.

Throwing up Koda generated gui's is doing you no good.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

fickri1979,

You have several misconceptions regarding message loop processing and multiple gui management.  I suggest that you start simple, read the Help file, understand the code that I posted, define exactly what you want to do, and, finally, start coding.

Throwing up Koda generated gui's is doing you no good.

kylomas

 

fickri1979,

You have several misconceptions regarding message loop processing and multiple gui management.  I suggest that you start simple, read the Help file, understand the code that I posted, define exactly what you want to do, and, finally, start coding.

Throwing up Koda generated gui's is doing you no good.

kylomas

I've tried but still confused, forgive me because I am beginner in programming

simply, I want to fill the data and run the ssh client program Bitvise from form 1..

1. I want to enter data in "form 1" then the data will automatically be filled in the form "Bitvise ssh client" ..http://postimg.org/image/3keagidm5/

2. if I click the "SAVE PROFILE" button on the form 1 then will automatically be "save profile" on button Bitvise ssh client. http://postimg.org/image/75a5zqi5p/

What should I do to use autoit?

and thank you for being willing to help me..

Link to comment
Share on other sites

fikri1979,

 forgive me because I am beginner in programming

 

Nothing to forgive, we all started somewhere... 

My understanding of what you want:

1 - you create an AutoIT app to gather some data

2 - you want to populate fields in an external app using this data 

3 - when the button control is actioned on your app you want to press a button on the external app

If this is true it is easy enough to do assuming the external app is using standard Windows controls.

Have patience and someone with experience automating apps will guide you through this.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

fikri1979,

 

Nothing to forgive, we all started somewhere... 

My understanding of what you want:

1 - you create an AutoIT app to gather some data

2 - you want to populate fields in an external app using this data 

3 - when the button control is actioned on your app you want to press a button on the external app

If this is true it is easy enough to do assuming the external app is using standard Windows controls.

Have patience and someone with experience automating apps will guide you through this.

kylomas

 

I have tried like the following topic /?do=embed#entry1107729'' frameborder='0' data-embedContent>>,

but get a message like this,

C:Program FilesISS v2ISS v2.au3(61,31) : WARNING: $Host: possibly used before declaration.

how do I fix it?

post-81604-0-59797000-1376785857_thumb.j

Link to comment
Share on other sites

i'v got error...

$Form1_1 = GUICreate("SSID Connect v1.0 BETA", 428, 390, 197, 123)
GUISetBkColor(0x3399FF)
$Group1 = GUICtrlCreateGroup("Setting", 16, 24, 265, 201)
$Host = GUICtrlCreateInput("", 112, 56, 153, 21)
$Username = GUICtrlCreateInput("", 112, 96, 153, 21)
$Pass = GUICtrlCreateInput("", 112, 136, 153, 21)
$Port = GUICtrlCreateInput("", 112, 176, 89, 21)
$Label1 = GUICtrlCreateLabel("Host", 32, 56, 26, 17)
$Label2 = GUICtrlCreateLabel("User", 32, 96, 26, 17)
$Label3 = GUICtrlCreateLabel("Password", 32, 136, 50, 17)
$Label4 = GUICtrlCreateLabel("Port", 32, 176, 23, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Login", 32, 240, 89, 25)
$Button2 = GUICtrlCreateButton("Disconnect", 152, 240, 89, 25)
$Button3 = GUICtrlCreateButton("PROXIFIER", 32, 280, 209, 25)
$Button4 = GUICtrlCreateButton("Exit", 32, 312, 97, 25)
$Group2 = GUICtrlCreateGroup("Inject", 296, 24, 121, 201)
$Button5 = GUICtrlCreateButton("XL", 312, 48, 89, 25)
$Button6 = GUICtrlCreateButton("INDOSAT", 312, 88, 89, 25)
$Button7 = GUICtrlCreateButton("TELKOMSEL", 312, 128, 89, 25)
$Button8 = GUICtrlCreateButton("SMART", 312, 168, 89, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    If $msg=-3 Then Exit     ;untuk menutup aplikasi secara manual
    If $msg=$Button1 Then Button1()
WEnd

Func Button1()
    $readhost = GUICtrlRead($Host)
    $readport = GUICtrlRead($Port)
    $readusername = GUICtrlRead($Username)
    $readpass = GUICtrlRead($Pass)
    $PAR1 = "-profile=ssh.bscp" & "-host=" & $readhost & "-port=443" & "-proxy=y" & "-proxyType=HTTP" & "-proxyServer=127.0.0.1" & "-proxyPort=" & $readport & "-username=" & $readusername & "-password=" & $readpass & "-loginOnStartup" Run(@ProgramFilesDir & "\ISS v2\Tunnel.exe" & $PAR1 , @ProgramFilesDir , @SW_HIDE)
EndFunc

how to fix it?

post-81604-0-65087700-1376834316_thumb.j

Link to comment
Share on other sites

Run(@ProgramFilesDir & "ISS v2Tunnel.exe" & $PAR1 , @ProgramFilesDir , @SW_HIDE) <- put on new line

 

thank you for your guidance....

but now, when i clik button1 Tunnel.exe can't run...

am I wrong directory? post-81604-0-06934500-1376840654_thumb.j

or is there any other cause?

Edited by fikri1979
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...