Jump to content

Whats wrong with my script? Keeps shift + alt down


Recommended Posts

Well, Here is my script :

Opt("SendKeyDelay", 2)

Opt("SendKeyDownDelay", 2)

HotKeySet("+!r", "Sendone")

HotKeySet("+!c", "Sendtwo")

While(1)

Sleep(100)

WEnd

Func Sendone()

Send("Hi, this is my first script.")

EndFunc

Func Sendtwo()

Send("Hi, this is my second.")

EndFunc

Whats wrong? After it finished script, it keeps shift + alt down, can somebody correct this script ? Or what do i have to add so it dos'nt keep the buttons down ?

Edited by inloveofrapo
Link to comment
Share on other sites

Here it is!

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) Then
        If _IsPressed("12", $dll) Then
            If _IsPressed("52", $dll) Then
        Send("Hi, this is my first script.")
        ExitLoop
    EndIf
EndIf
EndIf
WEnd


While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) Then
        If _IsPressed("12", $dll) Then
            If _IsPressed("43", $dll) Then
        Send("Hi, this is my second.")
        ExitLoop
    EndIf
EndIf
EndIf
WEnd

DllClose($dll)

What? :)

Edited by Kiti
Link to comment
Share on other sites

Here it is!

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) Then
        If _IsPressed("12", $dll) Then
            If _IsPressed("52", $dll) Then
        Send("Hi, this is my first script.")
        ExitLoop
    EndIf
EndIf
EndIf
WEnd


While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) Then
        If _IsPressed("12", $dll) Then
            If _IsPressed("43", $dll) Then
        Send("Hi, this is my second.")
        ExitLoop
    EndIf
EndIf
EndIf
WEnd

DllClose($dll)

What? :)

why dont you use if _ispressed() and _ispressed() and _ispressed() then.... Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

why dont you use if _ispressed() and _ispressed() and _ispressed() then....

Aha!!! Thanks. I didn't knew the magic word was "and". I was used to && from Java, and I've tried other several combinations, but I didn't thought of using "and". Thank you! :)
Link to comment
Share on other sites

So anybody is going to tell me what i have to press so it types the script down ?

@ this one :

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1

Sleep ( 250 )

If _IsPressed("A0", $dll) Then

If _IsPressed("12", $dll) Then

If _IsPressed("52", $dll) Then

Send("Hi, this is my first script.")

ExitLoop

EndIf

EndIf

EndIf

WEnd

While 1

Sleep ( 250 )

If _IsPressed("A0", $dll) Then

If _IsPressed("12", $dll) Then

If _IsPressed("52", $dll) Then

Send("Hi, this is my second.")

ExitLoop

EndIf

EndIf

EndIf

WEnd

DllClose($dll)

Link to comment
Share on other sites

Aha!!! Thanks. I didn't knew the magic word was "and". I was used to && from Java, and I've tried other several combinations, but I didn't thought of using "and". Thank you! :P

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then
        Send("Hi, this is my first script.")
        ExitLoop
    EndIf
WEnd


While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("43", $dll) Then
        Send("Hi, this is my second.")
        ExitLoop
    EndIf
WEnd

DllClose($dll)

Don't PM me, I was replaying even if you didn't. But what's that hard to edit acording to what ReaImDown said? :)

Link to comment
Share on other sites

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then
        Send("Hi, this is my first script.")
        ExitLoop
    EndIf
WEnd


While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("43", $dll) Then
        Send("Hi, this is my second.")
        ExitLoop
    EndIf
WEnd

DllClose($dll)

Don't PM me, I was replaying even if you didn't. But what's that hard to edit acording to what ReaImDown said? :)

you can take it further by using functions if you wanted, so you could jump back and forth between 'scripts'

and come, on guys, arnt I helpful? even just alittle?

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then
          firstscript()
    EndIf
    If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("43", $dll) Then
           secondscript()
    EndIf
WEnd

DllClose($dll)

func firstscript()
        Send("Hi, this is my first script.")
endfunc

func secondscript()
     Send("Hi, this is my second.")
endfunc
Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

ok... and you are trying to do....what ?

who? :)

And what do i have to press so it says that scripted thing ?

- Where can i see the letter to press it on this script?

The buttons are the from your first post. You have to press Alt+Shift+R for the first message, and Alt+Shift+C for the second.
Link to comment
Share on other sites

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1

Sleep ( 250 )

If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then

firstscript()

EndIf

If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("43", $dll) Then

secondscript()

EndIf

WEnd

DllClose($dll)

func firstscript()

Send("Hi, this is my first script.")

endfunc

func secondscript()

Send("Hi, this is my second.")

endfunc

I get error for line 20.

" If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then"

error says -> " Error : IF statements must have a "Then" word "

:S ?

Link to comment
Share on other sites

I get error for line 20.

" If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then"

error says -> " Error : IF statements must have a "Then" word "

:S ?

see, I didnt read b4 I posted...

change " If _IsPressed("A0", $dll) and If _IsPressed("12", $dll) and If _IsPressed("52", $dll) Then"

to

" If _IsPressed("A0", $dll) and _IsPressed("12", $dll) and _IsPressed("52", $dll) Then"

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
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...