Sign in to follow this  
Followers 0
pjotterke

Troubles with Variabelles

13 posts in this topic

Hi iam creating a script for a program to do some thins automaticly.

Here is the script i only have a problem i want to check my input.

Because i maded a GUI where they have to fill in some variables so that my program can put them in the input boxes...

my problem is now that i can't check them with winwaitactive

Anybody who can help?

GUICreate ("Ratio Invoer Scherm", 410, 540, -1, -1, -1, -1)

GUISetBkColor (0x778899)

$n=GUICtrlCreatePic("H:\Dropbox\ratio\logo.jpg", 210, 450 , 190 , 80)

$n=GUICtrlCreatePic("H:\Dropbox\ratio\bovenbalk.jpg", 10, 10 , 390 , 80)

GUISetState (@SW_SHOW)

If Not ProcessExists("jba system 21.exe") Then

MsgBox(48, "Message", "als Ratio nog niet actief is start het dan alsublieft op, en vul hier de gegevens in van de order.")

Else

MsgBox(48, "Message", "als Ratio nog niet actief is start het dan alsublieft op, en vul hier de gegevens in van de order.")

Endif

Dim $Input_1

Dim $Input_2

Dim $Input_3

Dim $Input_4

Dim $Input_5

Dim $Input_6

Dim $Input_7

Dim $Input_8

Dim $Input_9

Dim $Input_10

Dim $Input_11

Dim $Input_20

Dim $Input_21

Dim $Input_22

Dim $Input_23

Dim $Input_24

Dim $Input_25

Dim $Input_26

Dim $Input_27

Dim $Input_28

Dim $Input_29

Dim $Input_30

$Input_20 = (""&GuiCtrlRead($input_1))

$Input_21 = (""&GuiCtrlRead($input_2))

$Input_22 = (""&GuiCtrlRead($input_3))

$Input_23 = (""&GuiCtrlRead($input_4))

$Input_24 = (""&GuiCtrlRead($input_5))

$Input_25 = (""&GuiCtrlRead($input_6))

$Input_26 = (""&GuiCtrlRead($input_7))

$Input_27 = (""&GuiCtrlRead($input_8))

$Input_28 = (""&GuiCtrlRead($input_9))

$Input_29 = (""&GuiCtrlRead($input_10))

$Input_30 = (""&GuiCtrlRead($input_11))

;beschrijving van het invoervak

GUICTRLCreateLabel ( "Item Numer" , 10, 110, 200, 20, -1)

GUICtrlCreateLabel ( "Match code" , 10, 140 ,200 , 20 , -1 )

GUICtrlCreatelabel ( "Klant Naam" , 10, 170 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Aantal Tracks + speelduur (hh:ss:ff)" , 10, 200 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Type (keuze uit A, AT, R, E, ET)" , 10, 230 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Huidige Datum" , 10, 260 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Copy Protection Methode" , 10, 290 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Tekst van binnen ring" , 10, 320 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Timestamp van de image file" , 10, 350 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Purchase ord.No" , 10, 380 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Huidige datum +1 werkdag" , 10, 410 ,200 , 20 , -1 )

;Invoer vakken voor de gebruiker

$input_1 = GUICtrlCreateInput ("" , 210, 110 , 190 , 20 , -1 )

$input_2 = GUICtrlCreateInput ("" , 210, 140 , 190 , 20 , -1 )

$input_3 = GUICtrlCreateInput ("" , 210, 170 , 190 , 20 , -1 )

$input_4 = GUICtrlCreateInput ("" , 210, 200 , 190 , 20 , -1 )

$input_5 = GUICtrlCreateInput ("" , 210, 230 , 190 , 20 , -1 )

$input_6 = GUICtrlCreateInput ("" , 210, 260 , 190 , 20 , -1 )

$input_7 = GUICtrlCreateInput ("" , 210, 290 , 190 , 20 , -1 )

$input_8 = GUICtrlCreateInput ("" , 210, 320 , 190 , 20 , -1 )

$input_9 = GUICtrlCreateInput ("" , 210, 350 , 190 , 20 , -1 )

$input_10 = GUICtrlCreateInput("" , 210, 380 , 190 , 20 , -1 )

$input_11 = GUICtrlCreateInput ("" , 210, 410 , 190 , 20 , -1 )

$Button_1 = GUICtrlCreateButton ( "Maak part" , 15, 480, 80, 20, -1 )

$Button_2 = GUICtrlCreateButton ( "Exit" , 115,480, 80, 20, -1 )

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Button_1

MaakPart()

Case $msg = $Button_2

Exit

;Sluit het programma af

EndSelect

WEnd

Func MaakPart ()

; Wait for Ratio to become active - it is titled "JBA System 21"

winwaitactive ("JBA System 21")

Sleep (500)

MouseClick ("left", 240, 80)

Sleep (500)

MouseClick ("left", 240, 100)

MouseClick ("left", 350, 100)

Winwait ("JBA System 21")

Send ("2")

Winwait ("JBA System 21" ,"2")

send ("FIMASTER")

Winwait ("JBA System 21" ,"FIMASTER")

Send ("{Tab}")

Winwait ("JBA System 21")

Send ("FI")

Winwait ("JBA System 21", "FI")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("{F12}")

Winwait ("JBA System 21")

send ("3")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_1))

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("FI")

Winwait ("JBA System 21")

Send ("{Enter}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_2))

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_3))

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_4))

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_5))

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_6))

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_6))

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

;Time stamp 0!

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_7))

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("2")

Winwait ("JBA System 21")

Send ("{delete}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_1))

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("gm")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send ("S")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("bv")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_8))

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("!t")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("{enter}")

WinwaitnotActive ("JBA System 21")

;Master Opdoeken

Send ("RTM")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_1))

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send ("FI")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_9))

Winwait ("JBA System 21")

;Planning Enter Order

WinWaitActive("JBA System 21")

MouseClick ("left", 580, 80)

Sleep (500)

MouseClick ("left", 580, 140)

MouseClick ("left", 640, 140)

Winwait ("JBA System 21")

Sleep (1000)

MouseClick ("left", 590, 350)

Send (""&GuiCtrlRead($input_1))

Winwait ("JBA System 21")

send ("{tab}")

Send ("GM")

Winwait ("JBA System 21")

send ("{enter}")

Winwait ("JBA System 21")

winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_10))

Winwait ("JBA System 21")

send ("1")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

send ("{tab}")

Winwait ("JBA System 21")

Send ("{delete}")

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_11))

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

WinWaitActive("JBA System 21")

Winwait ("JBA System 21")

MouseClick ("left", 580, 80)

Sleep (500)

MouseClick ("left", 580, 140)

MouseClick ("left", 640, 160)

Sleep (1000)

Winwait ("JBA System 21")

Send (""&GuiCtrlRead($input_11))

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

Send ("{tab}")

Winwait ("JBA System 21")

send ("G")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("1")

Winwait ("JBA System 21")

Send ("{enter}")

Winwait ("JBA System 21")

Send ("{enter}")

WinWait ("JBA System 21")

Send ("{F3}")

WinWait ("JBA System 21")

Send ("{F3}")

WinWait ("JBA System 21")

Send ("{F3}")

WinWait ("JBA System 21")

Send ("{F3}")

WinWait ("JBA System 21")

Send ("{F3}")

EndFunc

My own idea was to do it with:

WinWait ("JBA System 21"Dim $Input_20 ,)

Sorry for my English

Share this post


Link to post
Share on other sites



what have i doin wrong?

please tell me i need an answer so...

Share this post


Link to post
Share on other sites

ur spelling variabulls wrong

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I know this probably is off-topic, but you may want to use For-Next loops instead of writing all those repetitive lines of code

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

Man that's a lot of code...

Well, I didn't read through the whole thing, but I can tell you right now that having these lines:

$Input_20 = (""&GuiCtrlRead($input_1))
$Input_21 = (""&GuiCtrlRead($input_2))
$Input_22 = (""&GuiCtrlRead($input_3))
$Input_23 = (""&GuiCtrlRead($input_4))
$Input_24 = (""&GuiCtrlRead($input_5))
$Input_25 = (""&GuiCtrlRead($input_6))
$Input_26 = (""&GuiCtrlRead($input_7))
$Input_27 = (""&GuiCtrlRead($input_8))
$Input_28 = (""&GuiCtrlRead($input_9))
$Input_29 = (""&GuiCtrlRead($input_10))
$Input_30 = (""&GuiCtrlRead($input_11))

Before these lines:

$input_1 = GUICtrlCreateInput ("" , 210, 110 , 190 , 20 , -1 )
$input_2 = GUICtrlCreateInput ("" , 210, 140 , 190 , 20 , -1 )
$input_3 = GUICtrlCreateInput ("" , 210, 170 , 190 , 20 , -1 )
$input_4 = GUICtrlCreateInput ("" , 210, 200 , 190 , 20 , -1 )
$input_5 = GUICtrlCreateInput ("" , 210, 230 , 190 , 20 , -1 )
$input_6 = GUICtrlCreateInput ("" , 210, 260 , 190 , 20 , -1 ) 
$input_7 = GUICtrlCreateInput ("" , 210, 290 , 190 , 20 , -1 ) 
$input_8 = GUICtrlCreateInput ("" , 210, 320 , 190 , 20 , -1 )
$input_9 = GUICtrlCreateInput ("" , 210, 350 , 190 , 20 , -1 )
$input_10 = GUICtrlCreateInput("" , 210, 380 , 190 , 20 , -1 )
$input_11 = GUICtrlCreateInput ("" , 210, 410 , 190 , 20 , -1 )

Is not going to do anything usefull. How can you GUICtrlRead a control that hasn't been created yet?

Share this post


Link to post
Share on other sites

Also, what's the deal with putting the quotes at the start ? You seem to like that...

Send (""&GuiCtrlRead($input_6))

Share this post


Link to post
Share on other sites

Also, what's the deal with putting the quotes at the start ? You seem to like that...

Send (""&GuiCtrlRead($input_6))
K thanks,

That Quotes are for the text that i put in the fiels of my input boxes...

i'm now trying if it works tell it later

Share this post


Link to post
Share on other sites

K i tryed it.

But no succes...

my idea is to let the program check the input.

so if there is going something wrong he don't go on till the end...

but if i cant make that happen whit GUICTRLread how can i do it then?

can some body help me?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

K i tryed it.

But no succes...

my idea is to let the program check the input.

so if there is going something wrong he don't go on till the end...

but if i cant make that happen whit GUICTRLread how can i do it then?

can some body help me?

What do you mean by "wrong?" No input given?

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

yeah something like that...

ore if the "human" who is using this pc is doing something with the mouse so the mouse clicks some where else...

i want to make this for some little security

Share this post


Link to post
Share on other sites

then i have an other question.

the mouse coordinates...

there you can chose 3 options right?

witch of those can i best chose if my program is goin to work on more then 1 work station?

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

i self thought 0...

Share this post


Link to post
Share on other sites

K thanks,

That Quotes are for the text that i put in the fiels of my input boxes...

i'm now trying if it works tell it later

Huh ? Those quotes add nothing to what's sent as they contain no text at all. If you want to send quotes at the

start you need to mix double and single quotes or double up the quotes. This is also explained in the helpfile

somewhere. If you don't want to send the quotes as well, what about something like this ?

Send(GuiCtrlRead($input_6))

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
Sign in to follow this  
Followers 0