Paulie Posted April 29, 2006 Share Posted April 29, 2006 Why is this not working? I can not figure this out, I keep getting a badly formated func statement error expandcollapse popup;~~~Declare Variables~~~ Global $on = 1 ;~~~ ;~~~Running Text Editor~~~ Run("notepad.exe") ;~~~ ;~~Required Function~~~ While $on = 0 ToolTip(0,0, "Binary Is not On") Sleep(1) Wend While $on = 1 ToolTip(0,0, "Binary Is On") Sleep(1) Wend ;~~~ ;~~Declare Hotkeys~~~ HotkeySet("{HOME}", "On") HotkeySet("{END}", "Off") HotkeySet("1", "1") HotkeySet("2", "2") HotkeySet("3", "3") HotkeySet("4", "4") HotkeySet("5", "5") HotkeySet("6", "6") HotkeySet("7", "7") HotkeySet("8", "8") HotkeySet("9", "9") HotkeySet("0", "0") HotkeySet("a", "a") HotkeySet("b", "b") HotkeySet("c", "c") HotkeySet("d", "d") HotkeySet("e", "e") HotkeySet("f", "f") HotkeySet("g", "g") HotkeySet("h", "h") HotkeySet("i", "i") HotkeySet("j", "j") HotkeySet("k", "k") HotkeySet("l", "l") HotkeySet("m", "m") HotkeySet("n", "n") HotkeySet("o", "o") HotkeySet("p", "p") HotkeySet("q", "q") HotkeySet("r", "r") HotkeySet("s", "s") HotkeySet("t", "t") HotkeySet("u", "u") HotkeySet("v", "v") HotkeySet("w", "w") HotkeySet("x", "x") HotkeySet("y", "y") HotkeySet("z", "z") ;~~~Set Fuctions~~~ Func On() If $on = 0 then $on = 1 EndIf EndFunc ;~~~ Func Off() If $on = 1 then $on = 0 EndIf EndFunc ;~~~ Func 1() Send("0001") EndFunc ;~~~ Func 2() Send("0010") EndFunc ;~~~ Func 3() Send("0011") EndFunc ;~~~ Func 4() Send("0100") EndFunc ;~~~ Func 5() Send("0101") EndFunc ;~~~ Func 6() Send("0110") EndFunc ;~~~ Func 7() Send("0111") EndFunc ;~~~ Func 8() Send("1000") EndFunc ;~~~ Func 9() Send("1001") EndFunc ;~~~ Func 0() Send("1011") EndFunc ;~~~ theres more, but the "1()" comes up bad Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 29, 2006 Share Posted April 29, 2006 cuz u cant have just a number as a fucntion must have somethign else in there i woud recomend an _ , and why do you have stuff turning on and off ? its not even doing anything cuz when your sending with functions its not even check if anythings on or off Link to comment Share on other sites More sharing options...
Paulie Posted April 29, 2006 Author Share Posted April 29, 2006 (edited) cuz u cant have just a number as a fucntion must have somethign else in there i woud recomend an _ , and why do you have stuff turning on and off ? its not even doing anything cuz when your sending with functions its not even check if anythings on or offOkay i changed all the number hotkeys and functions to have a" _" in front, but now, i get no error, but when i push the buton, it just types normally as opposed to sending the binary wats wrong with it? Edited April 29, 2006 by Paulie Link to comment Share on other sites More sharing options...
poisonkiller Posted April 29, 2006 Share Posted April 29, 2006 Think a little... You are trying to make a program, what sends numbers 0 and 1, but 0 and 1 are hotkeys, so them functions are called. In 0 and 1 functions are some 0 and 1 too, so... Link to comment Share on other sites More sharing options...
BillLuvsU Posted April 29, 2006 Share Posted April 29, 2006 Try disabling the hotkeys, sending, and then reenabeling them. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Paulie Posted April 29, 2006 Author Share Posted April 29, 2006 (edited) Think a little... You are trying to make a program, what sends numbers 0 and 1, but 0 and 1 are hotkeys, so them functions are called. In 0 and 1 functions are some 0 and 1 too, so...Sorry, but I don't understand Try disabling the hotkeys, sending, and then reenabeling them.how do you disable hotkeys? that doesn't make any sense to mePersonally i don't like like the way i have this layed out, because binary numbers/letters are represented individualy, there is no way to make a 2 digit number with this program, but how wold i make it work? because 15 is differnt than 1&5 so maybe i should just use a formula to do it, but whats the formula. and then i would need a diferent box to type in like the enryptor example that come with autoit.This is really ard and i need helpDoes anyne have any ideas? Edited April 29, 2006 by Paulie Link to comment Share on other sites More sharing options...
poisonkiller Posted April 29, 2006 Share Posted April 29, 2006 Disableing: HotKeySet("0") ;disables 0 Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 29, 2006 Share Posted April 29, 2006 ur hotkeys have have a 0 and a 1, so if u press for example 1 then it sends , 1000 or whatever, but ur hotkeys are also contain a 0 and 1, so when it sends 1000 in binary , its going to call function 1 then 0 then 0 then 0 Link to comment Share on other sites More sharing options...
Paulie Posted April 29, 2006 Author Share Posted April 29, 2006 ur hotkeys have have a 0 and a 1, so if u press for example 1 then it sends , 1000 or whatever, but ur hotkeys are also contain a 0 and 1, so when it sends 1000 in binary , its going to call function 1 then 0 then 0 then 0Oh i understand now,But thats not whas hapeningwhen i press 2 is types 2 not a continous streem of 000 and 001: i want it to type 010 though Link to comment Share on other sites More sharing options...
Paulie Posted April 29, 2006 Author Share Posted April 29, 2006 Alright, i've have come to a decision,im trashing this code and actually making one in GUI that when you type in, it enrypts and derypts what you type.the hotkey thing in this one wasn't working out for me, it was just getting harder and harder as i went farther, and having to change 70 hotkeys and functions was getting oldsorry if you actualy contributed help and ideas to tis code, but i dont think its going to work(if you can make it work PLZ post the code)Now i have one question (there will most definatly be more for this program, as it is one of my first complicated not "hello world" GUIs)Queston:You have a string of numbers like the following;(This is "2 2 2 2" in binary)0010 0010 0010 0010How can I have autoit read the string and find and identify the occureces of the 1s in it, and what place they're in so it can convert it to english? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 29, 2006 Share Posted April 29, 2006 (edited) Didnt look like u were doing it correctly expandcollapse popupBinary Code A 01000001 B 01000010 C 01000011 D 01000100 E 01000101 F 01000110 G 01000111 H 01001000 I 01001001 J 01001010 K 01001011 L 01001100 M 01001101 N 01001110 O 01001111 P 01010000 Q 01010001 R 01010010 S 01010011 T 01010100 U 01010101 V 01010110 W 01010111 X 01011000 Y 01011001 Z 01011010 Letter Binary Code a 01100001 b 01100010 c 01100011 d 01100100 e 01100101 f 01100110 g 01100111 h 01101000 i 01101001 j 01101010 k 01101011 l 01101100 m 01101101 n 01101110 o 01101111 p 01110000 q 01110001 r 01110010 s 01110011 t 01110100 u 01110101 v 01110110 w 01110111 x 01111000 y 01111001 z 01111010 Edited April 29, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
poisonkiller Posted April 30, 2006 Share Posted April 30, 2006 (edited) Took 5 minutes: expandcollapse popup;~~~Declare Variables~~~ Global $on = 1 ;~~~ ;~~~Running Text Editor~~~ Run("notepad.exe") ;~~~ ;~~Declare Hotkeys~~~ HotkeySet("{HOME}", "On") HotkeySet("{END}", "Off") HotkeySet("1", "_1") HotkeySet("2", "_2") HotkeySet("3", "_3") HotkeySet("4", "_4") HotkeySet("5", "_5") HotkeySet("6", "_6") HotkeySet("7", "_7") HotkeySet("8", "_8") HotkeySet("9", "_9") HotkeySet("0", "_0") #cs HotkeySet("a", "a") HotkeySet("b", "b") HotkeySet("c", "c") HotkeySet("d", "d") HotkeySet("e", "e") HotkeySet("f", "f") HotkeySet("g", "g") HotkeySet("h", "h") HotkeySet("i", "i") HotkeySet("j", "j") HotkeySet("k", "k") HotkeySet("l", "l") HotkeySet("m", "m") HotkeySet("n", "n") HotkeySet("o", "o") HotkeySet("p", "p") HotkeySet("q", "q") HotkeySet("r", "r") HotkeySet("s", "s") HotkeySet("t", "t") HotkeySet("u", "u") HotkeySet("v", "v") HotkeySet("w", "w") HotkeySet("x", "x") HotkeySet("y", "y") HotkeySet("z", "z") #ce ;~~~Set Fuctions~~~ ;~~Required Function~~~ While 1 If $on = 1 Then ToolTip("Binary Is On", 0, 0) Else ToolTip("Binary Is Off", 0, 0) EndIf Sleep(10) Wend ;~~~ Func On() $on = 1 EndFunc ;~~~ Func Off() $on = 0 EndFunc ;~~~ Func _1() HotKeySet("0") HotKeySet("1") Send("0001") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _2() HotKeySet("0") HotKeySet("1") Send("0010") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _3() HotKeySet("0") HotKeySet("1") Send("0011") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _4() HotKeySet("0") HotKeySet("1") Send("0100") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _5() HotKeySet("0") HotKeySet("1") Send("0101") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _6() HotKeySet("0") HotKeySet("1") Send("0110") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _7() HotKeySet("0") HotKeySet("1") Send("0111") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _8() HotKeySet("0") HotKeySet("1") Send("1000") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _9() HotKeySet("0") HotKeySet("1") Send("1001") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Func _0() HotKeySet("0") HotKeySet("1") Send("1011") HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc ;~~~ Worked on me... Edited April 30, 2006 by poisonkiller Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 30, 2006 Moderators Share Posted April 30, 2006 (edited) I would think it would look more like this:expandcollapse popup;~~~Declare Variables~~~ Global $on = 1, $BinarySetting = 1 ;~~~ ;~~~Running Text Editor~~~ Run("notepad.exe") ;~~~ ;~~Declare Hotkeys~~~ HotkeySet("{HOME}", "On_Off") For $i = 0 To 9 HotkeySet($i, "_" & $i) Next #cs ;a to z For $x = 97 To 122 $Insert = Chr($x) HotkeySet($Insert, $Insert) Next #ce While 1 If $on Then ToolTip("Binary Is On", 0, 0) If Not $BinarySetting Then _ActivateAllHotKeys() $BinarySetting = Not $BinarySetting EndIf ElseIf Not $on And $BinarySetting Then ToolTip("Binary Is Off", 0, 0) _TurnOffAllHotkeys() $BinarySetting = Not $BinarySetting EndIf Sleep(10) Wend ;~~~ Func On_Off() $on = Not $on EndFunc ;~~~ Func _TurnOffAllHotkeys() For $i = 0 To 9 HotKeySet($i) Next EndFunc Func _ActivateAllHotkeys() For $i = 0 To 9 HotkeySet($i, "_" & $i) Next EndFunc Func _TurnOffHotkey_0_1() HotKeySet("0") HotKeySet("1") EndFunc Func _ActivateHotkey_0_1() HotKeySet("0", "_0") HotKeySet("1", "_1") EndFunc Func _1() _TurnOffHotkey_0_1() Send("0001") _ActivateHotkey_0_1() EndFunc ;~~~ Func _2() _TurnOffHotkey_0_1() Send("0010") _ActivateHotkey_0_1() EndFunc ;~~~ Func _3() _TurnOffHotkey_0_1() Send("0011") _ActivateHotkey_0_1() EndFunc ;~~~ Func _4() _TurnOffHotkey_0_1() Send("0100") _ActivateHotkey_0_1() EndFunc ;~~~ Func _5() _TurnOffHotkey_0_1() Send("0101") _ActivateHotkey_0_1() EndFunc ;~~~ Func _6() _TurnOffHotkey_0_1() Send("0110") _ActivateHotkey_0_1() EndFunc ;~~~ Func _7() _TurnOffHotkey_0_1() Send("0111") _ActivateHotkey_0_1() EndFunc ;~~~ Func _8() _TurnOffHotkey_0_1() Send("1000") _ActivateHotkey_0_1() EndFunc ;~~~ Func _9() _TurnOffHotkey_0_1() Send("1001") _ActivateHotkey_0_1() EndFunc ;~~~ Func _0() _TurnOffHotkey_0_1() Send("1011") _ActivateHotkey_0_1() EndFunc ;~~~ Edited April 30, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Paulie Posted April 30, 2006 Author Share Posted April 30, 2006 For $x = 97 To 122 $Insert = Chr($x) HotkeySet($Insert, $Insert)NextIncredible, Well I learned somthing today Anyway, WOW!, these scripts are genious, I am SO glad i belong to this forum Thanks very much everyone,now i understand. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 30, 2006 Moderators Share Posted April 30, 2006 Incredible, Well I learned somthing today Anyway, WOW!, these scripts are genious, I am SO glad i belong to this forum Thanks very much everyone,now i understand.Just FYI, the 97 to 122 was one way to do it. If your lazy and don't feel like looking it up, then you can always do:For $x = Asc('a') To Asc('z') $Insert = Chr($x) HotkeySet($Insert, $Insert) Next I find sometimes I do that when in a rush. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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