Jump to content

Need Help "Stopping function"


Recommended Posts

Hay guys i Made a little bot that writes the "message of the day" for me in my server and restarts the server evry 4 hours.

now i have a problem i made it like this(example) :

while 1
if _ispressed(04) then ;mouse3

send("t")
sleep(20)
send($Messageoftheday)
send("{ENTER}")
endif
sleep(5)
wend
 
 
 know if i let the mouse3 up it should instantly stop the writing like this:
func stopp()
send("{ESC}") ;will close the chat


endfunc
 
thanks for your help
Link to comment
Share on other sites

How many times exactly do you want to send your message.

it looks like this :

 

send($message1)

send("{ENTER}")

 

send($message2)

send("{ENTER}")

 

send($message3)

send("{ENTER}")

 

send($message4)  ;all will be different stuff like rules and informations about admins

send("{ENTER}")

 

and if i will take my finger off from the mouse3 bttn (mouse3 up) it should stop writing thes messages

Link to comment
Share on other sites

While 1
    If _IsPressed(04) Then ;mouse3
        While _IsPressed(04)
            Send("t")
            Sleep(20)
            Send($Messageoftheday)
            Send("{ENTER}")
            Sleep(100)
        WEnd
    EndIf
    Sleep(5)
WEnd

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

While 1
    If _IsPressed(04) Then ;mouse3
        While _IsPressed(04)
            Send("t")
            Sleep(20)
            Send($Messageoftheday)
            Send("{ENTER}")
            Sleep(100)
        WEnd
    EndIf
    Sleep(5)
WEnd

this doesnt work for me but i already got a soloution i show you:

start()
func start()
while 1
if _ispressed(04) then

send($message1)
send("{ENTER}")
if not _ispressed(04) then
start()
endif

send($message2)
send("{ENTER}")
if not _ispressed(04) then
start()
endif

send($message3)
send("{ENTER}")
if not _ispressed(04) then
start()
endif


start()
endif
wend
endfunc

 this works perfect :)

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