Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- break := false
- PlantFarming(file, dataFile) {
- global break
- Click 809 652 ; Select Breeding Cave
- Sleep 550
- Click 699 875 ; Select Retry
- Sleep 360
- Click 899 869 ; Confirm Breed
- Sleep 4000
- WaitForColour(0xFF1111, 945, 430, file, dataFile, wait:=25, lookForColour:=true, waitMessage:="Beginning Wait", foundMessage:="Heart", recordData:=true)
- Click 955 552 ; Click on Cave
- Sleep 450
- Click 939 825 ; Place in Nursery
- Sleep 500
- Click 1098 437 ; Click on Nursery
- Sleep 2500
- ; change coords depending on egg slot
- ; No Donation Board - 1: (,), 2: (,), 3: (278,826), 4: (257,846), 5: (80,846), 6:(,)
- ; Donation Board - 1: (,), 2: (475,826), 3: (433,849), 4: (400,865), 5: (238,867), 6:(,)
- WaitForColour(0x22BB11, 80, 846, file, dataFile, wait:=25, lookForColour:=false, waitMessage:="Beginning Egg Wait", foundMessage:="Egg")
- ; change first number depending on which nursery slot egg goes into (numbered from right)
- ; No Donation Board - 1: 721, 2: 523, 3: 366, 4: 336, 5: 152, 6:
- ; Donation Board - 1: , 2: 555, 3: 507, 4: 471, 5: 302, 6:
- Click 152 904 ; Click on Egg
- Sleep 350
- Click 1199 645 ; Click Sell
- Sleep 360
- Click 789 843 ; Click Yes
- Sleep 360
- }
- WaitForColour(colour, X, Y, file, dataFile, wait:=50, lookForColour:=true, waitMessage:="Beginning Wait", foundMessage:="", recordData:=false) {
- counter := 0
- loops := 0
- file.write(A_Hour ":" A_Min ":" A_Sec " : " waitMessage "`n")
- if (lookForColour)
- {
- Loop {
- PixelGetColor, cRGB, %X%, %Y%, RGB
- if (cRGB = colour) ; might need to update this if the heart isn't detected
- {
- file.write(A_Hour ":" A_Min ":" A_Sec " : " foundMessage " Found after " counter " loops (" counter * wait " milliseconds) `n")
- if (recordData)
- {
- dataFile.write(counter "," A_Hour ":" A_Min ":" A_Sec "`n")
- }
- Break
- }
- Sleep %wait%
- }
- } else {
- Loop {
- PixelGetColor, cRGB, %X%, %Y%, RGB
- file.write(A_Hour ":" A_Min ":" A_Sec " : " cRGB " at 945, 430`n")
- if (cRGB != colour)
- {
- file.write(A_Hour ":" A_Min ":" A_Sec " : " foundMessage " Found after " counter " loops (" counter * wait " milliseconds) `n")
- if (recordData)
- {
- dataFile.write(counter "," A_Hour ":" A_Min ":" A_Sec "`n")
- }
- Break
- }
- counter := counter + 1
- Sleep %wait%
- }
- }
- return
- }
- +x::
- MouseGetPos, PosX, PosY
- PixelGetColor, cRGB , %PosX%, %PosY%,RGB
- MsgBox, %cRGB% "`n" %PosX% ", " %PosY%
- return
- +p::
- break := false
- startTime := A_TickCount
- filename := "D:\mouse-click\log-file-" A_DD "-" A_MM ".txt"
- file := FileOpen(filename,"a")
- dataFile := FileOpen("D:\mouse-click\plant-farm-data-" A_DD "-" A_MM ".csv","a")
- file.write(A_Hour ":" A_Min ":" A_Sec " : Starting Cycle at " startTime "`n")
- count := 0
- Loop {
- count := count + 1
- file.write(A_Hour ":" A_Min ":" A_Sec " : Starting Run " count "`n")
- dataFile.write(count ",")
- PlantFarming(file, dataFile)
- tempEndTime := A_TickCount
- tempDuration := (tempEndTime - startTime) / 1000
- tempAverage := count * 10800 / tempDuration ; Gives average value per hour
- file.write(A_Hour ":" A_Min ":" A_Sec " : Average Rate: " tempAverage " EC/hr`n")
- if break
- Break
- }
- endTime := A_TickCount
- duration := (endTime - startTime) / 1000
- average := count * 10800 / duration ; Gives average value per hour
- file.write(A_Hour ":" A_Min ":" A_Sec " : Finishing Cycle`n")
- file.write(A_Hour ":" A_Min ":" A_Sec " : Ran " count " times in " duration " seconds`n")
- file.write(A_Hour ":" A_Min ":" A_Sec " : Average Rate: " average " EC/hr`n")
- file.close()
- dataFile.close()
- return
- +o::
- file.write(A_Hour ":" A_Min ":" A_Sec " : Break Detected`n")
- break := true
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement