Sign in to follow this  
Followers 0
Ruina

i followed the syntax from the manual but

13 posts in this topic

If Send = ("1") Then

$n = 2

While $n <= 4

PixelGetColor ( 379 , 146 ) = 0xFB2F0B

Send("+{TAB " & $n & "}")

Sleep (700)

If $n = 4 Then

$n=1

Else

$n = $n+1

Endif

WEnd

EndIf

that is the code I finished so far.. What I want it to do is to run the script whenever I press the 1 button, however, I am not quite sure of the syntax to use..

I have a syntax error in this parts

If Send =

PixelGetColor ( 379 , 146 ) =

Share this post


Link to post
Share on other sites



sorry for the double post but I guess I already fixed it.. I'm about to compile it now..

Share this post


Link to post
Share on other sites

try to place the WEnd before EndIf.

and if there's WEnd, where's While?


[center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]

Share this post


Link to post
Share on other sites

there is a while somewhere there.. well it is not causing a bug but it does not do what I want it to do.. what function detects the key you recently pressed? for example I pressed 1, the script will automatically press 2, 3, 4..

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

there is a while somewhere there.. well it is not causing a bug but it does not do what I want it to do.. what function detects the key you recently pressed? for example I pressed 1, the script will automatically press 2, 3, 4..

change 'send' to '$send' ?

and dont you mean,

while 1

if _ispressed("81") then...

.

..

...

..

.

endif

wend

example

#include<Misc.au3>
While 1
    If _IsPressed("81", 'user32.dll') Then
        $n = 2
        While $n <= 4
            PixelGetColor(379, 146) = 0xFB2F0B
            Send("+{TAB " & $n & "}")
            Sleep(700)
            If $n = 4 Then
                $n = 1
            Else
                $n = $n + 1
            EndIf
        WEnd
    EndIf
WEnd

btw, wtf is this?

PixelGetColor(379, 146) = 0xFB2F0B

this is an easier more readable way of doing the code shown above

#include<Misc.au3>
Do
    Sleep(10)
Until _IsPressed("81", 'user32.dll')
$n = 2
While $n <= 4
    PixelGetColor(379, 146) = "0xFB2F0B"
    Send("+{TAB " & $n & "}")
    Sleep(700)
    If $n = 4 Then
        $n = 1
    Else
        $n = $n + 1
    EndIf
WEnd
Edited by ReaImDown

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

Share this post


Link to post
Share on other sites

First off you try to set PixelGetColor to a value when it itself is the determiner for setting the value

Are you setting the value of 1 to 2 and starting off at 2 skipping 1. Because that is what you did when you changed the value to 2 before setting the loop.

Just so you do know all you'll be setting from the script is a 2 and 3 if I get this to work then it exits outta the loop and ends the program


Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Share this post


Link to post
Share on other sites

Why are you setting SHIFT+TAB 5 times throughout the script, why not just SHIFT+TAB 5 times every 1 or 30 or 60 seconds?


Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Share this post


Link to post
Share on other sites

there is a while somewhere there.. well it is not causing a bug but it does not do what I want it to do.. what function detects the key you recently pressed? for example I pressed 1, the script will automatically press 2, 3, 4..

sorry, I didn't see.


[center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]

Share this post


Link to post
Share on other sites

sorry I don't know how to send variables.. for example I want to send the value of $n.. what should I do?

Share this post


Link to post
Share on other sites

#include<Misc.au3>

While 1
    If _IsPressed("81", 'user32.dll') Then
        $n = 2; are you sure you want to nullify the 1 so 1 is never pressed? Remember you need to use asc character attribute to tell it what number your using else it will get a error
        While $n <= 4
            PixelGetColor(379, 146) = 0xFB2F0B; incorrect usage loo in help file under PixelGetColor
            Send("+{TAB " & $n & "}"); This function tells it to send Shift-Tab $n amount of times 
            Sleep(700)
            If $n = 4 Then
                $n = 1
            Else
                $n = $n + 1
            EndIf; So 1 and 4 are nullified only pressing 2 and 3 in your script?
        WEnd
    EndIf
WEnd


Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Share this post


Link to post
Share on other sites

thanks, now I get it..

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Here is a new program with your same things in there

HotKeySet( "1", "_IsPressed1")

While 1
    Sleep(100)
WEnd

Func _IsPressed1()
    $n = 1
    While $n < 4
        Send("+{TAB " & $n & "}")
        Sleep(500)
        $n += 1
    WEnd
EndFunc

The file doesn't include anything so saving space and we are using a Hotkeyset to wait for the activation of the "1" key. Not entirely sure but I changed the $n = 2 to 1 because I think you are trying to activate them all on the pressing of 1. With this I saw no need to have a $n = 4 because your ending it after 4 is pressed, right? One more thing are you trying to press Shift-Tab 10 times and for what purpose wouldn't it be much easier to write up a program to press Shift-Tab 10 times and wait till activation again to press it? However I saw no use in the PixelGetColor so you need to tell me what it is about

Edited by TerarinKerowyn

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

i want it to do things in a loop every time an indicator turns into that color to divert current into different loads (2,3,4).. what I want it to do is that after I press 1, 2,3,4 button would continuously loop.. i.e. when I press 1 (2,3,4,2,3,4,2,3...) <this would follow endlessly.. plus I want to make 5 the loop breaker how do I do that?

Edited by Ruina

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