Sign in to follow this  
Followers 0
SunnBoy

Read cmd

16 posts in this topic

Hey,

Ok i want to make a script where the run application is satrted and it puts in the command cmd.

ok i got so far.

is there any way i can tell the script to read what it will say in the 2nd row?

thanks guys :D

Share this post


Link to post
Share on other sites



Have the app output to a file, and then read the second line of that file.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

thanks but how do i do that lol

Share this post


Link to post
Share on other sites

thanks but how do i do that lol

read StdoutRead in the help file.

Share this post


Link to post
Share on other sites

ok can anyone tell me how i can make the script read it and if it says a special value do something and if it doesnt it should start over

thanks guys

Share this post


Link to post
Share on other sites

ok can anyone tell me how i can make the script read it and if it says a special value do something and if it doesnt it should start over

thanks guys

Did you look in the Helpfile and the example as suggested?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

yes :D

but i dont really get how to do it "-.-

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

yes :D

but i dont really get how to do it "-.-

which part of the example show is unclear to you?

What did you do and isn't working?

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

i mean ok im pretty new here...

and i just dont get how i can make it read the second column of the cmd window and do something if it finds the correct ip address or do something else if it doesnt...

Share this post


Link to post
Share on other sites

i mean ok im pretty new here...

and i just dont get how i can make it read the second column of the cmd window and do something if it finds the correct ip address or do something else if it doesnt...

Listen, You have made now a number of posts in this thread without any effort from you part as to what you actually want and what you have tried.

Come back when you have a question with a script you are actually working on, because you have to put the effort in..not us.

So start looking at the examples from the helpfile we pointed you to and start trying it, changing it to your needs and come back when you get stuck.

Success scripting,

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hey,

I do have a script.. or better say a GUI i just didnt want it to put in GUI section cuz i wanted it as a script.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=..\..\Desktop\Toolbar\Silkroad\San_Bow--Bot\cmdnetstat-n.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Marvin\Documents\AutoIt\netstatcmd.kxf
$Form1 = GUICreate("SBot", 465, 330, 192, 124)
$ID = GUICtrlCreateInput("", 16, 48, 121, 21)
$PW = GUICtrlCreateInput("", 16, 80, 121, 21)
$Label1 = GUICtrlCreateLabel("ID", 144, 48, 15, 17)
$Label2 = GUICtrlCreateLabel("PW", 144, 80, 22, 17)
$Button1 = GUICtrlCreateButton("Start SBot and Login", 16, 112, 123, 65, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Start SBot, Show Login Server, and Login", 144, 112, 235, 65, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Start SBot, and Hide Client after Login", 16, 192, 195, 65, $WS_GROUP)
$Button4 = GUICtrlCreateButton("Start SBot, and go Clientless after Login", 216, 192, 203, 65, $WS_GROUP)
$Label3 = GUICtrlCreateLabel("ATTENTION: THIS PROGRAM HAST TO BE PLACED IN THE SBOT FOLDER TO WORK!!!", 16, 8, 448, 17)
$Label4 = GUICtrlCreateLabel("Made by: San_Bow", 296, 288, 97, 17)
$Label5 = GUICtrlCreateLabel("It will always show you the login server except the first one :D", 16, 264, 292, 17)
GUISetState(@SW_SHOW)
$Read_ID = GUICtrlRead ($ID)
$Read_PW = GUICtrlRead ($PW)
GUICtrlSetState ($Button4, $GUI_DISABLE)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Start_Sbot()
        Case $Button2
            Start_Sbot_cmd ()
        Case $Button3
            Start_Sbot_Hide_Client ()
        Case $Button4
            Start_Sbot_Clientless ()

    EndSwitch
WEnd

; Script Start - Add your code below here
Func Start_Sbot ()
    Run("SBot_1.49b.exe", "")
    WinWaitActive ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    WinSetState("SBot v1.49b (C)2008,2009 by bot-cave.net","", @SW_MAXIMIZE)
    Sleep(1000)
    MouseClick("left",124,290,2) ; ==> Start Client
    WinWaitActive ("SRO_Client")
    WinActivate ("SRO_Client")
    Sleep(1000)
    Send ("{x}")
    Sleep (1000)
    $Read_ID = GUICtrlRead ($ID)
    Send ($Read_ID)
    Sleep(750)
    Send ("{TAB}")
    Sleep(500)
    $Read_PW = GUICtrlRead ($PW)
    Send ($Read_PW)
    Sleep(1000)
    Send ("{ENTER}")
EndFunc

FUNC Start_Sbot_cmd ()
    Run("SBot_1.49b.exe", "")
    WinWaitActive ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    WinSetState("SBot v1.49b (C)2008,2009 by bot-cave.net","", @SW_MAXIMIZE)
    Sleep(1000)
    MouseClick("left",124,290,2) ; ==> Start Client
    WinWaitActive ("SRO_Client")
    Send ("#r")
    WinWaitActive ("Run")
    Send ("cmd")
    Send ("{ENTER}")
    WinWaitActive ("C:\Windows\system32\cmd.exe")
    Send ("netstat -n")
    Sleep (200)
    Send ("{ENTER}")
    WinActivate ("SRO_Client")
    Sleep(1000)
    Send ("{x}")
    Sleep (1000)
    $Read_ID = GUICtrlRead ($ID)
    Send ($Read_ID)
    Sleep(750)
    Send ("{TAB}")
    Sleep(500)
    $Read_PW = GUICtrlRead ($PW)
    Send ($Read_PW)
    Sleep(1000)
    Send ("{ENTER}")
    Sleep(2000)
    WinActivate ("C:\Windows\system32\cmd.exe")
    Sleep(5000)
    WinClose ("C:\Windows\system32\cmd.exe")
EndFunc

Func Start_Sbot_Hide_Client ()
    Run("SBot_1.49b.exe", "")
    WinWaitActive ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    WinSetState("SBot v1.49b (C)2008,2009 by bot-cave.net","", @SW_MAXIMIZE)
    Sleep(1000)
    MouseClick("left",124,290,2) ; ==> Start Client
    WinWaitActive ("SRO_Client")
    Send ("#r")
    WinWaitActive ("Run")
    Send ("cmd")
    Send ("{ENTER}")
    WinWaitActive ("C:\Windows\system32\cmd.exe")
    Send ("netstat -n")
    Sleep (200)
    Send ("{ENTER}")
    WinActivate ("SRO_Client")
    Sleep(1000)
    Send ("{x}")
    Sleep (1000)
    $Read_ID = GUICtrlRead ($ID)
    Send ($Read_ID)
    Sleep(750)
    Send ("{TAB}")
    Sleep(500)
    $Read_PW = GUICtrlRead ($PW)
    Send ($Read_PW)
    Sleep(1000)
    Send ("{ENTER}")
    Sleep(2000)
    WinActivate ("C:\Windows\system32\cmd.exe")
    Sleep(5000)
    WinClose ("C:\Windows\system32\cmd.exe")
    WinActivate ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    WinWaitActive ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    MouseClick("left",745,472,1) ; ==> Hide
EndFunc

Func Start_Sbot_Clientless ()
    Run("SBot_1.49b.exe", "")
    WinWaitActive ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    WinSetState("SBot v1.49b (C)2008,2009 by bot-cave.net","", @SW_MAXIMIZE)
    Sleep(1000)
    MouseClick("left",124,290,2) ; ==> Start Client
    WinWaitActive ("SRO_Client")
    Send ("#r")
    WinWaitActive ("Run")
    Send ("cmd")
    Send ("{ENTER}")
    WinWaitActive ("C:\Windows\system32\cmd.exe")
    Send ("netstat -n")
    Sleep (200)
    Send ("{ENTER}")
    WinActivate ("SRO_Client")
    Sleep(1000)
    Send ("{x}")
    Sleep (1000)
    $Read_ID = GUICtrlRead ($ID)
    Send ($Read_ID)
    Sleep(750)
    Send ("{TAB}")
    Sleep(500)
    $Read_PW = GUICtrlRead ($PW)
    Send ($Read_PW)
    Sleep(1000)
    Send ("{ENTER}")
    Sleep(2000)
    WinActivate ("C:\Windows\system32\cmd.exe")
    Sleep(5000)
    WinClose ("C:\Windows\system32\cmd.exe")
    WinActivate ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    WinWaitActive ("SBot v1.49b (C)2008,2009 by bot-cave.net")
    MouseClick("left",436,293,2)
EndFunc

thats my code^^

ok i read all help sections and everythnig but since my english isnt that good i DO NOT understand how to make it read the second column^^

maybe you can help me

im talking about the part

end ("#r")
    WinWaitActive ("Run")
    Send ("cmd")
    Send ("{ENTER}")
    WinWaitActive ("C:\Windows\system32\cmd.exe")
    Send ("netstat -n")

after the Send ("netstat -n")

i want it to read

Share this post


Link to post
Share on other sites

You clearly are not using Run() with the StdoutRead() as suggested and as I am not into Bot bs I am signing off of this thread.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

OMG its not a bot why does everybody think that xD

IT IS NOT A BOT!

and yes i didnt use it BECAUSE I DIDNT UNDERSTAND HOW!!!!

Share this post


Link to post
Share on other sites

Wow - I wish I had your typing/coding speed ... to come up with such a script in 8 minutes ... that's more than amazing :D

Ummm, let's see ... help with a Silkroad Bot when you're showing a script downloaded from somewhere and you don't put too much effort to understand simple instructions or to read something from the help file.

I'll say: good luck (you'll need it)


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Why don't you ask the person who wrote the code because you obviously didn't. I personally have no time for someone is not even trying to understand how to code in Autoit and wants everything given to them. You can try harder, before I lift a finger. Born with a silver spoon were you?

The below text in the code might have made Jos think it was a Bot....

"Silkroad\San_Bow--Bot"

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

OMG its not a bot why does everybody think that xD

IT IS NOT A BOT!

and yes i didnt use it BECAUSE I DIDNT UNDERSTAND HOW!!!!

Sure.. anyways you have been pointed in the right direction.

*click*

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0