J4YP33
Joined: 13 May 2008 Posts: 5
|
Posted: Wed May 14, 2008 3:42 am Post subject: suspend within a function |
|
|
hi guys, i am trying to improve on my 'leetspeaker' program. This is a small chunk of the 500 line code.
| Code: | ;random function
random(){
random, rand, 1, 4
return rand
}
;lowercase function to prevent hotkey from calling itself
lowercase(x){
suspend, on
send %x%
suspend,off
}
;a hotkey
a::
rand := random()
if(rand=1){
suspend, on
send, a
suspend,off
}
else if(rand=2){
send, A
}
else if(rand=3){
send, 4
}
else{
send, @
}
return
;b hotkey
b::
rand := random()
if(rand=1){
suspend, on
send, b
suspend,off
}
else if(rand=2){
send, B
}
else if(rand=3){
send, B
}
else{
send, 8
}
return |
As you probably can see, the lowercase functions prevents the hotkey from calling itself. for example, if 'a' is typed and the result of rand is 1, the lowercase function will kick in, suspending the script and outputting 'a' so that 'a' will not call itself. after 'a' is outputted, the script is then resumed. the logic is there, but i cant seem to figure why it isnt working.
below is some sample output:
a: 4@AAA@@@@44@@A4AA4AA44A@A@A@@444A4@AA@@A4A@@@A4
b: 8BB8BBBB8BB88BBBBBBBB8B88B8B88BB8B88BB8BBBBB88BBB88B
'a' and 'b' are never outputted. someone please help!!! |
|