BeZ Posted August 24, 2006 Posted August 24, 2006 (edited) First I would like to thank people who helped me with problem (mainly Paule and Mega). I finnaly came up with this script (with wich I STILL need help, lol) expandcollapse popup#include <GUIConstants.au3> #include <File.au3> ;#NoTrayIcon Dim $button_start Dim $prix Dim $cout Dim $fname Dim $lname MsgBox(0, "Script", "Starting Script") Bloquage () Func Bloquage () GuiCreate("blocked", 1024, 768, 0, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) $button_start = GUICtrlCreateButton("Click to start", 452, 374, 150) $fname = GUICtrlCreateInput ( "Prenom / First name", 452, 326, 150, 20) $lname = GUICtrlCreateInput ( "Nom de famille / Last name", 452, 350, 150, 20) Entrernom () EndFunc Func Entrernom () While 1 GUISetState() $msg = GUIGetMsg() Select Case $msg = $button_start and GUICtrlRead($lname) = "Nom de famille / Last name" Erreur () Case $msg = $button_start and GUICtrlRead($lname) <> "Nom de famille / Last name" _FileWriteLog(@ScriptDir & "\Internet.log","First name : " & GUICtrlRead($fname) & " | " & "Last name : " & GUICtrlRead($lname)) ExitLoop EndSelect WEnd GUIDelete("blocked") Compteur() EndFunc Func erreur() MsgBox(262144, "Erreur", "Entrer votre nom / Enter youre name") Entrernom () EndFunc Func Compteur() For $cout = 0.75 to 0.76 step 0.01 ToolTip(Round($cout,2)&"$ +tx.", 0, 0) Sleep (2500) Next For $cout = 0.75 To 2.5 Step 0.01 ToolTip(Round($cout,2)&"$ +tx.", 0, 0) Sleep(120) Next Prix () EndFunc Func Prix () MsgBox(262144, "Prix / Price", "Cout / Cost:" & $cout & " + taxes") Bloquage () EndFunc First, for this line: For $cout = 0.75 To 2.5 Step 0.01 I would like to have a "stop" button instead of waiting for $cout to get to 2.5 Second, for this line: MsgBox(262144, "Prix / Price", "Cout / Cost:" & $cout & " + taxes") $cout is always blank (it seems like it is equal to 0.75 to 2.5 only in the loop). How can I fix this? Thanks for helping, BeZ EDIT: About the button, maybe with an IF cmd ? Edited August 24, 2006 by BeZ
Xenobiologist Posted August 24, 2006 Posted August 24, 2006 HI, expandcollapse popup#include <GUIConstants.au3> #include <File.au3> ;#NoTrayIcon HotKeySet("1", "prix") Dim $button_start Dim $prix Dim $cout1 Dim $fname Dim $lname MsgBox(0, "Script", "Starting Script") Bloquage () Func Bloquage () GuiCreate("blocked", 1024, 768, 0, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) $button_start = GUICtrlCreateButton("Click to start", 452, 374, 150) $fname = GUICtrlCreateInput ( "Prenom / First name", 452, 326, 150, 20) $lname = GUICtrlCreateInput ( "Nom de famille / Last name", 452, 350, 150, 20) Entrernom () EndFunc Func Entrernom () While 1 GUISetState() $msg = GUIGetMsg() Select Case $msg = $button_start and GUICtrlRead($lname) = "Nom de famille / Last name" Erreur () Case $msg = $button_start and GUICtrlRead($lname) <> "Nom de famille / Last name" _FileWriteLog(@ScriptDir & "\Internet.log","First name : " & GUICtrlRead($fname) & " | " & "Last name : " & GUICtrlRead($lname)) ExitLoop EndSelect WEnd GUIDelete("blocked") Compteur() EndFunc Func erreur() MsgBox(262144, "Erreur", "Entrer votre nom / Enter youre name") Entrernom () EndFunc Func Compteur() #cs For $cout = 0.75 to 0.76 step 0.01 ToolTip(Round($cout,2)&"$ +tx.", 0, 0) Sleep (2500) Next #ce For $cout = 0.75 To 1 Step 0.01 ToolTip(Round($cout,2)&"$ +tx.", 0, 0) $cout1 = $cout Sleep(120) Next Prix() EndFunc Func Prix() MsgBox(262144, "Prix / Price", "Cout / Cost:" & $cout1 & " + taxes") Bloquage () EndFunc So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
BeZ Posted August 24, 2006 Author Posted August 24, 2006 Wow, i tryed this, no joke. This is where $prix comes from. Maybe it wasn't working because i declared it at the begining ? thanks again Mega BeZ
Paulie Posted August 24, 2006 Posted August 24, 2006 (edited) Wow, i tryed this, no joke. This is where $prix comes from. Maybe it wasn't working because i declared it at the begining ?thanks again MegaBeZDoes this mean there is a problem with my script? or are you just too lazy to try understand a functionWhy re-invent the wheel by making a timer like that, when there are already functions that time for you, hell I wrote the script out with a point-by-point was it not enough?EDIT:Typo Edited August 24, 2006 by Paulie
BeZ Posted August 24, 2006 Author Posted August 24, 2006 Dear Paulie, I am not using youre method because the client has to see how much it costs him. With youre method the client won't see anything. And anyway, I have to keep the part that ask and store their name. Also, I must not use any hotkey so a guy with a stop button is needed. BeZ lol
azeazezar Posted August 24, 2006 Posted August 24, 2006 you could simpley have the program send you an email with the price when its done... that would be a lot simpler...
BeZ Posted August 24, 2006 Author Posted August 24, 2006 Wow Azeazezar you really don't understand. And I don't like how you just post a line saying "easy", thinking that you are better than other. so: 1: i suck at scripting 2: the client has to see his time on the screen 3: it wouldnt be more simple to send myself an email, plus the time it requires to receive it and open outlook on my super slow work computer 4: with a log file, i can easily map a shortcut on my desktop to it ty, BeZ
Paulie Posted August 25, 2006 Posted August 25, 2006 Dear Paulie,I am not using youre method because the client has to see how much it costs him. With youre method the client won't see anything. And anyway, I have to keep the part that ask and store their name. Also, I must not use any hotkey so a guy with a stop button is needed.BeZ lolWhat?It makes a tooltip in the corner, and this could be changed very easily to a GUI if you so desirejust saying that you are going through alot more work using this then you'd be with TimerInt/Diff functionswhatever though, do it however you want, just trying to make things easy
BPBNA Posted August 25, 2006 Posted August 25, 2006 I don't think azeazezar meant to offend. He is just offering a suggestion, yet I agree with Bez. You won't know that you got the email for a little bit unless you sit there hitting send/receive or have the timer to check for new emails set very low. I haven't seen Paulies script, but just because it displays the price a different way than you would like, doesn't mean you cant change it a little.
Paulie Posted August 25, 2006 Posted August 25, 2006 (edited) I don't think azeazezar meant to offend. He is just offering a suggestion, yet I agree with Bez. You won't know that you got the email for a little bit unless you sit there hitting send/receive or have the timer to check for new emails set very low. I haven't seen Paulies script, but just because it displays the price a different way than you would like, doesn't mean you cant change it a little.Right, just to avoid misunderstanding here is my script HotKeySet("{ESC}", "End_Timer") Global $Timer= "",$Total, $Charge, $LegTime, $Final[3] Sleep(3000) Start_Timer() While 1 If not $Timer = "" then $Dif = TimerDiff($Timer) $Final = Calculate($Dif) $Display = StringTrimRight($Final, 1) ToolTip("Total: $"&$Display,0,0) Else Sleep(200) Endif WEnd Func Start_Timer() $Timer = TimerInit() EndFunc Func End_Timer() $FinalDiff = TimerDiff($Timer) $Charge = Calculate($FinalDiff) MsgBox(0, "Total", "Your total comes to:"&@CRLF&"$"& Round($Charge),2) $Timer = "" EndFunc Func Calculate($A_Time) $LegTime = Round($A_Time/1000,2) $RetData = Round(($LegTime/1200),3) Return $RetData EndFunc and the background on how it was created can be found here: http://www.autoitscript.com/forum/index.php?showtopic=31453 Edited August 25, 2006 by Paulie
BeZ Posted August 25, 2006 Author Posted August 25, 2006 Here is my scrip after all help gathered. WORKS. (not set for 3$/hour now because I am still testing / looking for bugs). expandcollapse popup#include <GUIConstants.au3> #include <File.au3> ;#NoTrayIcon Dim $coutpresent Dim $button_start Dim $cout Dim $Initiales dim $prix MsgBox(0, "Script", "Starting Script") Bloquage () Func Bloquage () GuiCreate("blocked", 1024, 768, 0, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUICtrlCreateLabel ("Dernier cout enregistré / Last cost saved :", 412, 50, 199, 20) GUICtrlCreateLabel (Round($cout, 2) & " $ + taxes", 474, 72, 76, 20) $button_start = GUICtrlCreateButton("Cliquez pour commencer / Click to start", 412, 374, 200, 20) $Initiales = GUICtrlCreateInput ( " Initiales / Initials", 462, 350, 100, 20) GUICtrlCreatePic (@ScriptDir & "\logo-CAE.jpg", 362, 116, 300, 200) GUICtrlCreatePic (@ScriptDir & "\CAE-horaire.jpg", 397, 425, 230, 314) Entrernom () EndFunc Func Entrernom () While 1 GUISetState() $msg = GUIGetMsg() Select Case $msg = $button_start and GUICtrlRead($Initiales) = " Initiales / Initials" Erreur () Case $msg = $button_start and GUICtrlRead($Initiales) <> " Initiales / Initials" _FileWriteLog(@ScriptDir & "\Internet.log","Initiales : " & GUICtrlRead($Initiales)) ExitLoop EndSelect WEnd GUIDelete("blocked") Compteur() EndFunc Func erreur() MsgBox(262144, "Erreur", "Entrez vos initiales / Enter youre initials") Entrernom () EndFunc Func Compteur() $Rapide = 0 $cout = 0.75 GuiCreate("compteur", 120, 29, 0, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) $coutpresent = GUICtrlCreateLabel (Round($cout, 2) & " $ + taxes", 0, 0, 120, 17) $button_stop = GUICtrlCreateButton ("Terminer", 0, 12, 120, 17) GUISetState () While 1 $Rapide = $Rapide + 1 Sleep (50) $msg = GUIGetMsg() Select Case $Rapide = 180 ExitLoop Case $msg = $button_stop GUIDelete ("compteur") _FileWriteLog(@ScriptDir & "\Internet.log", "-=| Prix : " & Round($cout, 2) & "$ |=-") prix () EndSelect WEnd Do $cout = $cout + 0.01 $msg = GUIGetMsg() GUICtrlSetData ($coutpresent, Round($cout, 2) & " $ + taxes") Sleep (120) Until $msg = $button_stop GUIDelete ("compteur") _FileWriteLog(@ScriptDir & "\Internet.log", "-=| Prix : " & Round($cout, 2) & "$ |=-") Prix () EndFunc Func Prix () MsgBox (262144, "Prix / Price", "Cout / Cost :" & Round($cout,2) & " $ + taxes") Bloquage () EndFunc If you find anything not working just tell me please so I can fix it. Thanks for all help, BeZ
azeazezar Posted August 25, 2006 Posted August 25, 2006 Wow Azeazezar you really don't understand. And I don't like how you just post a line saying "easy", thinking that you are better than other. so:Where did i say it was easy?, How would you know wat i'm thinking?I was only trying to help.... 1: i suck at scriptingThats wy i suggested something simpler... 2: the client has to see his time on the screenYour current script takes care of that. 3: it wouldnt be more simple to send myself an email, plus the time it requires to receive it and open outlook on my super slow work computerWho said you have to use outlook? there are faster email clients...,take a look here. 4: with a log file, i can easily map a shortcut on my desktop to itSure, you can do that as well, i was just posting an alternative. ty, BeZ
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