Jump to content

no idea where to start - absolute beginner


noID
 Share

Recommended Posts

Hi :-)

I'm a real noob and I even don't have any idea how to make a script using Autoit at all, reading the help files makes my mind turning around, I don't understand anything. :-(

25 years ago I did some programming with Commodore64-Basic, but nowadays I'm totally lost...

I'd really be very thankful if someone could give me hints how to start creating an exe-file for an automated login.

What the Autoit-exe should do:

1. -> Run the Program "C:\LOGIN.EXE"

When LOGIN.EXE starts a login-window appears in the middle of the screen

2. -> Automatically fill in the password (user name always is the same and filled in already)

Now it will last about 2 seconds until the online-login is done, after that a new window appears in the middle of the screen with the message "Enter number (D3) (C9) (A2) from the Securecard" and the input line below.

3. -> These three numbers (of course always changing) should be filled into the right field and the button "submit" should be clicked.

My simple idea is reading/capturing the three shown codes in the brackets, getting the analogical values from a .txt-file (e.g. A1:T or A1=T etc.) and placing them into the input line.

But I don't even know how to start the script at all.

Please excuse my bad English. ;-)

Thanks!

Link to comment
Share on other sites

Your best bet is to read the forum rules first before you continue your time on AutoIt.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • Moderators

noID,

a new window appears in the middle of the screen with the message "Enter number (D3) (C9) (A2) from the Securecard" and the input line below.

3. -> These three numbers (of course always changing) should be filled into the right field

We do not help break login security measures. This sounds very much as though you are trying to do just that. :)

You have 24hrs to explain why I should not lock this thread.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

sirfearless,

Replying to thread that a Mod has said he is thinking of locking is not a good idea - particularly if you go on to say:

Im trying to make bots

Use your brain a bit next time please. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Your best bet is to read the forum rules first before you continue your time on AutoIt.

Ups - You ment this point?

Scripts or programs that violate the license agreement for software. If a program explicitly says no automation, do not discuss automation of that software here.

Sorry, I didn't read the rules, shame on me!

Read the helpfile for Run, WinWaitActive, FileRead, and Send. You'll also need a While...WEnd or Do...Until loop or something like that. Now try it on you own and come back if you have specific questions.

I'll do that, thank you!

noID,

We do not help break login security measures. This sounds very much as though you are trying to do just that. :)

You have 24hrs to explain why I should not lock this thread.

M23

All right, I will try:

As a field service technician I get my new orders when I'm "on tour". So I'll have to power on the notebook, log into the first application, start the mobile phone bluetooth connection, after that the extranet-Dialup has to be started and the password and the gridcard-values have to be typed in. After that the main program has to be started, again with password.

This is very dangerous if you have to do that all by driving because I simply don't have the time for parking the car to do that all, maybe ten times a day. Sad but true, but my boss would say goodbye to me.

If I had a script at least to automate the extranet-login (long password) and the gridcard-thing I would be a more nonhazardous road user. ;-)

The first information about the new orders (customer's address, machine type) are sent by mobile phone SMS/E-Mail, but the details are sent by SAP so I must log in.

Each time I visit a customer I have to power down the notebook (or standby) which is making the BT and SAP connection loose.

So I would say: I only try to make that whole procedure a lot more easier and I could concentrate on traffic much better...

By the way it would be a great easement for me, too.

And I wouldn't see any fault in it: it's my laptop, my account, my gridcard and my password.

Without the initial password for the first step nobody could use the script to log into the extranet, furthermore the main application also is password protected.

Link to comment
Share on other sites

  • Moderators

noID,

Given that explanation I am happy for this to thread to continue - if only to reduce the chances of you killing someone else on the road! :)

First thing to do is make sure you can read the "Enter number (D3) (C9) (A2) from the Securecard" message. Then whether you can enter the 3 responses using AutoIt. Many login screens are difficult to automate - for obvious reasons. Use the Window Info tool ("C:Program FilesAutoIt3Au3Info.exe" if you did a standard install) to see if the text is visible and how to identify the input area. Once you are sure you can do that you can start working on the rest of the code. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

noID,

I have an auto-login script for SAP, can let you have it tomorrow. Some of it should be useful. What is "gridcard", "always changing"? For some remote access to customer systems customer has given us lcd RAVI key, number changes every minute. To automate that would have to be webcam + ocr - hard.

Richard.

Link to comment
Share on other sites

noID,

This is the code I use for logging into SAP and opening the timesheet. You requirements are different but you should be able to lift some useful pieces out of this.

Richard.

#cs
SAP_Auto_Login.au3
This starts sap and logs on, opens the timesheet for edit.
It assumes that the SAP login window will remember the username from previously.
On the first run it asks for the password, and uses the same password on subsequent runs.
If necessary start it with the "shift" key pressed to force it to ask for the password.
#ce
#include
#include
Const $WinWaitTmo = 30
Global $sMyName
Func MsgFail($sArg1, $sArg2)
  Beep(256, 100)
  MsgBox(0, $sMyName, $sArg1 & @CRLF & $sArg2, 10)
EndFunc

If _Singleton(@ScriptName, 1) = 0 Then
  MsgFail(@ScriptName, "Already running")
  Exit
EndIf

Dim $sEnKey, $sPwd, $sEnPwd
Dim $progname, $progtitle
Dim $workdir
Dim $sRKeyNam
Dim $sMsg

$sMyName  = StringRegExpReplace(@ScriptName, "....", "")
$sRKeyNam = "HKCUSoftwareRXY" & $sMyName & "Settings"
$sEnKey   = "Secret Phrase"
$sEnPwd   = RegRead($sRKeyNam, "Name1")
$sMsg    = StringFormat("~%s~n ~%s~n ~%s~n", $sRKeyNam, "Name1", $sEnPwd)
;ConsoleWrite(StringFormat("Pwd1 ~%s~n~%s~n", $sPwd, $sEnPwd))
MsgBox(0, 0, $sMsg)
If @Compiled = 0 Then
  Sleep(2000) ; to allow shift to be pressed
EndIf

If $sEnPwd = "" or _IsPressed(10) Then ; 10 = Shift
  ; Have to ask for the pwd
  $sPwd = InputBox("SAP_Timesheet", "SAP Password ?", "", "*" , 100, 70)
  If $sPwd = "" Then
    Exit
  EndIf
  $sEnPwd = _StringEncrypt(1, $sPwd, $sEnKey , 1)
  ;ConsoleWrite(StringFormat("Pwd2 ~%s~n~%s~n", $sPwd, $sEnPwd))
  RegWrite($sRKeyNam, "Name1", "REG_SZ", $sEnPwd)
Else
  $sPwd = _StringEncrypt(0, $sEnPwd, $sEnKey , 1)
  ;ConsoleWrite(StringFormat("Pwd3 ~%s~n~%s~n", $sPwd, $sEnPwd))
EndIf

$progname  = "C:Program FilesSAPSapSetupsetupSALSapLogon.s8l"
$workdir   = "C:Program FilesSAPSAPsetupsetupSAL"
If 0 Then
  $progname  = "C:Program Files (x86)SAPSapSetupsetupSALSapLogon.s8l"
  $workdir   = "C:Program FilesSAPSAPsetupsetupSAL"
EndIf

$progtitle = "SAP Logon 710"
; Start SAP Login
ShellExecute($progname, "", $workdir)
If WinWaitActive($progtitle, "", $WinWaitTmo) Then
Else
  MsgFail("Failed to find:", $progtitle)
  Exit
EndIf
Sleep(300)
; We have two tabs; Systems, Shortcuts.  Can read the index of which tab we are on
; and tab (right or) left as required
$stmp = ControlCommand($progtitle, "", "[CLASS:SysTabControl32; INSTANCE:1]", "CurrentTab", "")
If $stmp = 2 Then
  ControlCommand($progtitle, "", "[CLASS:SysTabControl32; INSTANCE:1]", "TabLeft", "")
Else
EndIf
Send("!l")
Sleep(300)
Send($sPwd)
Sleep(100)
Send("{Enter}")

$progtitle = "SAP Easy Access"
If WinWaitActive($progtitle, "", $WinWaitTmo) Then
Else
  MsgFail("Failed to find:", $progtitle)
Exit
EndIf
Sleep(300)
Send("ABC")
Sleep(100)
Send("{Enter}")
$progtitle = "Time Sheet: Initial Screen"
If WinWaitActive($progtitle, "", $WinWaitTmo) Then
Else
  MsgFail("Failed to find:", $progtitle)
Exit
EndIf
Sleep(500)
Send("XYZ")
Sleep(50)
Send("{Enter}")
Send("!e") ; Edit
Sleep(100)
Send("e")  ; Enter Times
Sleep(800)
$progtitle = "Time Sheet: Data Entry View"
If WinWaitActive($progtitle, "", $WinWaitTmo) Then
Else
  MsgFail("Failed to find:", $progtitle)
Exit
EndIf
Sleep(200)
Send("! x") ; Maximise
Exit

(I don't know where the indenting has gone, it was nicely indented before I pasted it in.... Edited)

Edited by RichardL
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...
Two years have passed and since now I didn't have had the time to learn about "Autoit". :-(
I'd be really happy if anybody would have the time to "transcript" this code for Autoit.
Thanks a million!
 
 
START PROGRAM ABC
C:Program filesabc.exe
WAIT FOR 5 SECONDS;
 
INSERT PASSWORD
"abc"
ENTER
 
NEW WINDOW APPEARS:
"Enter [A2] [C4] [J3] from your Grid Card ..."
 
READ THE 3 VALUES INSIDE THE BRACKETS;
 
GET + INSERT THOSE 3 VALUES FROM EXTERNAL TXT-FILE "C:GRID.TXT"
e.g. "W9C" (without spaces, not case sensitive)
ENTER
 
WAIT FOR 5 SECONDS;
ENTER
 
START PROGRAM 123
C:Program Files123.exe
WAIT FOR 5 SECONDS;
 
INSERT PASSWORD
"123"
ENTER
Link to comment
Share on other sites

Run()

Sleep()

Send()

wait!

NEW WINDOW APPEARS:

"Enter [A2] [C4] [J3] from your Grid Card ..."

Seriously? You're still trying to circumvent the same website security measures.

best of luck.

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

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Sorry, but I don't understand your worry - I have a unique (personalized) Gridcard in combination with a unique (personalized) password.

Each imaginary thiev of the laptop would find neither the script nor the gridcard nor the password - these things would be securely saved on a sd-card, not permanently being plugged in the lappy - just like a dongle.

Link to comment
Share on other sites

  • Moderators

 

Two years have passed and since now I didn't have had the time to learn about "Autoit". :-(
I'd be really happy if anybody would have the time to "transcript" this code for Autoit.
 

 

noID, understand that this forum is dedicated to helping people improve their scripts and scripting ability. It is not a forum where you put in a request and we barf up code for you. Looking back through the thread, you were given a lot of suggestions, which you yourself admit to having done nothing with in the last two years. If you are not interested in learning the language, I would suggest trying a website like

http://www.freelancer.com/

"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!

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