Sign in to follow this  
Followers 0
Splitz

help me with this script

23 posts in this topic

ok how do i get this script to send '2' once theres a pixel change at both (435, 585, 435, 585) and (71, 520, 71, 520) ?

Global $Paused, $checksum1, $checksum2
HotKeySet("{Del}", "Terminate")
HotKeySet("{End}", "TogglePause")
If WinActivate("Diablo II") Then
    Sleep(9000)
    $checksum1 = PixelChecksum(71, 520, 71, 520)
    $checksum2 = PixelChecksum(71, 550, 71, 550)
    $checksum3 = PixelChecksum(470, 584, 470, 584)
EndIf
While 1
    If PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('1')
    ElseIf PixelChecksum(71, 550, 71, 550) <> $checksum2 Then
        Sleep(1000)
        Send('5')
    EndIf
    Sleep(10)
WEnd

While 1
    If PixelChecksum(435, 585, 435, 585) <> $checksum3 Then
        PixelChecksum(71, 520, 71, 520) <> $checksum1
        Sleep(100)
        Send('2')
    EndIf
    Sleep(10)
WEnd

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
    WEnd
EndFunc
Func Terminate()
    Exit 0
EndFunc

Share this post


Link to post
Share on other sites



It has to go into the original loop and should be

ElseIf PixelChecksum(435, 585, 435, 585) <> $checksum3 and PixelChecksum(71, 520, 71, 520) <> $checksum1

I think.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Why don't you try to contain yourself to one post...

http://www.autoitscript.com/forum/index.ph...mp;#entry274751


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i did this but it still isint sending 2

Global $Paused, $checksum1, $checksum2
HotKeySet("{Del}", "Terminate")
HotKeySet("{End}", "TogglePause")
If WinActivate("Diablo II") Then
    Sleep(9000)
    $checksum1 = PixelChecksum(71, 520, 71, 520)
    $checksum2 = PixelChecksum(71, 550, 71, 550)
    $checksum3 = PixelChecksum(470, 584, 470, 584)
EndIf
While 1
    If PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('1')
    ElseIf PixelChecksum(71, 550, 71, 550) <> $checksum2 Then
        Sleep(1000)
        Send('5')
    ElseIf PixelChecksum(435, 585, 435, 585) <> $checksum3 and PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('2')
    EndIf
    Sleep(10)
WEnd

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
    WEnd
EndFunc
Func Terminate()
    Exit 0
EndFunc
Edited by Fenix`

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Why did you change posts?

Does this work?

While 1
    If PixelChecksum(435, 585, 435, 585) <> $checksum3 and PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('2')
    ElseIf PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('1')
    ElseIf PixelChecksum(71, 550, 71, 550) <> $checksum2 Then
        Sleep(1000)
        Send('5')
    EndIf
    Sleep(10)
WEnd
Edited by 1905russell

Share this post


Link to post
Share on other sites

Isn't Send supposed to have double quotes?

Send("2")

[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Share this post


Link to post
Share on other sites

The help file examples only show the use of double quotes.

There were some single quotes shown in the help file, but was under the impression that those were just marking the characters that had a special purpose (!+^# etc.) in the remarks section.


[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Share this post


Link to post
Share on other sites

Why did you change posts?

Does this work?

While 1
    If PixelChecksum(435, 585, 435, 585) <> $checksum3 and PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('2')
    ElseIf PixelChecksum(71, 520, 71, 520) <> $checksum1 Then
        Sleep(100)
        Send('1')
    ElseIf PixelChecksum(71, 550, 71, 550) <> $checksum2 Then
        Sleep(1000)
        Send('5')
    EndIf
    Sleep(10)
WEnd

when i use this, it only sends 2 if theres a change at $checksum1, and it never sends 1

i want it to send 2 ONLY if theres changes at both checksum1 & checksum3 at the same time

only send 1 if there are changes to checksum1

and only send 5 if there are changes to checksum3

Share this post


Link to post
Share on other sites

bump

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

when i use this, it only sends 2 if theres a change at $checksum1, and it never sends 1

i want it to send 2 ONLY if theres changes at both checksum1 & checksum3 at the same time

only send 1 if there are changes to checksum1

and only send 5 if there are changes to checksum3

Are you sure because the only way that first expression can return 2 is when both conditions apply?

If there is a change to checksum1 only, then you should get a 1?

All your previous code shows 5 being returned on changes to checksum2 now you are talking about changes to checksum3?

Edited by 1905russell

Share this post


Link to post
Share on other sites

@Fenix : It would be extremely useful and nice if you could actually invest some time

in thinking out a more fitting title for once, meaning one that describes the problem in

a few words, and not something ala "I need help" or "help me with this script". You're

posting in a support-forum, so it's pretty obvious that you need help with something,

so a topic-title such as the one you've chosen for this one isn't useful at all.

I'm one of those who easily skip a topic or five, by just looking at the topic-title (and a

couple of other factors), because the topic-creator can't use his time in describing his

topic better, why would I want to invest time in helping him. Your previous topic-titles

aren't any better either, with a few exceptions.

Share this post


Link to post
Share on other sites

The help file examples only show the use of double quotes.

There were some single quotes shown in the help file, but was under the impression that those were just marking the characters that had a special purpose (!+^# etc.) in the remarks section.

I thought it said this in the help file somewhere...

Anyway it's usable either way - mainly for when you want to make a msgbox or something similar that has double quotes instead of typing two ' ' just use ' ' around the text. Example:

Msgbox(0,"test",'Hello, this is a "test" of the quotes')

Share this post


Link to post
Share on other sites

I thought it said this in the help file somewhere...

Anyway it's usable either way - mainly for when you want to make a msgbox or something similar that has double quotes instead of typing two ' ' just use ' ' around the text. Example:

Msgbox(0,"test",'Hello, this is a "test" of the quotes')

Ok, gotcha. I hadn't used quotes that way before.

Thanks.... ;)


[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Share this post


Link to post
Share on other sites

ok i have 1 more question, is there a way to send a mouse click to a certian area WITHOUT moving the mouse there with autoit ? if so what would the command be ?

Share this post


Link to post
Share on other sites

ok i have 1 more question, is there a way to send a mouse click to a certian area WITHOUT moving the mouse there with autoit ? if so what would the command be ?

ControlClick()

Share this post


Link to post
Share on other sites

Is it a control? (button, check box, etc.)


[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Share this post


Link to post
Share on other sites

ok i was reading in the help file and i saw this,

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

where exactly do i put the cordinates for it to send the click ?

Share this post


Link to post
Share on other sites

ok i was reading in the help file and i saw this,

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

where exactly do i put the cordinates for it to send the click ?

lol you don't put the coordinates, if you want coordinates you just use MouseClick (), if you want it to click a specific control, you use ControlClick () and you have to specify the control ID that you want to click.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

i want it to click a certian coordinate, but i dont want it to move the mouse there, is that possible to do with autoit ?

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