Jump to content

Recommended Posts

Posted (edited)

Hi,

I am new to using Autoit, and I am having difficulty in creating a working script.

what I am trying to do is create a variable that has multiple varibles (forgive my poor understanding) in the string and then from the command line execute.

only problem is when i declare variables they don't update after input has been entered, such as $customer.

Also could someone please explain the best way to maybe split up $wok variable so i can execute each $d1, $d2, $d3?

#include <Constants.au3>
Global $ping, $pong, $dimsum, $wok, $rice, $fried, $customer, $file

$ping = FileGetShortName(@TempDir & '\cooking\file1.exe')
$pong = 'title cooking with powchin' & ' ' & '&' & ' ' & 'cls'
$dimsum = @TempDir & '\cooking\status.exe'

$d1 = $ping & ' ' & 'tomyum' & ' ' & $customer
$d2 = $ping & ' ' & 'number78' & ' ' & $customer
$d3 = $ping & ' ' & 'specialcombo' & ' ' & $customer
$d4 = $ping & ' ' & 'whatchu' & ' ' & $customer
$d5 = $ping & ' ' & 'creamofsomeyoung' & ' ' & $customer
$d7 = $ping & ' ' & 'harro' & ' ' & $customer

$wok = $file & ' ' & $d1 & ' ' & '&' & ' ' & $d2 & ' ' & '&' & $d3 & ' ' & '&&' & ' ' & $d4 & ' ' & '&&' & $d5 & ' ' & '&&' & ' ' & $d7

input1()

func input1()
$whatsurname = InputBox("Input customer name", "Input customer name", "", "")
    If @error = 1 Then
        MsgBox(0, "", "Cancel Pressed, application terminated")
        Exit
    Else
        MsgBox(0, "", $wok) ;used to show output of $fried, but does not seem to update with customer name.
        input2()
    EndIf
EndFunc


Func input2()
    $Launcher = Run(@ComSpec & ' /k ' & '@echo off' & ' ' & '&' & ' ' & $pong & ' ' & '&' & ' ' & $wok, @SystemDir, @SW_HIDE)

Do
    sleep(20)
until ProcessExists($launcher) ==0

Do
    sleep(20)
Until ProcessExists("status.exe") ==0
SplashTextOn("", "Generating report" & @CRLF & "please wait" & @CRLF & "" & @CRLF & _
            "", 280, 185, 452, 349, 1, "", 17)
            sleep(2000)
            splashoff()
Run(@ComSpec & ' /k ' & $dimsum & ' ' & '-u:domsum\' & $customer & ' ' & '&' & ' ' & 'Exit', @SystemDir, @SW_HIDE)
Exit
    EndFunc

many thanks

Edited by wayfinder

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...