bogQ Posted October 29, 2008 Share Posted October 29, 2008 (edited) im on v3.2.12.1 HotKeySet("{1}", "k1") Global $key1 = "s" While 1 key() WEnd Func key() If $key1 <> "s" Then $key1 += 1 EndIf ToolTip($key1&" ") EndFunc Func k1() $key1 = -1 EndFunc on tooltip i get 0 all the time :/ can someone comfirm this? or m i dooing something wrong? Edited October 29, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
LarryDalooza Posted October 29, 2008 Share Posted October 29, 2008 change {1} to 1 AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2008 Author Share Posted October 29, 2008 change {1} to 1tryed that i still get 0 on tooltipits like he only one time try "if" event TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2008 Author Share Posted October 29, 2008 (edited) sry 4 duble post when i done Func k1() $key1 = "" EndFunc its working, but not with $key1 = -1 dont get it, can someone explaind diffrance? and now this isnt working HotKeySet("1", "k1") Dim $key1 = "s" While 1 key() WEnd Func key() If Not $key1 = "s" Then $key1 += 1 EndIf ToolTip($key1&" ") EndFunc Func k1() $key1 = "" EndFunc what m i dooing wrong Edited October 29, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
trancexx Posted October 29, 2008 Share Posted October 29, 2008 sry 4 duble post when i done Func k1() $key1 = "" EndFunc its working, but not with $key1 = -1 dont get it, can someone explaind diffrance? and now this isnt working HotKeySet("1", "k1") Dim $key1 = "s" While 1 key() WEnd Func key() If Not $key1 = "s" Then $key1 += 1 EndIf ToolTip($key1&" ") EndFunc Func k1() $key1 = "" EndFunc what m i dooing wrongYou are mixing strings and numbers, making loop too tight, changing more than one parameter at once... Your first post code works just fine when do what LarryDalooza said. - if you put $key1 = -1, all works well but you don't see tooltip with "-1" because it's changed to "0" before you can register it - If Not $key1 = "s" Then - that's not right Try this: HotKeySet("1", "k1") Dim $key1 = "s" While 1 Sleep(10) key() WEnd Func key() If Not ($key1 = "s") Then; If $key1 <> "s" Then $key1 += 1 EndIf ToolTip($key1&" ") EndFunc Func k1() $key1 = -77 EndFunc Do you know why does it stop on "0"? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
LarryDalooza Posted October 29, 2008 Share Posted October 29, 2008 I had no interest in what you were trying to do. I had just seen a syntax problem. Maybe if you described your goal, you will get better answers. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2008 Author Share Posted October 29, 2008 (edited) Do you know why does it stop on "0"?i dont know its 0 all the time only working when the data on var on func is more than 0 or ""Func k1()$key1 = 1EndFuncFunc k1()$key1 =""EndFuncmy goal is that $key1 need to count from -10000 to +10000 (or maby lower and hier) so i cat set Global $key1 = "NUMBER" it ned to b a letterand i still dono why its stoping at 0 maby it can b solved if i write if = 0 then var = var +1 but still i dono is this some kinde of bug or its mented to b like that?sry 4 edit my kboard is kinda crazzy Edited October 29, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
trancexx Posted October 29, 2008 Share Posted October 29, 2008 i dont know its 0 all the time only working when the data on var on func is more than 0 or "" Func k1() $key1 = 1 EndFunc Func k1() $key1 ="" EndFunc my goal is that $key1 need to count from -10000 to +10000 (or maby lower and hier) so i cat set Global $key1 = "NUMBER" it ned to b a letter and i still dono why its stoping at 0 maby it can b solved if i write if = 0 then var = var +1 but still i dono is this some kinde of bug or its mented to b like that? sry 4 edit my kboard is kinda crazzyWhat bug? No bug. HotKeySet("1", "k1") Dim $key1 = "s" While 1 Sleep(10) key() WEnd Func key() If IsNumber($key1) Then $key1 += 1 EndIf ToolTip($key1 & " ") EndFunc Func k1() $key1 = -1000 EndFunc ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2008 Author Share Posted October 29, 2008 (edited) r you telling me that "s" is = 0? :/ - numbers and + <> "s" but the 0 = "s" is kinda crazzy when you look that "" <> "s" im confused heare (im not telling that you didnt help with your sugestions and that it isnt working, but i still dont understand why s = 0 but not = -1 or = 1 why i get this only on 0 but not on other numbers ) Edited October 29, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
trancexx Posted October 29, 2008 Share Posted October 29, 2008 r you telling me that "s" is = 0? :/ - numbers and + <> "s" but the 0 = "s" is kinda crazzy when you look that "" <> "s" im confused heare (im not telling that you didnt help with your sugestions and that it isnt working, but i still dont understand why s = 0 but not = -1 or = 1 why i get this only on 0 but not on other numbers )No, I'm telling you that 1 + "s" = 1 Here: $a = 345 $b = "some string, even emty one" MsgBox(0,"",$a + $B) That is expected. It's not a bug or whatever. Ti si bog? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2008 Author Share Posted October 29, 2008 No, I'm telling you that 1 + "s" = 1 Here: $a = 345 $b = "some string, even emty one" MsgBox(0,"",$a + $B) That is expected. It's not a bug or whatever. Ti si bog? not working $b = "some string, even emty one" $a = 0 If $b <> $a Then MsgBox(0,"",$a + $b) working $b = "some string, even emty one" $a = "0" If $b <> $a Then MsgBox(0,"",$a + $b) working $b = "some string, even emty one" $a = "-1" If $b <> $a Then MsgBox(0,"",$a + $b) working $b = "some string, even emty one" $a = -1 If $b <> $a Then MsgBox(0,"",$a + $b) every time on original script i changed the "s" before compareing valyes, it seems that when i predefine $var it still holds the string mark on it or something else when its set to 0 valye :/ i maby dont like the result and i probably ned to reedit alot things now in script :/ ty 4 the support (trancexx: ovo je bre nepravilno, nemoj da zezas, ne moze i minus jedan i nula da daju razlicite rezultate na uporedjivanju ispravnosti, al aj sad nema veze, mozda sam lepo trebao da pocnem ovo cudo u ceu da radim, malo bi se vise namucio ali me nebi jedna nepravilna glupost kocila ceo dan i kostala prepravke svega, bdw ako imas nesto da dodas pisi pm ) TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
trancexx Posted October 30, 2008 Share Posted October 30, 2008 You are really confusing yourself with difference between numbers and strings.When AutoIt's engine meets mathematical operator then that what is left and right of it is converted to numbers and operated-on afterward.$a = 1 $b = 2 $c = $a + $b ConsoleWrite($c & @CRLF)We will get 3. Process goes something like this:1. introducing $a2. assigning $a with number 13. introducing $b4. assigning $b with number 25. introducing $c6. recognising mathematical operator +7. converting $a to number $a = Number($a)8. converting $b to number $b = Number($9. adding two numbers10. assigning $c with calculated number 11. etc...Try converting some strings to numbers.Now, for "<>". What is that?That is comparison operator. You can use it both for strings and for numbers, but has somewhere different meaning (will explain).Cause of this is existance of operator "==" (identical).Examine this:$a = 1 $b = 2 $c = $a + $b If $c <> 5 Then ConsoleWrite($c & @CRLF)and this:$a = 1 $b = 2 $c = $a + $b If Not($c = 5) Then ConsoleWrite($c & @CRLF)That is how you see that. And that is ok, but only for numbers.The other code should be:$a = 1 $b = 2 $c = $a + $b If Not($c == 5) Then ConsoleWrite($c & @CRLF)And that is making all this mess for you. <> means Not =Thing with numbers is that equal sign (=) has the same effect as the identical sign (==). Knowing this you can see what is the problem with this peace of code that you wrote. If there is chance that there will be strings involved in calculations then it's wrong to use "<>" creating implications.Not this:If $b <> $a Then MsgBox(0,"",$a + $b)but this:If Not ($b == $a) Then MsgBox(0,"",$a + $b)For your case:HotKeySet("1", "k1") Dim $key1 = "s" While 1 Sleep(10) key() WEnd Func key() If Not ($key1 == "s") Then $key1 += 1 EndIf ToolTip($key1 & " ") EndFunc Func k1() $key1 = -77 EndFuncSo, when I asked you "Do you know why does it stop on 0?" you should said "Yea, it's because I should be using == instead of =". ♡♡♡ . eMyvnE 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