Jump to content

Pixel Analyzing Loop Response Bot only works one time, doesn't loop


Recommended Posts

I'm making this bot to analyze a square on the screen on a loop with a sleep timer of 50

It's supposed to continue as long as the PixelCheckSum DOES NOT equal either...2792087096, 3685233020, or 992816331, and when it does equal one of those it should click the screen at 729, 251 and make a Send( response based on the specific checksum that it was. This response is text with a number in the middle of it, randomly generated each loop

The problem is though it doesn't work, it only works if the screen is already showing something with one of the checksums when I run the script, but then it doesn't continue to work for other instances of that checksum appearing

Any reason anyone can see why this shouldn't continue indefinitely on a loop?

Opt("SendKeyDelay",0)
Opt("SendKeyDownDelay",0)
While 1

Local $checksum = PixelCheckSum(659, 441, 765, 449)

While $checksum <> 992816331 AND $checksum <> 3685233020 AND $checksum <> 2792087096
Sleep(50)
WEnd

Local $rand = Random(1,100,1)

MouseClick("left", 729, 251, 1, 0)

If $checksum = 992816331 Then
Send(Text")
Send($rand)
Send("{enter}")

ElseIf $checksum = 3685233020 Then
Send("Text")
Send($rand)
Send("{enter}")

ElseIf $checksum = 2792087096 Then
Send("Text")
Send($rand)
Send("{enter}")

EndIf

Sleep(100)

WEnd
Edited by kamppapya
Link to comment
Share on other sites

Problem fixed, needed an additional checksum checker within the loop

Opt("SendKeyDelay",0)
Opt("SendKeyDownDelay",0)
While 1
$checksum = PixelCheckSum(659, 441, 765, 449)
While $checksum <> 992816331 AND $checksum <> 3685233020 AND $checksum <> 2792087096 AND $checksum <> 3424698734 AND $checksum <> 2814325116
Local $checksum = PixelCheckSum(659, 441, 765, 449)
Sleep(50)
WEnd
Local $rand = Random(1,100,1)
$time = @hour & ":" & @MIN & ":" & @SEC
If $checksum = 992816331 Then
Edited by kamppapya
Link to comment
Share on other sites

  • Moderators

kamppapya,

A word of warning: Using the word "bot" when posting a script using PixelSearch tends to raise suspicions around here. Please read the Forum Rules before posting again to make sure that you understand what is and is not allowed on the forum. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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