Jump to content

add more then 1 password ?


Guest AX5
 Share

Recommended Posts

Hi there !

i have made a nice script for my self and now is 1 thing left. hove do i make so i can have like 10 different passwords on my script

If $text <> "3333333" Then ;;

$Loop = 1
While $Loop = 1
    $text = InputBox("Password Required", "Please type in the password then press OK","","*")
    If @error = 1 Then
        Exit
    Else

        If $text <> "3333333" Then ;; Change password to what you want the password to be
            MsgBox(4096, "Error", "Password is incorrect. Try again")
        Else
            $Loop = 0
        EndIf
    EndIf
WEnd

If MsgBox(4,"Auto Miner V 1.8","Would you like to run Auto Miner V 1.8.?") = 7 Then Exit

HotKeySet("{ESC}", "_Exit") ; If you press ESCAPE the func. '_Exit' will be called

$TimesToRepeat = 40 ; Times to Repeat Sends mouse 293.764,1

Sleep(5000) ; Sleeps 5 seconds

While 1 ; Start loop
    For $i = 1 To $TimesToRepeat ; Start for loop
        MouseClick("right",293,764,1) ; Sends mouse 293.764,1
        Sleep(4000) ; Sleeps 4 seconds
    Next ; Stops for loop
    MouseClick("right",333,764,1) ; Sends mouse 333.764,1
    Sleep(1000) ; Sleeps 1 second
WEnd ; Stop loop

Func _Exit() ; Starts func. '_Exit'
    Exit ; Exists
EndFunc ; Stops func. '_Exit'
Edited by AX5
Link to comment
Share on other sites

I'm curious, are you wanting the ten different passwords to be linked to like different users?

[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Link to comment
Share on other sites

Just change:

If $text <> "3333333" Then ;; Change password to what you want the password to be
            MsgBox(4096, "Error", "Password is incorrect. Try again")
        Else

To:

If $text <> "3333333" And $text <> "4444444" And $text <> "5555555" Then ;; Change password to what you want the password to be
            MsgBox(4096, "Error", "Password is incorrect. Try again")
        Else

Well thats just 3 passwords but you get the idea.

Link to comment
Share on other sites

Just change:

If $text <> "3333333" Then ;; Change password to what you want the password to be
            MsgBox(4096, "Error", "Password is incorrect. Try again")
        Else

To:

If $text <> "3333333" And $text <> "4444444" And $text <> "5555555" Then ;; Change password to what you want the password to be
            MsgBox(4096, "Error", "Password is incorrect. Try again")
        Else

Well thats just 3 passwords but you get the idea.

The AND should be OR - as $text is never going to be equal to all at the same time?

2¢

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

The AND should be OR - as $text is never going to be equal to all at the same time?

No using OR would make it always true, basically he wants it to only be true if none of his 10 passwords match.

Example: IF 3333333 Does not equal 3333333 OR 3333333 Does not equal 4444444 Then Exit.

Link to comment
Share on other sites

No using OR would make it always true, basically he wants it to only be true if none of his 10 passwords match.

Example: IF 3333333 Does not equal 3333333 OR 3333333 Does not equal 4444444 Then Exit.

Or simply :

$s_pw = 333335

Switch $s_pw
    Case 333333
        MsgBox(64, "1st", 'the password is : ' & $s_pw)
    Case 444444
        MsgBox(64, "2nd", 'the password is : ' & $s_pw)
    Case 555555
        MsgBox(64, "3rd", 'the password is : ' & $s_pw)
    Case Else
        MsgBox(64, "Custom", 'the password is : ' & $s_pw)
EndSwitch

Faster and in minimum of lines

Cheers, FireFox.

Link to comment
Share on other sites

Or simply :

$s_pw = 333335

Switch $s_pw
    Case 333333
        MsgBox(64, "1st", 'the password is : ' & $s_pw)
    Case 444444
        MsgBox(64, "2nd", 'the password is : ' & $s_pw)
    Case 555555
        MsgBox(64, "3rd", 'the password is : ' & $s_pw)
    Case Else
        MsgBox(64, "Custom", 'the password is : ' & $s_pw)
EndSwitch

Faster and in minimum of lines

Cheers, FireFox.

For that to work in his program it would have to be more like:

$s_pw = InputBox("Password Required", "Please type in the password then press OK","","*")

$access = 0
Switch $s_pw
    Case 333333
        $access = 1
    Case 444444
        $access = 1
    Case 555555
        $access = 1
EndSwitch

If $access = 0 Then ;; Change password to what you want the password to be
            MsgBox(4096, "Error", "Password is incorrect. Try again")
        Else
            $Loop = 0
        EndIf

How is that less lines or faster?

why use a Switch if he is hardcoding the passwords anyway?

I just want to know because I am obviously missing something.

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...