Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

Completing Java-based forms without a browser

$
0
0

Hello everyone,

 

First, I am fairly new to AutoIT and coding in general. I work in IT, but this is not my area. However, I wanted to learn new things, and I must say the forums here are filled with useful information. You guys are great.

 

Now, I have tried using the advanced search for this, but keep coming up empty handed. I am attempting to fill in a java-based form with a dropdown selection and then a username/password box. The issue i'm having is I am not sure how to force AutoIT to select the correct boxes without having ID/Name available to me in browsers. I am trying to avoid using things like Send ("{TAB}") as for some this will be the first time they use it (thus the form being empty) while others it will be the 100th time meaning the username and dropdown may already be filled in.

 

Here is what the screen looks like:

 

https://drive.google.com/file/d/0B7WdpJLMgb32c2twa0RYQzdXeFU/edit?usp=sharing

 

Here is a link to the .jar file if anyone is interested (can't attach):

 

https://drive.google.com/file/d/0B7WdpJLMgb32MHk4RmxyMDh3Yzg/edit?usp=sharing

 

Since this runs through java there is no browser so using something like F12 like you would in Chrome doesn't give me any information concerning the form.

 

Sorry for the drive link and not a direct image. I'm on a domain and can't upload to most places from here. I feel like I'm missing something very simple with this script, but maybe it's not possible?Thanks for any help you can give me.

 

Here is the command to run the file:

 

ShellExecute('java', '-jar "gradebook.jar', 'C:\Documents and Settings\ct253704\Desktop') Sleep (6000)

I would like to make this script run on Windows 8, Windows 7, and Windows XP if possible as well.


WinSetOnTop - Taking Focus?

$
0
0

I am writing another utility for my job that pulls data from a server and displays it on agent desktops.  It is critical that the information window remain on top of all other windows, including other windows that want to fight for "top position".

 

I placed my WinSetOnTop within my main loop.  It works nicely for me, 0 issues.  However, some of the agents have mentioned that since I deployed in beta, focus from their other application windows seems to get stolen.  Strange thing is it only seems to happen every once in a while.

 

Anyone have any ideas about this?

Click a button ?

$
0
0

Anyone can help me to click this button ? 

 

screenshot_27.png

 

Am really new to this programming languaje :S sorry for my noob question :C.

Thanks to all

Run program when cpu starts up

$
0
0

Hello,
 

So as the tittle says i want my script to run when cpu starts up.
I have never done this before so i dont know much about this.
I tried these two:

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", @ScriptName, "REG_SZ", @DesktopDir & "\myScript.exe")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup", @ScriptName, "REG_SZ", @DesktopDir & "\myScript.exe")

 

but none works.
 

I have never used RegWrite before. So some good tips would be greatly appreciated.

Cheers.

 

Get text (word) under the mouse pointer

$
0
0

Hi,

 

How to get word under the mouse pointer without selecting it?

 

Or if it not possible, by selecting it?

 

I'm trying to get a word under the mouse pointer at a AutoIT's editbox created using GUICtrlCreateEdit

and display the word when the user click on it

 

Seems cant find the way :(

 

Thanks!

Does _INetGetSource or _IEDocReadHTML work with secure sites

$
0
0

I am trying to view the source code from a secure site: Just trying to extract the download link but my code fails

  1. #include <Inet.au3>
  2. #include <IE.au3>
  3.  
  4. ;~ $test = "https://www.java.com/en/download/manual.jsp"
  5. ;~ $string=_INetGetSource($test)
  6. ;~ $result = StringInStr($string, "Download Java software for Windows (64-bit)")
  7. ;~ MsgBox(0, "", "Results: " & $string)
  8.  
  9. ;~ Local $oIE = _IE_Example("https://www.java.com/en/download/manual.jsp")
  10. ;~ Local $sHTML = _IEDocReadHTML($oIE)
  11. ;~ MsgBox(0, "Document Source", $sHTML)
  12. ;a title="Download Java software for Windows (64-bit)" href="http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385">
  13.  
  14. $oIE = _IECreate("https://www.java.com/en/download/manual.jsp", 0, 0)
  15. $sString = _IEBodyReadHTML($oIE)
  16. MsgBox(0, "Document Source", $sString)

how to verfiy the lotus notes account lockout and id file expire

$
0
0

Dear Team,

 

I have lotus notes client .I would like to verify before configure the lotus notes Lotus notes id file is correct or not .

Any one have idea how do we do the pre check with auoit

Need help on dispalying processing window

$
0
0

Hi,

 

After WinSetState ( "windowname", "", @SW_HIDE) in the below script i want to display window(just like the task is processing) and that window should close when the whole task is completed.

How to do

 

 

Global $oIE=_IECreate($URL)
sleep (3000)

 Local $username =_IEGetObjByName($oIE,"username")
   Local $password = _IEGetObjByName($oIE,"password")
   Local $button = _IEGetObjByName($oIE,"login")
   _IEFormElementSetValue( $username,$user)
   _IEFormElementSetValue( $password,$pass)
   send ("{TAB}")
   send ("{TAB}")
WinSetState ( "windowname", "", @SW_HIDE)
WinWait("windowname")
ControlSend("windowname", "", "Internet Explorer_Server1", $user)
sleep (200)
send ("{TAB}")
ControlSend("windowname", "", "Internet Explorer_Server1", $pass)
sleep (200)
send ("{TAB}")
send ("{ENTER}")
sleep (3000)

 

TIA


Need help on creating dialog box with text

$
0
0

Hi,

 

 GUICreate("My GUI", 250, 250, -1, -1, BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOPMOST))

 

i used the above command it will create only empty dialog box,but how to create a dialog box with text inside that.

 

TIA

 

 

GUIOnEventMode problem

$
0
0

I'm using GUIOnEventMode like this (just example):

  1. Opt("GUIOnEventMode",1)
  2. $hMainForm = GUICreate( "Main form", 580, 320)
  3. $hSubFormButton = GUICtrlCreateButton( "Sub Form", 10, 10, 100, 100)
  4. GUICtrlSetOnEvent(-1,"SubForm")
  5. GUISetState(@SW_SHOW,$hMainForm)
  6.     Sleep(10)
  7. ; ...
  8.  
  9. Func SubForm()
  10.         $hSubForm=GUICreate( "Sub Form", 100, 100)
  11.         GUISetState(@SW_SHOW,$hSubForm)

But if I click "Sub Form" Button (SubForm appears) and then I click it again, a duplicate SubForm appears. 

I don't want a duplicate SubForm, so there is a way to solve this problem? 

Thanks a lot! :)

PS: srr, I'm newbie and my English is bad :)

Need help for passing abstract data

$
0
0

Hi guys,

 

   Now, I'm writing a UDF that is about multiprocessing, imitate a python's module. But I have a problem still not resoved. How can I can serialize the Autoit data (e.g. function handle, array, data from DllStruct* function) to other Autoit processes , then they can deserialize data?

   

    I searched forum, but only found JSON UDF (can't serialize function handle and data returned by DllStructCreate) and "MSOSoap" a COM interface, dose it complete compatible with Autoit data? Or do you know another ways can passing

abstract data?

   

  Anyway I'm expecting your any suggesting or any recommanding tools. Thanks everyone.

question about loops (noob)

$
0
0

so,

i'm trying to execute a function for about 2 minutes,

i know about 2 sorts of loops right now:

-while 0 loop (keeps running forever)

-do loop (executes the function x times)

 

but are there loops which execute a function for a certain amount of time?

or what other loops do you have?

 

kind regards

Downloading .torrent files with InetGet

$
0
0

Hi Guys,

 

I'm trying to create a program that'll download .torrent files for me automatically and place them in a folder so uTorrent starts downloading them.

The whole script works flawless (for now) except for the most important part: Downloading the .torrent file.

It works, it downloads the .torrent file perfectly, but for some reason uTorrent gives me the error that 'the torrent file was not correctly encoded'.

For some reason downloading the torrent with InetGet instead of my browser, fucks it up. The size of the torrent is exactly the same as that of the one I download with my browser, still the files are different.

 

This is my script:
 

AutoIt         
#cs ----------------------------------------------------------------------------  AutoIt Version: 3.3.8.1  Author:         myName  Script Function:     Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <INet.au3> #include <Array.au3> $downloadfolder = 'C:\Users\Ludo\Downloads\torrents' $searchquiry = StringReplace('the hobbit desolation of smaug', ' ', '+') $preferedsite = 'kickmirror' $link = 'http://torrentz.eu/search?f='&$searchquiry $source = _INetGetSource($link, True) $S1 = StringSplit($source, '<a rel="nofollow" href="/searchA?f='&$searchquiry&'"> date </a> |  <a rel="nofollow" href="/searchS?f='&$searchquiry&'"> size </a> |  <b> peers </b></h3>', 1) $S2 = StringSplit($S1[2], '<dl><dt style="text-align: right">', 1) $S3 = StringSplit($S2[1], @LF, 1) global $torrents[$S3[0]+1][7] $torrents[0][0] = $S3[0]-1 ;   Form of $torrents[a][b] for b: ;       $torrents[a][0] = total string ;       $torrents[a][1] = torrent url ;       $torrents[a][2] = torrent title ;       $torrents[a][3] = torrent size ;       $torrents[a][4] = torrent seeders ;       $torrents[a][5] = torrent peers ;       $torrents[a][6] = torrent type For $i = 1 to $torrents[0][0]     ;MsgBox(0, '', _StringBetw($S3[$i], '<a href="', '">'))     $torrents[$i][0] = $S3[$i]     $torrents[$i][1] = _StringBetw($S3[$i], '<a href="', '">')     $torrents[$i][2] = _StringStrip(_StringBetw($S3[$i], '<a href="'&$torrents[$i][1]&'">', '</a>'))     $temp1 = StringSplit($S3[$i], '</a> » ', 1)     $temp2 = StringSplit($temp1[2], '</dt><dd>', 1)     $temp3 = StringSplit($S3[$i], '</span></span><span class="s">', 1)     $temp4 = StringSplit($temp3[2], '</span> <span class="u">', 1)     $temp5 = StringSplit($temp4[2], '</span><span class="d">', 1)     $temp6 = StringSplit($temp5[2], '</span>', 1)     $torrents[$i][3] = $temp4[1]     $torrents[$i][4] = $temp5[1]     $torrents[$i][5] = $temp6[1]     $torrents[$i][6] = $temp2[1] Next ;_ArrayDisplay($torrents) ;ClipPut($torrents[1][1]&@CRLF&@CRLF&$torrents[$torrents[0][0]][2]) $source2 = _INetGetSource('http://torrentz.eu/'&$torrents[1][1]) $A1 = StringSplit($source2, ' torrent download locations</h2><dl><dt>', 1) $A2 = StringSplit($A1[1], '</span> ', 1) $A3 = StringSplit($A1[2], '<a href="', 1) $locations = $A2[$A2[0]] global $tors[$locations+1] $n = 0 For $i = 2 to $locations     $A4 = StringSplit($A3[$i], '" ', 1)     $tors[$i] = $A4[1]     If StringInstr($tors[$i], $preferedsite) Then         $n = $i     EndIf Next If $n = 0 Then     Msgbox(32, 'Too bad', 'No kickmirror torrent links found..')     Exit EndIf ;_ArrayDisplay($tors) $source3 = _INetGetSource($tors[$n], True) ;$B1 = _StringBetw($source3, '<a title="Magnet link" href="', '"') ;ShellExecute($B1) $B1 = _StringBetw($source3, '<a rel="nofollow" title="Download verified torrent file" href="', '"') $B2 = StringSplit($B1, '.torrent?title=', 1) $finallink = $B2[1]&'.torrent' InetGet($finallink,$downloadfolder&'\'&$B2[2]&'.torrent', 4) MsgBox(32, 'Succes', 'Torrent started downloading!') Func _StringBetw($string, $start, $end)     $pa = StringSplit($string, $start, 1)     If $pa[0] <  2 Then Return 0     $pb = StringSplit($pa[2], $end, 1)     Return $pb[1] EndFunc Func _StringStrip($string)     $s = StringReplace($string, '<b>', '')     $s1 = StringReplace($s, '</b>', '')     Return $s1 EndFunc

Please try it out, then try to run the torrent with utorrent or some other torrent downloader.

If somebody knows what the problem is, I'd be very happy if you'd help me here!

 

Thnx in advance,

Ludo

Copying an Array into an Array

$
0
0

Hey Iam trying to copy an Array in to another Array with no luck.

I have an ArrayA(2dimension) and ArrayB(1Dimension) I want to copy whole ArrayB in ArrayA.

Global $GradeArray[8][2] $GradeArray[0] = StringSplit($Text,"   ",3)

Stringsplit returns 1dimension array with 2 elements and GradeArray have 2dimension. But this code only gives me error.

 

Do I have to copy 1 element by 1 like this?:

    $i = StringSplit($Text,"   ",3)     $GradeArray[0][0] =$i[0]     $GradeArray[0][1] =$i[1]

Or simply Iam just making simple syntax mistake?

 

Thanks for any advice.

Ping is not working when VPN is on

$
0
0

Hello

 

when I turn on VPN, the Ping command is returning error #2, but of course from command prompt it is working. This is problem with Ping command? Maybe he need to always recheck routing table what network adapter it should use?

 

 

thx


Calling data from 2D Array

$
0
0

Right this is my first time using arrays, I have created a 2D array

#include <Array.au3> Local $a2DArray[3][2] = [ _ ['text1', 'answer1'], _ ['text2', 'answer2'], _ ['text1', 'answer2']] _ArrayDisplay($a2DArray, "2D display") ;

What I was to do is pull out the data from row 0 column 0 to a variable $loc and data from row 0 column 1 to variable $ans

 

Then run that through a function like:

Func check() local $Aloc = $loc local $Aans = $ans If $Aloc = "text1" & $Aans = "answer1" then    msgbox(4096,"Success","Answer was test1") Else    msgbox(4096,"Fail","Answer Failed Check" Endif EndFunc ;==>check

then it needs to do it all again for the next row and so on

 

Can anyone point me in the right direction?

How to insert a script inside a script?

$
0
0

Hey guys, I'm trying to define a string to be a another script, so that it can be run independently of the first one and not interrupt the process.

 

How can it be done? When I define a string variable, does it needs to be all in the same line? How can I convert a regular script to a onliner that Autoit would then reconstruct properly?

Is it possible to download image without extension?

Prefix in variable naming - complete list?

$
0
0

Hello,

 

I've noticed that all the included examples uses a variable practice like so:

 

  • $sWow64 (string)
  • $hImage (handle)
  • For $iY = 0 To $iH - 1 (integers)

 

and so on...

Which seems to be a nice practice in general.

 

I'm wondering if there's any list of all the data types, and how they are/can/should be used when it comes to naming variables? Or quality discussions on this specific area regarding coding standards.

For example, I'm not yet sure what data type $tSomething means (an example from the help file states: "a variable for use with DllStruct calls" which isn't that clear to me)

Dllcall - Matlab dll

$
0
0

I have defined a simple function in Matlab:

function y = test1(x) y = x+1; end

Then I use deploytool and compile it to "c++ shared library" (here is the dll file: https://db.tt/tLgwv0BO) and try to call it using Autoit:

#include <Array.au3> $dll = DllOpen("myproj1.dll") DllCall($dll, "none", "myproj1Initialize") $result = DllCall($dll, "dword", "mlxTest1","dword",2) If @error Then msgbox(0,"",@error) DllCall($dll, "none", "myproj1Terminate") DllClose($dll) _ArrayDisplay($result)
 

When I run this, it freezes and I have to kill SciTE.

If I comment out calling myproj1Initialize and myproj1Terminate, then it does not freeze, but it returns the exact value I pass to the function!

Any suggestion would be appreciated.

Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>