mquan
New Member
Posts: 4
|
Post by mquan on Oct 8, 2018 14:14:53 GMT
my script doesn't click after 30minutes or 1 hourse but debugging still working. scripts still count number of win sorry about my bad english!
|
|
|
Post by AkiBot on Oct 8, 2018 20:24:13 GMT
can you maybe post a samle of your script or give some context as to what you are tying to do? That way we can help you a bit better
|
|
mquan
New Member
Posts: 4
|
Post by mquan on Oct 8, 2018 23:23:57 GMT
I make a very simple script
localPath = scriptPath() setImagePath(localPath .. "Test") imgAccuracy = 0.9 Thua = 0 Thang = 0 Runes = 0 Refill = 0 debugging = true showOnscreenStats = true function defaultRegionLocation () StartHallB7_region = Region(1392, 680, 433, 183) RegionTinhHoa = Region(800, 860, 347, 156) RandomRegion = Region(297,218,942,427) prepareButtonRegion = Region(1002, 837, 180, 180) notEnoughEnergyRegion = Region(863, 301, 340, 180) shopRefillRegion = Region(658, 579, 180, 180) refillClosePurchaseRegion = Region(1698, 16, 200, 200) yesPurchaseRegion = Region(745, 635, 110, 60) reviveNoRegion = Region(1190, 675, 95, 60) refillYesRegion = Region(735, 625, 105, 55) okPurchaseRegion = Region(915, 625, 90, 60) refillNoRegion = Region(1318, 196, 210, 210) crystalRefillRegion = Region(589, 449, 300, 300) Victory_region = Region(642, 107, 309, 132) startRegion = Region(1490, 765, 125, 55) replayRegion = Region(490, 550, 170, 75) RegionOk = Region(637,637,666,382) ReplayHall_region = Region(475, 535, 196, 90) getRegion = Region(985, 635, 500, 515) prepareTextRegion = Region(431, 495, 180, 180) RandomRegion = Region(297,218,942,427) onScreenResultReg = Region(math.floor(screen:getX() / 3), 1, 900, 50) end function clickRandom(r) wait(.1) local region local loc
if debugging == true then r:highlight(1) end
if r:getLastMatch() ~= nil then region = r:getLastMatch() else region = r if debugging == true then wait(.1) region:highlight(1) else wait(.1) end loc = region:getCenter() wait(0.1) click(loc:offset(math.random(1,8), math.random(1, 10))) return end if debugging == true then wait(.1) region:highlight(1) else wait(.1) end local xPos = region:getX() local yPos = region:getY() local maxX = region:getW() local maxY = region:getH()
local xClick = xPos + math.random(maxX) local yClick = yPos + math.random(maxY)
loc = Location(xClick, yClick) if debugging == true then locReg = Region(xClick, yClick, 10, 10) locReg:highlight(1) end click(loc) wait((math.random(2))+0.35) end function refill() toast("Refilling Energy") shopRefillRegion:existsClick(Pattern("RefillShop.png"):similar(imgAccuracy * 0.9), 2.5) crystalRefillRegion:existsClick(Pattern("CrystalRefill.png"):similar(imgAccuracy), 2.5) yesPurchaseRegion:existsClick(Pattern("yesPurchase.png"):similar(imgAccuracy), 2.5) okPurchaseRegion:existsClick(Pattern("okPurchase.png"):similar(imgAccuracy), 2.5) refillClosePurchaseRegion:existsClick(Pattern("closeX.png"):similar(imgAccuracy), 2.5) end
screen = getAppUsableScreenSize() function start() if startRegion:exists(Pattern("StartHallB7.png"):similar(imgAccuracy), 2) then clickRandom(startRegion) end
end function clickRandomReg(r) wait(.2) local region = r local loc local xPos = region:getX() local yPos = region:getY() local maxX = region:getW() local maxY = region:getH()
local xClick = xPos + math.random(maxX) local yClick = yPos + math.random(maxY)
if debugging == true then wait(.1) region:highlight(1) locReg = Region(xClick, yClick, 5, 5) else wait(.2) end
loc = Location(xClick, yClick) click(loc) end function setResultsOs() local SoTran = Thang + Thua if (showOnscreenStats == true) then onScreenResultReg:highlightOff() wait(.1) setHighlightTextStyle(0x4d000000, 0xf8ffffff, 12) local stats = "Runs: " .. SoTran .. " W: " .. Thang .. " L: " .. Thua .. " Rune: " .. Runes .. " ReFill:" .. Refill onScreenResultReg:highlight(stats) end end function printBattleMessage() local message = "" local totalBattle = thua + thang local totalRuneSold = runeSold if totalBattle > 0 then message = message .. "Battle:" .. totalBattle .. " W:" .. thua .. " L:" .. thang end if message ~= "" then message = message .. [[ --------------------------]] if getVersion() < "6.6" then print(message) else setStopMessage(message) end end end defaultRegionLocation()
function doubleClick() clickRandom(RandomRegion) wait(0.1) clickRandom(RandomRegion) Thang = Thang + 1 end setResultsOs() while true do if StartHallB7_region:exists(Pattern("StartB7.png"):similar(imgAccuracy), 0.1) then clickRandom(StartHallB7_region) end if reviveNoRegion:exists(Pattern("noRevive.png"):similar(imgAccuracy), 0.1) then clickRandom(reviveNoRegion) Thua = Thua + 1 clickRandom(RandomRegion) prepareTextRegion:existsClick(Pattern("PrepareText.png"), 2.5) start() setResultsOs() end if Victory_region:exists(Pattern("Victory.png"):similar(imgAccuracy), 2.5) then doubleClick() wait(1.5) if getRegion:exists(Pattern("get.png"):similar(imgAccuracy),2) then clickRandom(getRegion) Runes = Runes + 1 end if RegionOk:exists(Pattern("OkTinhHoa.png"):similar(imgAccuracy),2) then clickRandom(RegionOk) end setResultsOs() end if ReplayHall_region:exists(Pattern("ReplayHall.png"):similar(imgAccuracy), 1) then clickRandom(ReplayHall_region) end if notEnoughEnergyRegion:exists(Pattern("notEnoughEnergy.png"):similar(imgAccuracy), 0.1) then refill() Refill = Refill + 1 prepareTextRegion:existsClick(Pattern("PrepareText.png"), 3) start() setResultsOs() end wait(5) end
|
|
|
Post by alpha4d on Mar 23, 2019 10:45:42 GMT
After I swiching Ankulua 8.3.0 this problem now showup many times. admin any fixs?
|
|
|
Post by AnkuLua on Mar 24, 2019 0:30:31 GMT
After I swiching Ankulua 8.3.0 this problem now showup many times. admin any fixs? 8.3.0 doesn't change anything about it. If that's the case, please switch to older versions.
|
|
|
Post by alpha4d on Mar 24, 2019 5:48:58 GMT
Yes, sir I did already.👍
|
|