autow Posted October 20, 2010 Share Posted October 20, 2010 (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 October 20, 2010 by autow Link to comment Share on other sites More sharing options...
Realm Posted October 20, 2010 Share Posted October 20, 2010 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. Link to comment Share on other sites More sharing options...
Dreu Posted October 20, 2010 Share Posted October 20, 2010 (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 October 20, 2010 by Dreu Link to comment Share on other sites More sharing options...
jaberwacky Posted October 20, 2010 Share Posted October 20, 2010 (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 October 20, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
autow Posted October 20, 2010 Author Share Posted October 20, 2010 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 Link to comment Share on other sites More sharing options...
jaberwacky Posted October 20, 2010 Share Posted October 20, 2010 This code is for repeate script?The second script Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now