CrypticKiwi

Send + Explorer Error

10 posts in this topic

#1 ·  Posted (edited)

Hello,

i have a file containing a list of card names i want to send to internet explorer page.

while sending it misses characters in the middle of the sent text.

i decided to do a test to be sure and automate the process to detect the error,  so i send the text to explorer, copy it from explorer, save it in a file then read that file and compare it to the original list using stringinstr.

here's a video of the error.

Link

Edit: you might want to turn down the sound ^

is it a known issue? what can i do to resolve this issue?

using windows 10, US keyboard...

Edited by CrypticKiwi

Share this post


Link to post
Share on other sites



I don't like showing a video, but the code what you have tried .

Share this post


Link to post
Share on other sites

Sure, here is the original script i used to grab the images...

#include <IE.au3>
$Handle = fileopen("C:\Users\User\Desktop\MTG\CardList.txt",0)
$Read = FileRead($Handle)
$OCCR = 0
Sleep(10000)
While 1
    $OCCR += 1
    $CardEndLoc = StringInStr($Read,@CR,0,$OCCR)
    $Find = StringInStr($Read,"x ",0,$OCCR)
if $Find <> 0 Then
        $Mid =StringMid($Read,$Find -1,$CardEndLoc - ($Find - 1))
        $XX = StringMid($Mid,1,2)
        $CardName = StringMid($Mid,4,$CardEndLoc)

Else
    ExitLoop
        EndIf
Sleep(2000)
send("{CTRLDOWN}f{CTRLUP}Gatherer{Enter}")
Send("{TAB}{TAB}")
Sleep(1000)
ToolTip($CardName)
Send($CardName)

Send("{Enter}")
Sleep(10000)
$oIE = _IEAttach("Gatherer")
;_IELoadWait($oIE)
$ImageURL = _IEPropertyGet($oIE, "locationurl")
$ImageURL = StringReplace($ImageURL,"/Pages/Card/Details.aspx","/Handlers/Image.ashx")
$ImageURL = $ImageURL&"&type=card"
InetGet($ImageURL,"C:\Users\user\Desktop\MTG\Fridges\"&$XX&" "&$CardName&".png",0,0)
WEnd

i dont think its an error in the script because if you look at the vid the missing character is in the middle of the word.

this is what i used to test...

#include <IE.au3>
$Handle = fileopen("C:\Users\User\Desktop\MTG\CardList.txt",0)
$Read = FileRead($Handle)
$OCCR = 0
Sleep(10000)
While 1
    $OCCR += 1
    $CardEndLoc = StringInStr($Read,@CR,0,$OCCR)
    $Find = StringInStr($Read,"x ",0,$OCCR)
if $Find <> 0 Then
        $Mid =StringMid($Read,$Find -1,$CardEndLoc - ($Find - 1))
        $XX = StringMid($Mid,1,2)
        $CardName = StringMid($Mid,4,$CardEndLoc)

Else
    ExitLoop
        EndIf
Sleep(2000)
send("{CTRLDOWN}f{CTRLUP}Gatherer{Enter}")
Send("{TAB}{TAB}")
Sleep(1000)
ToolTip($CardName)
Send($CardName)
Sleep(1000)
Send("{CTRLDOWN}ac{CTRLUP}")
Sleep(500)
Send("{ALTDOWN}{TAB}{ALTUP}")
Sleep(500)
Send("{CTRLDOWN}a{CTRLUP}{BACKSPACE}")
Sleep(500)
Send("{CTRLDOWN}vs{CTRLUP}")
Sleep(500)
Send("{ALTDOWN}{TAB}{ALTUP}")
Sleep(500)
$Handle2 = FileOpen("C:\Users\User\Desktop\MTG\TestSend.txt",0)
$read2 = FileRead($Handle2)
if StringInStr($Read,$read2) = 0 Then MsgBox("","","Not Found"&"-"&$read2)
WEnd

i also tested this with notepad and no errors found...

CardList.txt

Share this post


Link to post
Share on other sites
1 minute ago, Jos said:

This look very much in conflict with our game automation forum rules ....  right?

hi jos, this is not a game to be automated, and i am not using a bot or automating a "game", i just want to download the images...its a long process to do it manually..

Share this post


Link to post
Share on other sites

Can you share main url?

 

Saludos

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

5 minutes ago, Danyfirex said:

Can you share main url?

 

Saludos

sure dany, URL but inorder to start my script you have to first search for a card for {tab} {tab} to work ,pick a name from the list and search for it.

Edited by CrypticKiwi

Share this post


Link to post
Share on other sites

I can't help you right now. But maybe you can do it using a POST method wait the response and then get the image using inetget.

 

Saludos

Share this post


Link to post
Share on other sites
27 minutes ago, Danyfirex said:

I can't help you right now. But maybe you can do it using a POST method wait the response and then get the image using inetget.

 

Saludos

Thanks dan, ill try to use post, but this is not the whole issue. i use the send command for alot of tasks unattended and i want to know/be sure if i can depend on it.

Share this post


Link to post
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

  • Similar Content

    • ur
      By ur
      If you observe in below code.
      Func _WinWaitActivate($title,$text,$timeout=$time_out) Logging("Waiting for "&$title&":"&$text) $dHandle = WinWait($title,$text,$timeout) if not ($dHandle = 0) then If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) Else Logging("Timeout occured while waiting for the window...") Exit EndIf EndFunc WinActivate("Untitled - Notepad") $p = "Notallowed1!!" Send("{ENTER}{ENTER}{ENTER}{ENTER}"& $p &"{ENTER}create{SPACE}database{SPACE}"& $p &";{ENTER}") In the notepad if you observe, ! is missing in the text got.
       
      Is there way to get that also printed.
    • rawkhopper
      By rawkhopper
      Hello everyone,
      I have a script that is automating a piece of sluggish software.  I want to automate it with a bit of caution and I am not sure the best way to do it.  ControlSend works great most of the time.  If I have it enter 10 into a text box every once in a while it will enter 1 or 11 and then hit enter.
      To overcome this I use MouseClick to select the text I just entered and then see if it matches the string it was supposed to put in before it hits enter.  This seems to work but what I love about ControlSend is there is less room for human interaction messing it up.  
      Yes I could block input but I prefer not to do that (permissions).
      Is there a better way of doing this?  Any Help would be much appreciated.
      Anyway here is the snippet of the script in question:
      Func KVSend () WinActivate ( "Window", "" ) Local $WindowPos = WinGetPos("Window", "") If $kV < 30 Then WinActivate ( "Window", "" ) ControlClick ("Window", "", 1001) ;Click in Accel Voltage box Sleep (100) ControlSend ("Window", "", 1001, $kV) ; \ kV Sleep (100) MouseMove($WindowPos[0]+130,$WindowPos[1]+75,1) MouseClick($MOUSE_CLICK_LEFT) MouseClick($MOUSE_CLICK_LEFT) Send ("^c") Local $clip = ClipGet () If $clip = $kV Then ControlSend ("Window", "", 1001, "{ENTER}") ;Hit ENTER if value is correct Sleep (100) ControlClick ("Window", "", 1518) ;Lens Clear Else Send ("{BACKSPACE}") KVSend() ; If value is incorrect try again EndIf EndIf  
    • spuuunit
      By spuuunit
      This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code:
      While WinActive(" - Mozilla Firefox") If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then $timer = TimerInit() While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) $diff = TimerDiff($timer) If $diff > 200 Then Send("^{T}") While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) WEnd EndIf WEnd EndIf WEnd The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.
    • Baboo85
      By Baboo85
      Hi all,
      I need to start a script that include:
      - admin privileges
      - multiple cmd commands
      - no bat, no exe, no tmp files created anywhere (especially in the user temp folder)
      In a bat file it would be simple, but users shouldn't see what commands I'm sending.
      Example of the script:
      echo off cls echo. echo I AM A TOOL echo. echo NOTE: echo - note 1 echo - note 2 echo - etc set USER1=0 set COMPUTER1=0 if /i %username% equ user.user ( set USER1=1 set COMPUTER1=1 ) if /i %username% equ another.user set USER1=1 if /i %computername% equ notebook set COMPUTER1=1 if %USER1% EQU 1 ( if %COMPUTER1% EQU 1 ( reg delete "HKLM\SOFTWARE\blablabla" /f ) else ( echo Computer not authorized. Contact assistance.) ) else ( echo User not authorized. Contact assistance.) echo. pause exit With the send("") is a disaster.
      I'm a noob here, so what can I do?
       
      EDIT: OR ELSE I explain the situation and what I need, so if there is a simple solution I can use that.
       
      SITUATION: our domain users have Users rights on the machine. Some of them need administrator rights.
      We create a local user with administrator rights, so that the users must insert username and password when asked to run something with administrator rights.
      We have an internal domain group policy that blocks EXE, BAT, COM, TMP files from the user local temp directory, for a security reason (malware). That also blocks most software installation.
      But some users are often out of office, away from workplace and in another country, they need a complete control on their computers.
       
      WHAT I NEED: I need to check the username and the computer name. If the username is the one with local administrator rights and the computer name is a computer that is qualified to temporary remove the policy, then I need to execute a REG DELETE command with administrator rights.
       
      I hope I explained myself.
       
      Thank you very much.
    • Jefrey
      By Jefrey
      I've made this HTTP lib to simplify HTTP requests, mainly when dealing about POST data or file uploads.
      Three functions are available:
      string _HTTP_Get ( string $sURL ) string _HTTP_Post ( string $sURL , string $sPostData ) string _HTTP_Upload ( string $sURL , string $sFilePath , string $sFileField , string $sPostData = '' , string $sFilename = Default) Additionaly, two helper functions are also available:
      URLEncode($sStr) URLDecode($sStr) Full documentation: https://github.com/jesobreira/HTTP.au3/blob/master/README.md
      Fork me on Github: https://github.com/jesobreira/HTTP.au3
      Download lib + docs: https://github.com/jesobreira/HTTP.au3/archive/master.zip