Jump to content

Looping function...?


Recommended Posts

I think I've run into this before but I forgot the answer... I made a little program to enter my passwords (I have shortcut keys on my mouse) but whenever I use it, it sends only the middle two letters and does it continuosly til an error comes up about recursive lines or something, I trie shoving an do...until loop in there but noting will stop it...

HotKeySet("1","a1")
HotKeySet("2","a2")
HotKeySet("3","a3")
HotKeySet("4","a4")
$1=1
ToolTip("1 - Regular" & @CRLF & "2 - Myspace" & @CRLF & "3 - Yahoo!" & @CRLF & "4 - Other")
    Sleep(15000)
Func a1()
    Do
    Send("password")
    $1 = $1 + 1
    Until $1 = 2
    Exit
EndFunc
Func a2()
    Do
    Send("password")
    $1 = $1 + 1
    Until $1 = 2
Exit
EndFunc
Func a3()
    Do
    Send("password")
    $1 = $1 + 1
    Until $1 = 2
Exit
EndFunc
Func a4()
    Do
    Send("password")
        $1 = $1 + 1
    Until $1 = 2
    Exit
EndFunc

Wuhdd i do wrong? I find it odd that I can't spot anything of this tiny script... it makes me mad....

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Well, the first time I did this it had niether the loop nor the exit, but it kept looping, so I put the exit in there, and it was STILL looping, so I put a loop that would stop it after one run.. but its STILL looping, I cant stop it! and its frustrating me because I'd have to bet its right infront of me...

and its not supposed to go into another loop, I only want it to enter a password once, then close, so it can be restarted when needed... thats why I had the variable reset to 1 at the beginning

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

This makes sense to me:

HotKeySet("1","a1")
HotKeySet("2","a2")
HotKeySet("3","a3")
HotKeySet("4","a4")

ToolTip("1 - Regular" & @CRLF & "2 - Myspace" & @CRLF & "3 - Yahoo!" & @CRLF & "4 - Other")

Sleep(15000)

Func a1()
    Send("password")
    Exit
EndFunc

Func a2()
    Send("password")
    Exit
EndFunc

Func a3()
    Send("password")
    Exit
EndFunc

Func a4()
    Send("password")
    Exit
EndFunc

If you do not want the script to close after sending the password, just remove the Exit statements... if you don't want the script to close after 15 seconds, you can put the Sleep in a while loop...

Edited by Manadar
Link to comment
Share on other sites

well, now thats the same as my 2nd version of the script, yet if I run it it runs uncontrollably...

well, ok I just tried that script and it works perfectly, and I put a real password and it comes out to be 96969696969696... and on and on, I thought its just a problem with numbers, but when I tried 55555 it worked.... so I guess my password is just cursed huh?

with out using my real password, this one brings up another weird result, it types 96password!

HotKeySet("1","a1")
HotKeySet("2","a2")
HotKeySet("3","a3")
HotKeySet("4","a4")

ToolTip("1 - Regular" & @CRLF & "2 - Myspace" & @CRLF & "3 - Yahoo!" & @CRLF & "4 - Other")

Sleep(15000)

Func a1()
    Send("149612")
    Exit
EndFunc

Func a2()
    Send("password")
    Exit
EndFunc

Func a3()
    Send("password")
    Exit
EndFunc

Func a4()
    Send("password")
    Exit
EndFunc
Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

tsk, I just realized the problem, when it goes to type in the password, it triggers the funcion again and again and again... so how can I stop that?

EDIT: Nevermind, CTRL is your friend XD

Thanks for teh help

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...