Jump to content

Recommended Posts

So im creating a bot that logs in on a website. The website got a dropdown menu, and I have to choose the right one to login (Student)

#include <IE.au3>
#inculude <Inet.au3>

$oIE = _IECreate("<snip>")

$Name = _IEGetObjByName($oIE, "ssusername")
$Pass = _IEGetObjByName($oIE, "sspassword")
$dropdown = _IEGetObjByName($oIE, "usertype")

_IEPropertySet($Name, 'innerText', 'censored')
_IEPropertySet($Pass, 'innerText', 'censored')
_IEPropertySet($dropdown, 'innerText', 'Student') <------ How do I make the dropdown list select "Student"?

 

 

Edited by Melba23
Link removed
Link to post
Share on other sites
59 minutes ago, ssah8 said:

_IEPropertySet($Name, 'innerText', 'censored')

_IEPropertySet($Pass, 'innerText', 'censored')

Does this even work? Normally you would want to us _IEFormElementSetValue.

Quote

The website got a dropdown menu, and I have to choose the right one to login (Student)

Take a look at _IEFormElementOptionSelect.

Link to post
Share on other sites
1 hour ago, ssah8 said:

It didn't work. Im new to AutoIT. Can you please write an example?

"Didn't work" isn't sufficient feedback. Next time, post the results from the Scite output window.

1 hour ago, ssah8 said:

_IEFormElementOptionSelect($dropdown, 'innerText', 'Student')

That didn't work either.

Here's a working example using the proper _IE functions --

#include <IE.au3>

$oIE = _IECreate("https://sms14.schoolsoft.se/engelska/jsp/Login.jsp?eventMessage=ERR_Not_Logged_In")

$oForm = _IEFormGetObjByName($oIE, 'userForm')
$Name = _IEFormElementGetObjByName($oForm, "ssusername")
$Pass = _IEFormElementGetObjByName($oForm, "sspassword")
$dropdown = _IEFormElementGetObjByName($oForm, "usertype")

_IEFormElementSetValue($name, 'censored')
_IEFormElementSetValue($Pass, 'censored')
_IEFormElementOptionSelect($dropdown, 'Student', 1, 'byText')
_IEFormSubmit($oForm)

 

Link to post
Share on other sites

There are plenty of loop examples on the forum and in your help file.

I'm still not getting the big picture.  There shouldn't be any need to have to login hundreds of times.  Why not login once an pull all the data you need while in the single session?

Link to post
Share on other sites
  • Developers
1 hour ago, ssah8 said:

 

I want it all to be repeated over and over again. I have now copy and pasted everything like 100 times, it works, but not as efficient.

 

Please explain clearly why this is needed at all before asking any other question.

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

Link to post
Share on other sites
10 hours ago, Jos said:

Please explain clearly why this is needed at all before asking any other question.

Jos

Well, on my profile page on the website,there is a login count. I want to boost that login count to a higher number. Anything more I have to explain?

Link to post
Share on other sites

Exactly which one website - do you mean AutoIt Forum ?

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 for other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-03-02

Link to post
Share on other sites

@mLipok He wants to boost his login count on his school's website.   Is that accurate @ssah8 ?  

You wouldn't by chance be required to login so many times a week/period and/or get perks the higher your login count is...do you?  Artificially raising the login count still doesn't seem right to me.  There's got to be a reward for you doing so, otherwise you'd use some other web server.

Link to post
Share on other sites
28 minutes ago, spudw2k said:

@mLipok He wants to boost his login count on his school's website.   Is that accurate @ssah8 ?  

You wouldn't by chance be required to login so many times a week/period and/or get perks the higher your login count is...do you?  Artificially raising the login count still doesn't seem right to me.  There's got to be a reward for you doing so, otherwise you'd use some other web server.

It's just a fun thing to do, and why do you care? I get to do whatever I want to, I just needed help with that.

 

Link to post
Share on other sites
  • Developers
10 hours ago, ssah8 said:

Well, on my profile page on the website,there is a login count. I want to boost that login count to a higher number. Anything more I have to explain?

.. and why is that important? Doesn't sound as a very "smart" thing to do as it is likely logged. 

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

Link to post
Share on other sites

Hello.

I was wondering how I could make a status info box in autoit. I can explain it in a sentence.

Let's say there is a number on a website (1). After some minutes, that number updates to another number (5). How do an status box that updates that number aswell in autoit? I am thinking of a GUI.

 

Thanks

Link to post
Share on other sites
  • Jos locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mmoalem
      Hi all - I have created a simple script that turn on cctv software (contacam)  when my phone does not ping back (when I'm out of range of home network)
      #include <MsgBoxConstants.au3> $iPing = 0 For $i = 5 To 1 Step -1 ; this 5 loops cycle is just for testing - please ignnore - when complete it will be an endless loop Example() Sleep(120000) Next Func Example() ; Ping the phone. $iPing = Ping("192.168.1.102") If $iPing Then ; If a value greater than 0 was returned then turn off camera. _endCCTV() Else _startCCTV() ; If a value of 0 was returned then turn on camera. EndIf EndFunc ;==>Example Func _startCCTV() ShellExecute("C:\contacam capture\FJ Camera\CAMERA.bat", "on") Sleep(10000) ShellExecute("C:\contacam capture\FJ Camera\CAMERA_REC_SENSITIVITY.bat", "50") EndFunc Func _endCCTV() ShellExecute("C:\contacam capture\FJ Camera\CAMERA_REC_SENSITIVITY.bat", "0") Sleep(10000) ShellExecute("C:\contacam capture\FJ Camera\CAMERA.bat", "off") EndFunc  
       
      the problem I have is that in this format the script run the bat file that turn on the camera (or off) everytime the ping runs but obviously once the ping returns 0 and the camera starts I only want to run the bat on ping NOT 0 (turn off camera) 
      any ideas/advice?
    • By Vikramjeet
      include-once #include <File.au3> #include <Excel.au3> #include <String.au3> #include <MsgBoxConstants.au3> Local $file = "TEST.log" FileOpen($file, 0) $TTLPax = 1 For $i = _FileCountLines($file) - $TTLPax to _FileCountLines($file) $line = FileReadLine($file, $i) Global $TktNo = StringMid($line, 8, 13) ; reads 13 characters from $Line starting from the 8th character msgbox(0,'',$TktNo) ; This is just for me to debug For $NoOfPax = 1 to 2 local $TTLSeg = 2 msgbox(0,'',$TTLSeg) msgbox(0,'',"7ABC"& $TktNo &"'N"& $NoOfPax &".1'C1,2'S1,2'B") ; This makes 7ABC1234567890123'N1.1'C1,2'S1,2'B ;But in the next loop I want the value to be 7ABC1234567890333'N2.1'C1,2'S1,2'B Next ExitLoop Next *TEST
      JAMES BAKER
        1.NYC-23JAN
        2.TJ 1234567890123
        3.TJ 1234567890333
      I am reading a file with last 5 lines as above. I want to be able to loop through and pick the values as follows
      1- Pick 1234567890123
      2- Use it to build a format with N1.1
      3- Pick 1234567890333
      2- Use it to build a format with N2.1
      Need help with the loop. Thank You
       
       
    • By Vikramjeet
      For $A1 = 12 To 11 + $Total For $B1 = 1 To ($oExcel.Application.Cells($A1,6).Value) ; This value is from the Excel file. It can be from 1 - 9. For $N1 = 7 To ??? ; This is based on the value of $B1 ((1 = 7, 2 = 17, 3 = 27, 4 = 37, 5 = 47) Send("-"& ($oExcel.Application.Cells($A1,$N1).Value) &"/"& ($oExcel.Application.Cells($A1,$N1+1).Value)) Sleep(400) Send("{ENTER}") Sleep(700) Next Next Next I am not able to figure how to loop $N1 as follows
      If the Value of $B1 = 1 then $N1 = 7
      If the Value of $B1 = 2 then $N1 = 17
      If the Value of $B1 = 3 then $N1 = 27
      If the Value of $B1 = 4 then $N1 = 37  
      The value of $N1 comes from $B1 where 1 = 7, 2 = 17, 3 = 27, 4 = 37, 5 = 47)
      Thank You
    • By ThePoro
      Hi everyone.
      I want to ask about this : 
      I want it runs from 1 to 100 and It opens 10 firefox profiles then access youtube. After I close a firefox window, the loop runs and wait for another window close until loop ends
      I have a loop like this.
      Func launch() Local $from = Int(GUICtrlRead($input1)) Local $to = Int(GUICtrlRead($input2)) If $to <> "" Then While $from <= $to Local $profile = $to _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com") $to=$to+1 WEnd Else Local $profile = $to _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com") EndIf EndFunc Is there any solution?
      Thank you!
    • By Rhidlor
      First off, the project I'm working on revolves around AS/400 "Client Access software", it's foundation is directly influenced by the thread linked at the bottom of this post. Moving on, to explain the problem I'm facing; my project utilizes an infinite While loop and automatically performs semi-hard coded monotonous tasks to save users time and effort, the problem is, occasionally and unexpectedly "Display Messages" will popup and the core script will continue executing instead of dismissing said message and the script "breaks". As a countermeasure I've added some code to the While loop in an effort to intervene and dismiss these display messages before the core script has a chance to do anything... however it doesn't work. I hope I didn't do too bad of a job explaining that. 
      So I think my question is: How can I temporarily "pause" the core script when these messages spontaneously appear?
      The only other solution I thought of would be to check if a display message has appeared before executing every line of code but that obviously isn't very practical.
      Any and all help is greatly appreciated!
      Thanks
       
      ;Loop to keep script running and handle display messages While 1 dismiss_display_messages() Sleep(50) WEnd ;Function to dismiss display messages Func dismiss_display_messages() If $ps.SearchText("Display Messages") Then $ps.SendKeys("[enter]", 8, 1) ;This while loop waits until the display message has disappeared to resume the core script While $ps.SearchText("Display Messages") Sleep(100) WEnd EndIf EndFunc  
       
×
×
  • Create New...