Post by toebab on Apr 14, 2020 2:23:48 GMT
Im very sorry but after a few hours, i gave up looking for it by myself. im trying to do a very simple script for a gamebot.
It checks if a collect button is available. if so, it performs some simple steps. The image it searches is exactly inside the highlight but it doesnt recognize the image.
I would really appreciate if somebody could help me on the road with this one.. Please tell me what i do wrong here.. (I would also like to know if there is a way for the script to wait 1 second for an image to appear at the defined region to deal with slow internet and such..
This is what I have so far:
----------
immersive = true
setImmersiveMode(immersive)
genVersion = "8.7.0-pro2"
setAutoGameArea = true
pcall (autoGameArea, setAutoGameArea)
scriptDimension = 2898
Settings:setScriptDimension(true, scriptDimension)
Settings:setCompareDimension(true, scriptDimension)
function CollectIntel()
regOpenLeftMenu = Region(-49, 704, 152, 152)
click(regOpenLeftMenu)
snapshot()
regIntelReady=Region(292, 916, 152, 152)
regIntelGoto=Region(791, 915, 152, 152)
regCollectIntel= Region(1777, 1047, 152, 152)
regCollectIntelClose=Region(1911, 426, 152, 152)
regIntelReady:highlight(0.5)
if (regIntelReady:exists("IntelReady.png",1)) then
snapshot()
regIntelGoto:highlight(0.5)
regIntelGoto:waitClick(("GotoIntel.png"), 5)
snapshot()
regCollectIntel:highlight(0.5)
regCollectIntel:waitClick(("CollectIntel.png"), 5)
snapshot()
regCollectIntelClose:waitClick(("CloseIntelCollect.png"):similar(0.8), 5)
end
end
CollectIntel()
setImmersiveMode(immersive)
genVersion = "8.7.0-pro2"
setAutoGameArea = true
pcall (autoGameArea, setAutoGameArea)
scriptDimension = 2898
Settings:setScriptDimension(true, scriptDimension)
Settings:setCompareDimension(true, scriptDimension)
function CollectIntel()
regOpenLeftMenu = Region(-49, 704, 152, 152)
click(regOpenLeftMenu)
snapshot()
regIntelReady=Region(292, 916, 152, 152)
regIntelGoto=Region(791, 915, 152, 152)
regCollectIntel= Region(1777, 1047, 152, 152)
regCollectIntelClose=Region(1911, 426, 152, 152)
regIntelReady:highlight(0.5)
if (regIntelReady:exists("IntelReady.png",1)) then
snapshot()
regIntelGoto:highlight(0.5)
regIntelGoto:waitClick(("GotoIntel.png"), 5)
snapshot()
regCollectIntel:highlight(0.5)
regCollectIntel:waitClick(("CollectIntel.png"), 5)
snapshot()
regCollectIntelClose:waitClick(("CloseIntelCollect.png"):similar(0.8), 5)
end
end
CollectIntel()
---------------------------------------------------------------
Any help would be very much appreciated