Jump to content
Sign in to follow this  
antanee52

I'm somewhat new to AutoIt and Programming...

Recommended Posts

antanee52

I asked for help in the General forum about making a script, I got one useful answer and edited it to learn what I need by myself. I could really use a hand with creating, or at least a head start, for making an interface for this program.

Basically it's a login tool. It types in your passwords (saving up to 4) for a video game.

How do I make an interface for it? What I want is this... Nothing special but... Just a form with 8 boxes...

Account 1: (Text Imput Box)

Password 1: (Text Imput Box)

Account 2: (Text Imput Box)

Password 2: (Text Imput Box)

Account 3: (Text Imput Box)

Password 3: (Text Imput Box)

Account 4: (Text Imput Box)

Password 4: (Text Imput Box)

Then save each imput box as a variable, such as whatever you type in Account 1 is imputed as $Acct1, and Password 1 would be imputed into the script as $Pass1, and all that stuff.

I have that prog, Koda, I'm working on learning by the way.

I'm sure that's very easy to acomplish, that way no one would need to edit the script every time you had new info.

Heres what may be hard... I want it to save it, one way or another, so that you dont have to type in your account names and passwords every time... because that would (obviously) be pretty pointless lol.

Thanks so much in advance! I really appretiate it, as I am young and just learning! :-)

Share this post


Link to post
Share on other sites
antanee52

Okay scratch that I learned all that stuff. Heres my new issue.

I have a Form Box made and everything.

Basically my variables are this...

$Send

$Send2

$Send3

$Send4

$Send5

$Send6

$Send7

$Send8

... My form has an imput box for each of those values.

What I need to know is how to make the script read what was typed in the forum... so If I type (in the forum) acct1 where the ($Send) imput is and pass1 where the ($Send2) imput is... how do I get it to use that in the script?

Sorry if thats hard to understand lol. I'm trying to figure this out as I type.

Share this post


Link to post
Share on other sites
enaiman

If you're using SciTe as your editor - press F1 to open the help file.

Look for GUICtrlRead - this will solve your problem.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
Generator

Also you should use stringreplace to encrypt your password else if you save it in an ini anybody can just read it.

Share this post


Link to post
Share on other sites
antanee52

Still isnt working. I didn't wanna release the script to this because I'm that kinda person, but I think it's nessicary as it's my first real project.

Heres what I've got...

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\desktop\koda_2007.05.08[1]\forms\multilogger.kxf
$MultiLogger = GUICreate("MultiLogger", 553, 447, 270, 135)
$Send = GUICtrlCreateInput("", 80, 72, 137, 21)
$Account1 = GUICtrlCreateLabel("Account1", 80, 48, 50, 17)
$Password1 = GUICtrlCreateLabel("Password1", 344, 48, 56, 17)
$Send2 = GUICtrlCreateInput("", 344, 72, 153, 21)
$Account2 = GUICtrlCreateLabel("Account2", 80, 128, 50, 17)
$Password2 = GUICtrlCreateLabel("Password2", 344, 128, 56, 17)
$Account3 = GUICtrlCreateLabel("Account3", 80, 200, 50, 17)
$Password3 = GUICtrlCreateLabel("Password3", 344, 200, 56, 17)
$Send3 = GUICtrlCreateInput("", 80, 152, 137, 21)
$Send4 = GUICtrlCreateInput("", 344, 152, 153, 21)
$Send5 = GUICtrlCreateInput("", 80, 224, 137, 21)
$Send6 = GUICtrlCreateInput("", 344, 224, 153, 21)
$Account4 = GUICtrlCreateLabel("Account4", 80, 272, 50, 17)
$Password4 = GUICtrlCreateLabel("Password4", 344, 272, 56, 17)
$Send7 = GUICtrlCreateInput("", 80, 296, 137, 21)
$Send8 = GUICtrlCreateInput("", 344, 296, 153, 21)
$ShortcutKey = GUICtrlCreateLabel("ShortcutKey", 8, 32, 62, 17)
$F5 = GUICtrlCreateLabel("F5", 24, 72, 16, 17)
$F6 = GUICtrlCreateLabel("F6", 24, 128, 16, 17)
$F7 = GUICtrlCreateLabel("F7", 24, 192, 16, 17)
$F8 = GUICtrlCreateLabel("F8", 24, 264, 16, 17)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\Desktop\WoWLog.jpg", 192, 336, 177, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd



;;Login Info;;
$Name = "World of Warcraft";Leave this alone
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


HotKeySet("{F5}", "Account1")
HotKeySet("{F6}", "Account2")
HotKeySet("{F7}", "Account3")
HotKeySet("{F8}", "Account4")

While 1
    Sleep(100)
WEnd

Func Account1 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send))
        Send("{TAB}")
        Send(GUICtrlRead($Send2))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account2 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send3))
        Send("{TAB}")
        Send(GUICtrlRead($Send4))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account3 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send5))
        Send("{TAB}")
        Send(GUICtrlRead($Send6))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account4 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send7))
        Send("{TAB}")
        Send(GUICtrlRead($Send8))
        Send("{Enter}")
    EndIf    
    
EndFunc

I had it working without the GUI, but you have to manually edit the script for more information.

How do I get it to enter the data in the GUI? And how would I get it to save that so you dont have to type it every time you boot? Thanks so much! :)

Share this post


Link to post
Share on other sites
antanee52

Been about 24 hours. Bump for assistance?

Share this post


Link to post
Share on other sites
enaiman

I don't know exactly what's the problem but your script has 2 while loops.

My advice would be to change your GUI to OnEvent mode (it looks like you want to always wait in a loop) and to get rid of the first While.

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\desktop\koda_2007.05.08[1]\forms\multilogger.kxf
$MultiLogger = GUICreate("MultiLogger", 553, 447, 270, 135)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
$Send = GUICtrlCreateInput("", 80, 72, 137, 21)
$Account1 = GUICtrlCreateLabel("Account1", 80, 48, 50, 17)
$Password1 = GUICtrlCreateLabel("Password1", 344, 48, 56, 17)
$Send2 = GUICtrlCreateInput("", 344, 72, 153, 21)
$Account2 = GUICtrlCreateLabel("Account2", 80, 128, 50, 17)
$Password2 = GUICtrlCreateLabel("Password2", 344, 128, 56, 17)
$Account3 = GUICtrlCreateLabel("Account3", 80, 200, 50, 17)
$Password3 = GUICtrlCreateLabel("Password3", 344, 200, 56, 17)
$Send3 = GUICtrlCreateInput("", 80, 152, 137, 21)
$Send4 = GUICtrlCreateInput("", 344, 152, 153, 21)
$Send5 = GUICtrlCreateInput("", 80, 224, 137, 21)
$Send6 = GUICtrlCreateInput("", 344, 224, 153, 21)
$Account4 = GUICtrlCreateLabel("Account4", 80, 272, 50, 17)
$Password4 = GUICtrlCreateLabel("Password4", 344, 272, 56, 17)
$Send7 = GUICtrlCreateInput("", 80, 296, 137, 21)
$Send8 = GUICtrlCreateInput("", 344, 296, 153, 21)
$ShortcutKey = GUICtrlCreateLabel("ShortcutKey", 8, 32, 62, 17)
$F5 = GUICtrlCreateLabel("F5", 24, 72, 16, 17)
$F6 = GUICtrlCreateLabel("F6", 24, 128, 16, 17)
$F7 = GUICtrlCreateLabel("F7", 24, 192, 16, 17)
$F8 = GUICtrlCreateLabel("F8", 24, 264, 16, 17)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\Desktop\WoWLog.jpg", 192, 336, 177, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


;;Login Info;;
$Name = "World of Warcraft";Leave this alone
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


HotKeySet("{F5}", "Account1")
HotKeySet("{F6}", "Account2")
HotKeySet("{F7}", "Account3")
HotKeySet("{F8}", "Account4")

While 1
    Sleep(100)
WEnd

Func Close()
    Exit
EndFunc

Func Account1 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send))
        Send("{TAB}")
        Send(GUICtrlRead($Send2))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account2 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send3))
        Send("{TAB}")
        Send(GUICtrlRead($Send4))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account3 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send5))
        Send("{TAB}")
        Send(GUICtrlRead($Send6))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account4 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send7))
        Send("{TAB}")
        Send(GUICtrlRead($Send8))
        Send("{Enter}")
    EndIf    
    
EndFunc

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
antanee52

I don't know exactly what's the problem but your script has 2 while loops.

My advice would be to change your GUI to OnEvent mode (it looks like you want to always wait in a loop) and to get rid of the first While.

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\desktop\koda_2007.05.08[1]\forms\multilogger.kxf
$MultiLogger = GUICreate("MultiLogger", 553, 447, 270, 135)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
$Send = GUICtrlCreateInput("", 80, 72, 137, 21)
$Account1 = GUICtrlCreateLabel("Account1", 80, 48, 50, 17)
$Password1 = GUICtrlCreateLabel("Password1", 344, 48, 56, 17)
$Send2 = GUICtrlCreateInput("", 344, 72, 153, 21)
$Account2 = GUICtrlCreateLabel("Account2", 80, 128, 50, 17)
$Password2 = GUICtrlCreateLabel("Password2", 344, 128, 56, 17)
$Account3 = GUICtrlCreateLabel("Account3", 80, 200, 50, 17)
$Password3 = GUICtrlCreateLabel("Password3", 344, 200, 56, 17)
$Send3 = GUICtrlCreateInput("", 80, 152, 137, 21)
$Send4 = GUICtrlCreateInput("", 344, 152, 153, 21)
$Send5 = GUICtrlCreateInput("", 80, 224, 137, 21)
$Send6 = GUICtrlCreateInput("", 344, 224, 153, 21)
$Account4 = GUICtrlCreateLabel("Account4", 80, 272, 50, 17)
$Password4 = GUICtrlCreateLabel("Password4", 344, 272, 56, 17)
$Send7 = GUICtrlCreateInput("", 80, 296, 137, 21)
$Send8 = GUICtrlCreateInput("", 344, 296, 153, 21)
$ShortcutKey = GUICtrlCreateLabel("ShortcutKey", 8, 32, 62, 17)
$F5 = GUICtrlCreateLabel("F5", 24, 72, 16, 17)
$F6 = GUICtrlCreateLabel("F6", 24, 128, 16, 17)
$F7 = GUICtrlCreateLabel("F7", 24, 192, 16, 17)
$F8 = GUICtrlCreateLabel("F8", 24, 264, 16, 17)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\Desktop\WoWLog.jpg", 192, 336, 177, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;;Login Info;;
$Name = "World of Warcraft";Leave this alone
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HotKeySet("{F5}", "Account1")
HotKeySet("{F6}", "Account2")
HotKeySet("{F7}", "Account3")
HotKeySet("{F8}", "Account4")

While 1
    Sleep(100)
WEnd

Func Close()
    Exit
EndFunc

Func Account1 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send))
        Send("{TAB}")
        Send(GUICtrlRead($Send2))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account2 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send3))
        Send("{TAB}")
        Send(GUICtrlRead($Send4))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account3 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send5))
        Send("{TAB}")
        Send(GUICtrlRead($Send6))
        Send("{Enter}")
    EndIf    
    
EndFunc

Func Account4 ()
    If WinActive($Name) = 1 Then
        Send(GUICtrlRead($Send7))
        Send("{TAB}")
        Send(GUICtrlRead($Send8))
        Send("{Enter}")
    EndIf    
    
EndFunc
Wow thanks alot that did it! Now two more things.... MOST IMPORTANTLY... Is there a way to save the data that is put in those boxes to a file? That way people don't have to type it in each time they use it, else there'd be no point of using it you might as well type it by hand lol.

Also is there a way to add a button to like minimize it? For example... you type in your password, then click a button labeled "Okay" (or whatever) then the program minimizes to tray? That part is not as important, the first thing is what I really need help on heh.

Share this post


Link to post
Share on other sites
enaiman

Is there a way to save the data that is put in those boxes to a file? That way people don't have to type it in each time they use it, else there'd be no point of using it you might as well type it by hand lol.

There is a command "specially written" :) for that: IniWrite - and IniRead to read those values - you can find them in the help.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
Zedna

Also is there a way to add a button to like minimize it? For example... you type in your password, then click a button labeled "Okay" (or whatever) then the program minimizes to tray? That part is not as important, the first thing is what I really need help on heh.

Look at my NET SEND

I'm using simple "minimize to tray" trick there.

Share this post


Link to post
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
Sign in to follow this  

×