Jump to content

End with Splash


Recommended Posts

Hy folks, i wonder if its possible to end my script with a splash message that exits when i press esc ?

Mu script is ruuning in two possible ways. User can choose way one or two. so how can i make the both ways to end with the same splash screen that exits on ESC key.

thx

something like this

,,,,,,,,,,,,,,,,,Way 1---

START==<-=== =---> End here with the splash

,,,,,,,,,,,,,,,,, Way 2---

Way 1 and 2 are in functions

PS quite hard to draw :D

Edited by doohoodogg
Link to comment
Share on other sites

Hy folks, i wonder if its possible to end my script with a splash message that exits when i press esc ?

Mu script is ruuning in two possible ways. User can choose way one or two. so how can i make the both ways to end with the same splash screen that exits on ESC key.

thx

something like this

,,,,,,,,,,,,,,,,,Way 1---

START==<-=== =---> End here with the splash

,,,,,,,,,,,,,,,,, Way 2---

Way 1 and 2 are in functions

PS quite hard to draw :D

Rather than make an ascii drawing of your script.. why not post your code?

In any case, just make an exit function called by both Way 1 and Way 2. It can have a Splash and then exit the script.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

just put the two functions from the code in your script and call Splash() from within the functions you made. Hope this helps.

Splash()

Func Splash()
    HotKeySet("{ESC}", "Quit")
    SplashTextOn("Test", "This Is A Test")
    While 1
        Sleep(100)
    WEnd
EndFunc ;==>Splash

Func Quit()
    Exit
EndFunc ;==>Quit
Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

well theres a special function name it autoit that when auotits exited it will be callled check it out

#include <GUIConstants.au3>
#include <Misc.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("Add Sumtin", 209, 210, 192, 125)
$add = GUICtrlCreateButton("Add Sumtin", 48, 8, 105, 49)
$List1 = GUICtrlCreateList("", 16, 64, 177, 136, -1, $WS_EX_CLIENTEDGE)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $add
            GUICtrlSetData($List1,InputBox("What to add","ADD SOMETHING"))
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Func OnAutoitExit()
    SplashTextOn("PRESS ESC","PRESS ESC TO EXIT")
    While 1
        IF _IsPressed("1B") Then ExitLoop
    WEnd
    SplashOff()
EndFunc
Link to comment
Share on other sites

heres the code

SplashTextOn("PORT CREATOR by ROBERTO","Welcome." & @CRLF & @CRLF & "Port Creator este un programel facut de mine pentru prieteni si nu numai, cu scopul de a 'automatiza' crearea de porturi pentru programul P2P Azureus, porturi pe care unii nu stiu sau nu reusesc sa le faca, portul\rile fiind necesare pt o buna functionare a aplicatiei Azureus. " & @CRLF & "Acest program face porturile automat, tu trebuie doar sa specifici un nr pt port, si in cazul 2, IP-ul tau. " & @CRLF & "Este foarte important sa rulezi programul fara sa ai alte ferestre deschise, si este recomandat sa nu faci absolut nimic in timp ce programul creeaza porturile. (nu-ti fa griji, totul se termina in mai putin de 30 secunde)" & @CRLF & @CRLF & @CRLF & " With all respect," & @CRLF & " ROBERTO" & @CRLF & @CRLF & "Pentru a continua apasa ESC","-1","-1","-1","-1",0,"","","")

#EndRegion --- CodeWizard generated code End ---

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

func sploff()

SplashOff( )

EndFunc

;ALEGERE AVRIANTA

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

GuiCreate("ALEGERE VARIANTA", 392, 197,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("Alege o varianta !!" & @CRLF & "Varianta 1 este recomandata pentru inceput!! Dar in caz ca aceasta nu fuctioneaza, poti alege varianta 2. La varianta 2 va trebui sa specifici IP-ul tau.", 20, 9, 360, 40)

$Button_2 = GuiCtrlCreateButton("Varianta 1", 40, 80, 110, 30)

GuiCtrlSetOnEvent($Button_2, "var1")

$Button_3 = GuiCtrlCreateButton("Varianta 2", 240, 80, 110, 30)

GuiCtrlSetOnEvent($Button_3, "var2")

$Button_4 = GuiCtrlCreateButton("Exit", 130, 150, 130, 30)

GuiCtrlSetOnEvent($Button_4, "exitp")

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

;ALEGERE VARIANTA END

func exitp()

Exit

EndFunc

;VARIANTA 1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

func var1()

;INPUT PENTRU PORT

$portnr = InputBox("Nr Port","Introdu un nr pentru port" & @CRLF & "ATENTIE: trebuie sa fie neaparat intre 7000 si 49999" & @CRLF & "Exemplu: 45161","45161"," 5","-1","-1","-1","-1")

Select

Case @Error = 0 ;OK - The string returned is valid

Case @Error = 1 ;The Cancel button was pushed

Case @Error = 3 ;The InputBox failed to open

EndSelect

#EndRegion --- CodeWizard generated code End ---

If @error = 1 Then

Exit

EndIf

;INPUT PORT END

;macro

Opt("WinTitleMatchMode", 4)

RunWait(@ComSpec & " /c " & " runcpl.bat", "", @SW_HIDE)

sleep(500)

WinActivate("Windows Firewall", "")

sleep(300)

$Tabhdl = ControlGetHandle("","","SysTabControl321")

Sleep(300)

ControlCommand("","",$Tabhdl,"TabRight","")

Sleep(300)

ControlCommand("","",$Tabhdl,"TabRight","")

Sleep(300)

WinWait("Windows Firewall","Windows Firewall is enabled fo")

WinWait("Windows Firewall","Windows Firewall is enabled fo")

sleep(500)

ControlClick("Windows Firewall","", 102)

;end macro

sleep(300)

$computername = @ComputerName

WinActivate("Advanced Settings", "")

sleep(500)

ControlClick("Advanced Settings", "", 1561)

WinActivate("Service Settings", "")

WinSetState("Service Settings", "", @SW_SHOW)

ControlClick ( "Service Settings", "", 1552)

sleep(500)

Send ( "Azureus port tcp" )

sleep(500)

ControlClick ( "Service Settings", "", 1556)

sleep(500)

Send($computername)

sleep(500)

ControlClick("Service Settings", "", 1553)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1551)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1554)

sleep(500)

ControlClick("Service Settings", "", 1)

sleep(500)

WinActivate("Advanced Settings", "")

ControlClick("Advanced Settings", "", 1561)

WinActivate("Service Settings", "")

WinSetState("Service Settings", "", @SW_SHOW)

ControlClick ( "Service Settings", "", 1552)

sleep(500)

Send ( "Azureus port udp" )

sleep(500)

ControlClick ( "Service Settings", "", 1556)

sleep(500)

Send($computername)

sleep(500)

ControlClick("Service Settings", "", 1553)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1551)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1555)

sleep(500)

ControlClick("Service Settings", "", 1)

sleep(300)

ControlClick("Advanced Settings", "", 1)

sleep(500)

WinClose("Windows Firewall", "")

EndFunc

;END VARIANTA 1+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;VARIANTA 2 ================================================================

func var2()

#Region --- CodeWizard generated code Start ---

;InputBox IP

If Not IsDeclared("sInputBoxAnswer") Then Dim $sInputBoxAnswer

$ipp = InputBox("Introdu IP-ul tau","Introdu IP-ul tau exact asa cum tia fost furnizat de provider-ul tau de Internet" & @CRLF & "Exemplu: 98.90.65:254",""," ","-1","-1","-1","-1")

Select

Case @Error = 0 ;OK - The string returned is valid

Case @Error = 1 ;The Cancel button was pushed

Case @Error = 3 ;The InputBox failed to open

EndSelect

#EndRegion --- CodeWizard generated code End ---

If @error = 1 Then

Exit

EndIf

;INPUT IP END

;INPUT PORT

$portnr = InputBox("Nr Port","Introdu un nr pentru port" & @CRLF & "ATENTIE: trebuie sa fie neaparat intre 7000 si 49999" & @CRLF & "Exemplu: 45161","45161"," 5","-1","-1","-1","-1")

Select

Case @Error = 0 ;OK - The string returned is valid

Case @Error = 1 ;The Cancel button was pushed

Case @Error = 3 ;The InputBox failed to open

EndSelect

;INPUT PORT END#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.6 Prototype

;Inputbox PORT END

;macro

Opt("WinTitleMatchMode", 4)

RunWait(@ComSpec & " /c " & " runcpl.bat", "", @SW_HIDE)

sleep(500)

WinActivate("Windows Firewall", "")

sleep(300)

$Tabhdl = ControlGetHandle("","","SysTabControl321")

Sleep(300)

ControlCommand("","",$Tabhdl,"TabRight","")

Sleep(300)

ControlCommand("","",$Tabhdl,"TabRight","")

Sleep(300)

WinWait("Windows Firewall","Windows Firewall is enabled fo")

WinWait("Windows Firewall","Windows Firewall is enabled fo")

sleep(500)

ControlClick("Windows Firewall","", 102)

;end macro

sleep(300)

WinActivate("Advanced Settings", "")

sleep(500)

ControlClick("Advanced Settings", "", 1561)

WinActivate("Service Settings", "")

WinSetState("Service Settings", "", @SW_SHOW)

ControlClick ( "Service Settings", "", 1552)

sleep(500)

Send ( "Azureus port tcp" )

sleep(500)

ControlClick ( "Service Settings", "", 1556)

sleep(500)

Send($ipp)

sleep(500)

ControlClick("Service Settings", "", 1553)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1551)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1554)

sleep(500)

ControlClick("Service Settings", "", 1)

sleep(500)

WinActivate("Advanced Settings", "")

ControlClick("Advanced Settings", "", 1561)

WinActivate("Service Settings", "")

WinSetState("Service Settings", "", @SW_SHOW)

ControlClick ( "Service Settings", "", 1552)

sleep(500)

Send ( "Azureus port udp" )

sleep(500)

ControlClick ( "Service Settings", "", 1556)

sleep(500)

Send($ipp)

sleep(500)

ControlClick("Service Settings", "", 1553)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1551)

sleep(500)

Send($portnr)

sleep(500)

ControlClick("Service Settings", "", 1555)

sleep(500)

ControlClick("Service Settings", "", 1)

sleep(300)

ControlClick("Advanced Settings", "", 1)

sleep(500)

WinClose("Windows Firewall", "")

EndFunc

;VARIANTA 2 ================================================================================

;THIS IS THE SPLASH THAT I WANT THE SCRIPT TO END WITH

SplashTextOn("Complete","Gata !! Portul\rile au fost facute. Tot ce mai ramane de facut e sa le testezi si sa le aplici in Azureus. Pentru a face asta, dupa ce ai inchis mesajul asta, deschide Azureus, click pe 'TOOLS' din meniul de sus, alege 'NAT FIREWALL TEST', iar in casuta 'INCOMING TCP LISTEN PORT', scrie numarul portului pe care l-ai ales la inceput, si click pe butonul 'TEST'. Daca totul e ok, dupa cateva secunde ar trebui sa apara mai jos 'Testing......Port OK' sau 'NAT OK' sau orice mesaj care sugereaza ca portul functioneaza. Daca apar mesaje care sugereaza ca portul nu functioneaza cum ar fi 'Unable to test.....' sau 'Firewalled' etc, atunci creeaza alt port cu acest program folosind alt numar sau varianta 2." & @CRLF & @CRLF & "ATENTIE: FOARTE IMPORTANT ESTE SA RESTARTEZI PC-UL DUPA CE AI CREEAT PORTURILE (INAINTE DE TESTAREA IN AZUREUS)" & @CRLF & @CRLF & @CRLF & "Pt a iesi apasa tasta ESC" & @CRLF & " ROBERTO" & @CRLF & " ","-1","-1","-1","-1",2,"","","")

#EndRegion --- CodeWizard generated code End ---

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

sleep(50000)

func sploff2()

SplashOff( )

EndFunc

Link to comment
Share on other sites

did you not read anything we said, AND USE CODE REGIONS DAMNIT all you have to do is put code in brackets and then to end it add a slash b4 the word code Example

PROGRAM CODE GOES HERE

#include <Misc.au3>
Sleep(1000)
Func OnAutoItExit()
    SplashTextOn("Complete","Gata !! Portul\rile au fost facute. Tot ce mai ramane de facut e sa le testezi si sa le aplici in Azureus. Pentru a face asta, dupa ce ai inchis mesajul asta, deschide Azureus, click pe 'TOOLS' din meniul de sus, alege 'NAT FIREWALL TEST', iar in casuta 'INCOMING TCP LISTEN PORT', scrie numarul portului pe care l-ai ales la inceput, si click pe butonul 'TEST'. Daca totul e ok, dupa cateva secunde ar trebui sa apara mai jos 'Testing......Port OK' sau 'NAT OK' sau orice mesaj care sugereaza ca portul functioneaza. Daca apar mesaje care sugereaza ca portul nu functioneaza cum ar fi 'Unable to test.....' sau 'Firewalled' etc, atunci creeaza alt port cu acest program folosind alt numar sau varianta 2." & @CRLF & @CRLF & "ATENTIE: FOARTE IMPORTANT ESTE SA RESTARTEZI PC-UL DUPA CE AI CREEAT PORTURILE (INAINTE DE TESTAREA IN AZUREUS)" & @CRLF & @CRLF & @CRLF & "Pt a iesi apasa tasta ESC" & @CRLF & " ROBERTO" & @CRLF & " ","-1","-1","-1","-1",2,"","","")
    While 1
        If _Ispressed("1B") Then ExitLoop
        WEnd
    SplashOFF()
EndFunc
Edited by thatsgreat2345
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...