Sign in to follow this  
Followers 0
Leprechaun

Simple GUI question.

7 posts in this topic

#1 ·  Posted (edited)

Hi I've created a Auto Login Bot, and added many features for this bot for a game I play, MapleStory. Now I want to contribute my work to a site I participate in. Thing is the script I compiled and run only runs on my password. So I wanted to create a GUI so that a person could simply insert their password in the Input Box and press the "Go!" button and it'll run the script. I tried but I couldnt manage..this is all I got so far. I've posted what I have of the Main Script and what I have of the GUI

HotKeySet("{ESC}", "Terminate")


While 1
    GameLogin()
    Sleep(1000)
    GoZapIt()
    Sleep(1000)
WEnd

;======================================================================================
; Func GameLogin()                                          Hot Key = None
;======================================================================================
Func GameLogin()
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Sleep(700)
    MouseClick("left", 419, 334, 1)
    Sleep(700)
    MouseClick("left", 454, 286, 1)
    Send("******{Enter}"); THIS IS THE PASSWORD INPUT::::::::::::
    Sleep(700)
    MouseClick("left", 163, 157, 1)
    Sleep(700)
    MouseClick("left", 492, 347, 1)
Dim $channel   
 $channel = Random(0, 8, 1)
If $channel = 0 Then MouseClick("left", 284, 431, 1)
If $channel = 1 Then MouseClick("left", 274, 400, 1)
If $channel = 2 Then MouseClick("left", 366, 334, 1)
If $channel = 3 Then MouseClick("left", 265, 364, 1)
If $channel = 4 Then MouseClick("left", 553, 305, 1)
If $channel = 5 Then MouseClick("left", 275, 332, 1)
If $channel = 6 Then MouseClick("left", 363, 304, 1)
If $channel = 7 Then MouseClick("left", 458, 305, 1);Channel 3
If $channel = 8 Then MouseClick("left", 259, 303, 1);Channel 1

    Sleep(600)
    MouseClick("left", 555, 252, 1)
    Sleep(600)
    MouseClick("left", 252, 343, 1)
    Sleep(600)
    MouseClick("left", 624, 159, 1)
    Sleep(3000)
EndFunc;==>GameLogin

;======================================================================================
; Func GoZapIt()                                            Hot Key = None
;======================================================================================
Func GoZapIt()

    Local $iMax = 70;
    Local $iCnt    ; 
    For $iCnt = 1 To $iMax
        Send("a")
        Sleep(200)
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Next
     Return
EndFunc;==>GoZapIt

;======================================================================================
; Func Terminate()                                          Hot Key = Escape
;======================================================================================
Func Terminate()                                          ; Hot Key = Escape
    MsgBox(0, "Terminating Script", "Script Name: " & @ScriptName & @LF & @LF & "Located: " & @ScriptDir & @LF & @LF & "is now Terminated")
    Exit 0
EndFunc;==>Terminate

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

GUI CODE

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("..::Cha0TiC::..", 272, 86,(@DesktopWidth-272)/2, (@DesktopHeight-86)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Group_1 = GuiCtrlCreateGroup("Login", 175, 3, 89, 74)
$Button_2 = GuiCtrlCreateButton("Go!", 191, 53, 58, 19)
$Input_3 = GuiCtrlCreateInput("password", 186, 25, 66, 18)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

Thanks for any help! It's very much appreciated.

Edited by Leprechaun

Share this post


Link to post
Share on other sites



Hi I've created a Auto Login Bot, and added many features for this bot for a game I play, MapleStory. Now I want to contribute my work to a site I participate in. Thing is the script I compiled and run only runs on my password. So I wanted to create a GUI so that a person could simply insert their password in the Input Box and press the "Go!" button and it'll run the script. I tried but I couldnt manage..this is all I got so far. I've posted what I have of the Main Script and what I have of the GUI

HotKeySet("{ESC}", "Terminate")
While 1
    GameLogin()
    Sleep(1000)
    GoZapIt()
    Sleep(1000)
WEnd

;======================================================================================
; Func GameLogin()                                        Hot Key = None
;======================================================================================
Func GameLogin()
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Sleep(700)
    MouseClick("left", 419, 334, 1)
    Sleep(700)
    MouseClick("left", 454, 286, 1)
    Send("******{Enter}"); THIS IS THE PASSWORD INPUT::::::::::::
    Sleep(700)
    MouseClick("left", 163, 157, 1)
    Sleep(700)
    MouseClick("left", 492, 347, 1)
Dim $channel   
 $channel = Random(0, 8, 1)
If $channel = 0 Then MouseClick("left", 284, 431, 1)
If $channel = 1 Then MouseClick("left", 274, 400, 1)
If $channel = 2 Then MouseClick("left", 366, 334, 1)
If $channel = 3 Then MouseClick("left", 265, 364, 1)
If $channel = 4 Then MouseClick("left", 553, 305, 1)
If $channel = 5 Then MouseClick("left", 275, 332, 1)
If $channel = 6 Then MouseClick("left", 363, 304, 1)
If $channel = 7 Then MouseClick("left", 458, 305, 1);Channel 3
If $channel = 8 Then MouseClick("left", 259, 303, 1);Channel 1

    Sleep(600)
    MouseClick("left", 555, 252, 1)
    Sleep(600)
    MouseClick("left", 252, 343, 1)
    Sleep(600)
    MouseClick("left", 624, 159, 1)
    Sleep(3000)
EndFunc;==>GameLogin

;======================================================================================
; Func GoZapIt()                                            Hot Key = None
;======================================================================================
Func GoZapIt()

    Local $iMax = 70;
    Local $iCnt   ; 
    For $iCnt = 1 To $iMax
        Send("a")
        Sleep(200)
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Next
     Return
EndFunc;==>GoZapIt

;======================================================================================
; Func Terminate()                                        Hot Key = Escape
;======================================================================================
Func Terminate()                                         ; Hot Key = Escape
    MsgBox(0, "Terminating Script", "Script Name: " & @ScriptName & @LF & @LF & "Located: " & @ScriptDir & @LF & @LF & "is now Terminated")
    Exit 0
EndFunc;==>Terminate

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

GUI CODE

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("..::Cha0TiC::..", 272, 86,(@DesktopWidth-272)/2, (@DesktopHeight-86)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Group_1 = GuiCtrlCreateGroup("Login", 175, 3, 89, 74)
$Button_2 = GuiCtrlCreateButton("Go!", 191, 53, 58, 19)
$Input_3 = GuiCtrlCreateInput("password", 186, 25, 66, 18)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
   ;;;
    EndSelect
WEnd
Exit

Thanks for any help! It's very much appreciated.

<{POST_SNAPBACK}>

I would make the input so it's like a regular password box, can't actually see what's being typed in.

$Input_3 = GuiCtrlCreateInput("password", 186, 25, 66, 18,$ES_PASSWORD)

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Group1
       GameLogin()
    Case $msg = $Button_2
        GoZapIt()
    Case Else
   ;;;
    EndSelect
WEnd

This should take care of sending the password they type in.

Send("{" & GuiCtrlRead($Input_3) & "Enter}"); THIS IS THE PASSWORD INPUT::::::::::::

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Alright well I added the script you helped me with. Which by the way..I thank you very much. The problem now is..after I type in the password..it will not do anything. It just doesnt do anything period. Is there a way that after I type in the password it will run the script like it's supposed to?

; AutoIt Version: 3.1.1
; Language:    English
; Script Function:  Login to game, attack, do it again
;                    Hit escape to Quit
;
; Functions
;--------------------
; Func GameLogin()
; Func GoZapIt()
; Func Terminate()


#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("..::Cha0TiC::..", 272, 86,(@DesktopWidth-272)/2, (@DesktopHeight-86)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Group_1 = GuiCtrlCreateGroup("Login", 175, 3, 89, 74)
$Button_2 = GuiCtrlCreateButton("Go!", 191, 53, 58, 19)
$Input_3 = GuiCtrlCreateInput("password", 186, 25, 66, 18,$ES_PASSWORD)

HotKeySet("{ESC}", "Terminate")


While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Group_1
      GameLogin()
    Case $msg = $Button_2
        GoZapIt()
    Case Else
  ;;;
    EndSelect
WEnd

;======================================================================================
; Func GameLogin()                                        Hot Key = None
;======================================================================================
 Func GameLogin()
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Sleep(700)
    MouseClick("left", 419, 334, 1)
    Sleep(700)
    MouseClick("left", 454, 286, 1)
    Send("{" & GuiCtrlRead($Input_3) & "Enter}"); 
    Sleep(700)
    MouseClick("left", 163, 157, 1)
    Sleep(700)
    MouseClick("left", 492, 347, 1)
Dim $channel   
 $channel = Random(0, 8, 1)
If $channel = 0 Then MouseClick("left", 284, 431, 1)
If $channel = 1 Then MouseClick("left", 274, 400, 1)
If $channel = 2 Then MouseClick("left", 366, 334, 1)
If $channel = 3 Then MouseClick("left", 265, 364, 1)
If $channel = 4 Then MouseClick("left", 553, 305, 1)
If $channel = 5 Then MouseClick("left", 275, 332, 1)
If $channel = 6 Then MouseClick("left", 363, 304, 1)
If $channel = 7 Then MouseClick("left", 458, 305, 1);Channel 3
If $channel = 8 Then MouseClick("left", 259, 303, 1);Channel 1

    Sleep(600)
    MouseClick("left", 555, 252, 1)
    Sleep(600)
    MouseClick("left", 252, 343, 1)
    Sleep(600)
    MouseClick("left", 624, 159, 1)
    Sleep(3000)
EndFunc ;==>GameLogin

;======================================================================================
; Func GoZapIt()                                            Hot Key = None
;======================================================================================
Func GoZapIt()

    Local $iMax = 70; Change this if you want to change the number of times it hits
    Local $iCnt  ; This does the counting
    For $iCnt = 1 To $iMax
        Send("a")
        Sleep(200)
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Next
     Return
EndFunc ;==>GoZapIt

;======================================================================================
; Func Terminate()                                        Hot Key = Escape
;======================================================================================
Func Terminate()                                          ; Hot Key = Escape
    MsgBox(0, "Terminating Script", "Script Name: " & @ScriptName & @LF & @LF & "Located: " & @ScriptDir & @LF & @LF & "is now Terminated")
    Exit 0
EndFunc ;==>Terminate

Share this post


Link to post
Share on other sites

Sorry, had one section incorrect

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
      GameLogin()
      GoZapIt()
    Case Else
 ;;;
    EndSelect
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I added what you said was to be fixed. Thing is I already tried that..it didnt work. This is my current code. The script opens up to GUI but when I click the "Go!" button. Nothing happens..

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("..::Cha0TiC::..", 272, 86,(@DesktopWidth-272)/2, (@DesktopHeight-86)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Group_1 = GuiCtrlCreateGroup("Login", 175, 3, 89, 74)
$Button_2 = GuiCtrlCreateButton("Go!", 191, 53, 58, 19)
$Input_3 = GuiCtrlCreateInput("password", 186, 25, 66, 18,$ES_PASSWORD)

GUISetBkColor (0xE0FFFF)
$n=GUICtrlCreatePic("AutoLoot.JPG", 0, 0, 340, 70)

HotKeySet("{ESC}", "Terminate")


While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
      GameLogin()
      GoZapIt()
    Case Else
    
   EndSelect
WEnd

;======================================================================================
; Func GameLogin()                                        Hot Key = None
;======================================================================================
 Func GameLogin()
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Sleep(700)
    MouseClick("left", 419, 334, 1)
    Sleep(700)
    MouseClick("left", 454, 286, 1)
    Send("{" & GuiCtrlRead($Input_3) & "Enter}"); 
    Sleep(700)
    MouseClick("left", 163, 157, 1)
    Sleep(700)
    MouseClick("left", 492, 347, 1)
Dim $channel   
 $channel = Random(0, 8, 1)
If $channel = 0 Then MouseClick("left", 284, 431, 1)
If $channel = 1 Then MouseClick("left", 274, 400, 1)
If $channel = 2 Then MouseClick("left", 366, 334, 1)
If $channel = 3 Then MouseClick("left", 265, 364, 1)
If $channel = 4 Then MouseClick("left", 553, 305, 1)
If $channel = 5 Then MouseClick("left", 275, 332, 1)
If $channel = 6 Then MouseClick("left", 363, 304, 1)
If $channel = 7 Then MouseClick("left", 458, 305, 1);Channel 3
If $channel = 8 Then MouseClick("left", 259, 303, 1);Channel 1

    Sleep(600)
    MouseClick("left", 555, 252, 1)
    Sleep(600)
    MouseClick("left", 252, 343, 1)
    Sleep(600)
    MouseClick("left", 624, 159, 1)
    Sleep(3000)
EndFunc ;==>GameLogin

;======================================================================================
; Func GoZapIt()                                            Hot Key = None
;======================================================================================
Func GoZapIt()

    Local $iMax = 70; Change this if you want to change the number of times it hits
    Local $iCnt  ; This does the counting
    For $iCnt = 1 To $iMax
        Send("a")
        Sleep(200)
If WinGetState("MapleStory") = 16 Then
   WinSetState("MapleStory", "", @SW_MAXIMIZE)
EndIf
    Next
     Return
EndFunc ;==>GoZapIt

;======================================================================================
; Func Terminate()                                        Hot Key = Escape
;======================================================================================
Func Terminate()                                          ; Hot Key = Escape
    MsgBox(0, "Terminating Script", "Script Name: " & @ScriptName & @LF & @LF & "Located: " & @ScriptDir & @LF & @LF & "is now Terminated")
    Exit 0
EndFunc ;==>Terminate

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Commented out some code so I could test it, missed the obvious.

Need to make sure you put the GUISetState() call in.

GUISetState()

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
      GameLogin()
      GoZapIt()
    Case Else
    
   EndSelect
WEnd

Also need to change this line so it sends the whole password, sorry:

Send(GuiCtrlRead($Input_3) & "{Enter}");
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thank you very much. It works like a charm now..=) Gafrost thanks lots for giving me your time, it's really appreciated.

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  
Followers 0