Sign in to follow this  
Followers 0
mini

HELP How to make a Window GUI

17 posts in this topic

#1 ·  Posted (edited)

Hello guys.

I made my first code in autoit, i like like it is but its a little bit annoying to have all inputbox's poping up and configuring my program.

Sow im here to hask you guys for some direction how to make a GUI more/less like this image

Posted Image

heres my code sow you can understand more/less wht im trying to do.

; Script Start - Add your code below here

HotKeySet("{F6}", "ShowMessage")
HotKeySet("{F7}", "Fastrack")
HotKeySet("{F8}", "Terminate")

;;;; Body of program would go here ;;;;

; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
$answer = MsgBox(4, "Pre-config", "     First open Loader.ini file"& @CRLF &""& @CRLF &"           EDIT THIS PART"& @CRLF &""& @CRLF &"            SilentStartup=1"& @CRLF &""& @CRLF &"    Redirect=127.0.0.1:16000"& @CRLF &""& @CRLF &"    SAVE AND CLOSE .INI FILE"& @CRLF &""& @CRLF &"                  HotKeys"& @CRLF &""& @CRLF &"F6 - Show HotKeys"& @CRLF &"F7 - Delete temp files"& @CRLF &"F8 - EXIT Autoit"& @CRLF &""& @CRLF &"                       Run?")


; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(0, "Pre-config", "OK.  Bye!")
    Exit
EndIf

;Here you will put a vallid ID and PASS
$MESSAGE1 = InputBox("InputBox", "Type your ID!")
$message2 = InputBox("Inputbox", "Type your PASS")

TrayTip ("Info","- AS:CharName  Auto-select the character after login"& @CRLF &"- AB:1      Set To Start Bot after login"& @CRLF &"- HI     Minimize iBot window to tray",30,1)

FileWrite("iBot.Bat", InputBox ( "Write iBot Commands", "     Example:"& @CRLF &""& @CRLF &"''iBot.exe'' AS:CharName AB:1 HI"& @CRLF &""& @CRLF &"     Will create a temp file"))
FileWrite("loader.bat", InputBox ( "Write Loader.exe Path", "     Example:"& @CRLF &""& @CRLF &"''C:\Silkroad\Loader.exe''"& @CRLF &""& @CRLF &"     Will create a temp file"))

 ; Run the .Bat Files

Run("iBot.bat")
Sleep(1000)
ProcessClose("cmd.exe")
sleep(15000)
Run("Loader.bat")
sleep(15000)

;Wait for client to Run and puts client window on Top

if not WinActive( "SRO_Client" ) Then
    WinActivate( "SRO_Client" )
EndIf
;Enters ID and PASS
            Sleep(5000)
            send("{ESC 3}")
            send($MESSAGE1)
            send("{tab}")
            send($MESSAGE2)
            send("{ENTER}")

;Here it repeats and check if SRO_Client.exe is running, if its not running, it closes iBot.exe and relog 
while 1
    if not ProcessExists("sro_client.exe") Then
        ProcessClose("iBot.exe")
        Run("iBot.bat")
        ProcessClose("cmd.exe")
        ;Sleep($DELAY1)
        sleep(5000)
        Run("Loader.bat");
        ProcessClose("cmd.exe")
        Sleep(5000) 
                    if not WinActive( "SRO_Client" ) Then
                        WinActivate( "SRO_Client" )
                        Sleep(5000)
                        send("{ESC 3}")
                        send($MESSAGE1)
                        send("{tab}")
                        send($MESSAGE2)
                        send("{ENTER}")
                        
                    EndIf
                EndIf
            WEnd
            
TrayTip("Info","F6 - Show HotKeys"& @CRLF &"F7 delete temp files"& @CRLF &"F8 to terminate.",30,1)

While 1
    Sleep(100)
WEnd

;Here it will delete the .bat temp files
Func Fastrack()
    TrayTip("Deleting temp files","Deleted ^^",30,0)
     FileDelete(@ScriptDir & "\iBot.bat")
     FileDelete(@ScriptDir & "\loader.bat")

EndFunc

Func Terminate()
    TrayTip("Terminating","See you next boting time ^^",30,0)
    sleep(3000)
    Exit 0
EndFunc

Func ShowMessage()
    TrayTip("Info","F6 - Show HotKeys"& @CRLF &"F7 - delete temp files"& @CRLF &"F8 - Exit.",30,1)
EndFunc
Edited by mini

Share this post


Link to post
Share on other sites



#4 ·  Posted (edited)

Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered
GUISetState(@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()

Thats about as basic as it gets. Taken straight from the helpfile.

Mat

Edited by Mat

Share this post


Link to post
Share on other sites

Then why are you at the forums? Just go to:

C:\Program Files (x86)\AutoIt3\Examples\

and you have a whole bunch of them

1st dont take me wrong if im register for 1 or 2 days

2nd im "playing" with AutoIt for 1 or 2 days =P

3rd and last, i made some coding getting help buy the forum users and by the examples that you are pointing me to see.

Creating a GUI box its more difficult then the coding, since i cant understand it on the 1st reading.

but thx anyway.

ShellExecute (StringRegExpReplace (@AutoItExe, "\\[^\\]*?\z", "") & "\examples\GUI\Simple\")

Run that and it will take you straight to the simple GUI Examples.

Mat

Edit: Or see here: http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm

thx Mat.

Sow far i got this done

GuiCreate("iBot_Starter",200,343,516,145)
$button1=GuiCtrlCreateButton("Help",1,4,62,32)
$button2=GuiCtrlCreateButton("Start iBot Starter",12,314,175,28)
$button3=GuiCtrlCreateButton("Del Temp Files",63,4,83,32)
$button4=GuiCtrlCreateButton("Exit",146,4,52,32)
$input1=GuiCtrlCreateInput("asdasdasdasdasd",22,92,147,20)
$input2=GuiCtrlCreateInput("asdasdasdasdasd",20,143,148,20)
$label1=GuiCtrlCreateLabel("Account Info",7,49,98,15)
$label2=GuiCtrlCreateLabel("Username:",7,73,107,15)
$label3=GuiCtrlCreateLabel("Password:",8,123,74,15)
$label4=GuiCtrlCreateLabel("iBot Path:",3,225,124,15)

GuiSetState()

While 1
$msg=GuiGetMsg()
If $msg=-3 Then Exit
If $msg=$button1 Then button1() ;HELP
If $msg=$button2 Then button2() ;Start iBot
If $msg=$button3 Then button3() ;Del Temp Files
If $msg=$button4 Then button4() ;EXIT
Wend




Func button1()
    MsgBox(0, "Pre-config", "First open Loader.ini file"& @CRLF &""& @CRLF &"EDIT THIS PART"& @CRLF &""& @CRLF &"SilentStartup=1"& @CRLF &""& @CRLF &"Redirect=127.0.0.1:16000"& @CRLF &""& @CRLF &"SAVE AND CLOSE .INI FILE"& @CRLF &""& @CRLF &"HotKeys"& @CRLF &""& @CRLF &"F6 - Show HotKeys"& @CRLF &"F7 - Delete temp files"& @CRLF &"F8 - EXIT Autoit")
EndFunc

Func button2()
EndFunc

Func button3()
    MsgBox(0, "Deleting temp files","   Deleted    ^^")
    FileDelete(@ScriptDir & "\iBot.bat")
    FileDelete(@ScriptDir & "\loader.bat")
EndFunc

Func button4()
    ;;; aki ele actua pelo Yes/No/Cancel/OK ;;;
$answer = MsgBox(4, "Wanning", "Did you Delete Temp Files?")
    ; Check the user's answer to the prompt (see the help file for MsgBox return values)
    ; If "YES" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(0, "Exit", "Exit iBot_Starter")
    Exit
EndIf   
    
EndFunc

Some buttons are working great and some are wrong, like this one.

Func button4()
    ;;; aki ele actua pelo Yes/No/Cancel/OK ;;;
$answer = MsgBox(4, "Wanning", "Did you Delete Temp Files?")
    ; Check the user's answer to the prompt (see the help file for MsgBox return values)
    ; If "YES" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(0, "Exit", "Exit iBot_Starter")
    Exit
EndIf   
    
EndFunc

i cant figure out what im doing wrong on it. i cant make the Yes Button to exit the program and the NO button to cancel my Exit.

Sow if you guys with some patience can in-light me on what im doing wrong, ill be happy for your help.

Thx for your replays guys.

Share this post


Link to post
Share on other sites

Yes is 6 not 7 ;)

OK 1

CANCEL 2

ABORT 3

RETRY 4

IGNORE 5

YES 6

NO 7

TRY AGAIN ** 10

CONTINUE ** 11

Mat

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm

Or in the helpfile which was included in the autoit install.

Mat

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Share this post


Link to post
Share on other sites

The intent of this forum is not to help you cheat with iBot on Silkroad. We will not knowingly aid any violations of terms of use.

The only one general help from me:

For making Autoit GUIs definitely use Koda

http://www.autoitscript.com/forum/index.php?showtopic=32299

Share this post


Link to post
Share on other sites

The intent of this forum is not to help you cheat with iBot on Silkroad. We will not knowingly aid any violations of terms of use.

The intent of this Forum, is to help ppl that are interested to make some tool wht ever it make.

If iBot is a tool to cheat on Silkroad, i dont care.

Im here asking information, because i have the will of learning something.

If my interest, is to make a Autoit program to run 2 external programs, im not making no harm on the 2 programs with my autoit program.

Sow, if you want to keep with your idea, for me its ok.

I make my questions in a other form.

The only one general help from me:

For making Autoit GUIs definitely use Koda

http://www.autoitscript.com/forum/index.php?showtopic=32299

Thx Zedna

Share this post


Link to post
Share on other sites

The intent of this Forum, is to help ppl that are interested to make some tool wht ever it make.

You would expect from such a long standing and active member that I would know what the intent of the forum is by now.

If iBot is a tool to cheat on Silkroad, i dont care.

Im here asking information, because i have the will of learning something.

If my interest, is to make a Autoit program to run 2 external programs, im not making no harm on the 2 programs with my autoit program.

You're breaking terms of service. We know you are breaking terms of service. You're making us help you break an agreement. Effectively making us "accomplices". The concept here is quite simple. We will not knowingly aid you in helping with anything that violates terms of service, which is what you're doing.

The keyword here is knowingly.

If you can't understand that, perhaps it is best if you visit an other forum.

Share this post


Link to post
Share on other sites

You would expect from such a long standing and active member that I would know what the intent of the forum is by now.

You're breaking terms of service. We know you are breaking terms of service. You're making us help you break an agreement. Effectively making us "accomplices". The concept here is quite simple. We will not knowingly aid you in helping with anything that violates terms of service, which is what you're doing.

The keyword here is knowingly.

If you can't understand that, perhaps it is best if you visit an other forum.

Manadra;

1st is Silkroad Online had some something to be legit, they shod ban all GoldBots Company's as well theyr own GoldBots to sell gold to the users plus Silks, for rare items.

2nd iBot.exe, dosent have no violating terms of service. its a program made from a user and he helped me on somethings.

3rd and last, ill never be violating terms of service on Silkroad if i keep paying for playing. you can read every Terms of silkroad, but in the end, go to all foruns of silkroad, and post this for theyr admins, "I BUY SILKS and USE 3rd PARTY PROGRAMS FOR 4 YEARS NOW, I NEVER GOT BANNED, WHY???" if they say anything that you will be banned, and post here the replay, ill stop asking help here to make my program.

Haa btw, if im violating terms of service, why are you helping on UT(1999) game, to make a tool for some one else:

http://www.autoitscript.com/forum/index.php?showtopic=106809

http://www.autoitscript.com/forum/index.php?showtopic=106809&view=findpost&p=753920

peace man...

Share this post


Link to post
Share on other sites

mini, let me make something very clear to you: We don't give a shit what you do, we just don't want you doing it here. If you're going to continue to be a tool, that's fine. But the next time somebody who has a clue tells you to piss off with your botting, piss off. I don't particularly like the insolent way you've argued with Manadar and I'm half tempted to ban you for it. But I'm not. I'm going to simply say that everything Manadar said is correct and if you have a problem with that, you have a problem with me and we can arrange for that to be fixed with your removal from this forum.

Thread locked. Further threads (or PMs) on the subject will result in bans.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0