Sign in to follow this  
Followers 0
autow

Add variables

6 posts in this topic

#1 ·  Posted (edited)

hi everyone,I need to add variables and multiply the result by six thousand,look my code:

HotKeySet ("\","Terminate")
$x = InputBox ("value","How much?")
$Y = InputBox ("value","How much?")
$Z = InputBox ("value","How much?")
$X1 = InputBox ("value","How much?")
$Y1 = InputBox ("value","How much?")
$Z1 = InputBox ("value","How much?")
$X2 = InputBox ("value","How much?")
$Y3 = InputBox ("value","How much?")
$time = ???

I try this:

$time = ($x += $y += $z) *6000

but i can´t someone can help me?

Edited by autow

Share this post


Link to post
Share on other sites



Hello autow,

First I'd like to Welcome you to the AutoIt Forums ;)

Try this:

$time = ($x + $y + $z) *6000

Realm


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

HotKeySet ("\","_Terminate")


$x = InputBox ("value","How much?")
$Y = InputBox ("value","How much?")
$Z = InputBox ("value","How much?")
$X1 = InputBox ("value","How much?")
$Y1 = InputBox ("value","How much?")
$Z1 = InputBox ("value","How much?")
$X2 = InputBox ("value","How much?")
$Y3 = InputBox ("value","How much?")
$time = ($x + $y + $z) *6000


Func _Terminate()
Exit
EndFunc

If you noticed , I mad two changes. One up here... "HotKeySet ("\","_Terminate")" ... I added an underscore. No really really, I just like it better like that. I bring that up before there has to a function that the hotkeyset points to. So I created a function called _Terminate , ( like you had in the HotKeySet ) ... Which, I assumed by the name of it, was intended to exit the script. So thats what I did.

Are you wanting this script to run through one time, and then exit? Or keep on repeating until you press \

Edited by Dreu

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

HotKeySet("\", "Terminate")

Global $x = 0

For $i = 1 To 8 Step 1
    $x += InputBox("value", "How much?")
Next

Global $time = $x * 6000

MsgBox(0, "$time", $time)

Func Terminate()
    Exit
EndFunc ;==>Terminate

or

HotKeySet("\", "Terminate")

Global $x

While 1
    $x += InputBox("Value", "How much?")
WEnd

Func Terminate()
    Local $time = $x * 6000
    MsgBox(0, "$time", $time)
    Exit
EndFunc ;==>Terminate
Edited by jaberwocky6669

Share this post


Link to post
Share on other sites

HotKeySet ("\","_Terminate")


$x = InputBox ("value","How much?")
$Y = InputBox ("value","How much?")
$Z = InputBox ("value","How much?")
$X1 = InputBox ("value","How much?")
$Y1 = InputBox ("value","How much?")
$Z1 = InputBox ("value","How much?")
$X2 = InputBox ("value","How much?")
$Y3 = InputBox ("value","How much?")
$time = ($x + $y + $z) *6000


Func _Terminate()
Exit
EndFunc

If you noticed , I mad two changes. One up here... "HotKeySet ("\","_Terminate")" ... I added an underscore. No really really, I just like it better like that. I bring that up before there has to a function that the hotkeyset points to. So I created a function called _Terminate , ( like you had in the HotKeySet ) ... Which, I assumed by the name of it, was intended to exit the script. So thats what I did.

Are you wanting this script to run through one time, and then exit? Or keep on repeating until you press \

I want terminate the script pressing \

HotKeySet("\", "Terminate")

Global $x = 0

For $i = 1 To 8 Step 1
    $x += InputBox("value", "How much?")
Next

Global $time = $x * 6000

MsgBox(0, "$time", $time)

Func Terminate()
    Exit
EndFunc ;==>Terminate

or

HotKeySet("\", "Terminate")

Global $x

While 1
    $x += InputBox("Value", "How much?")
WEnd

Func Terminate()
    Local $time = $x * 6000
    MsgBox(0, "$time", $time)
    Exit
EndFunc ;==>Terminate

This code is for repeate script?

Thanks

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