|
Post by tinotk on Aug 31, 2016 1:00:28 GMT
There is sample code in document. I am sorry i really dont get this timer thing could u pls explain me how to set a timer and let it call a function after a certain amount of time ? tvm for ure support Read the Advanced thread there is an example there ankulua.boards.net/thread/13/advanced-methods#TimerYou can use the check() method to check time from the timer. Use it as a condition to call your functions.
|
|
|
Post by ragido on Sept 11, 2016 12:57:07 GMT
Hello ankulua, I've made a simple farming script for Toram but I dont know how to add a swipe hold left function. here is my script -- ========== main program ===========
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1275, 170))
Swipe(Location(1220, 565), (1120, 565))
I need help in adding a Swipe hold function with this coordinates ((1220, 565), (1120, 565)), that has a duration of 3 seconds at the end of the script. thank you very much!
|
|
|
Post by AnkuLua on Sept 11, 2016 14:31:02 GMT
|
|
|
Post by ragido on Sept 12, 2016 1:06:36 GMT
thank you, the dragdrop works perfectly but there is something wrong with my script, I cannot adjust the dragdrop timing, step count, and step interval. - ========== main program ===========
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1275, 170))
dragDrop(Location(1220, 565), Location(920, 565))
setDragDropTiming(2000, 3000)
setDragDropStepCount(5)
setDragDropStepInterval(2000)
|
|
|
Post by AnkuLua on Sept 12, 2016 6:12:21 GMT
You should adjust the timing before calling dragDrop.
setDragDropTiming(2000, 3000) setDragDropStepCount(5) setDragDropStepInterval(2000) dragDrop(Location(1220, 565), Location(920, 565))
|
|
|
Post by ragido on Sept 12, 2016 6:22:28 GMT
You should adjust the timing before calling dragDrop. setDragDropTiming(2000, 3000) setDragDropStepCount(5) setDragDropStepInterval(2000) dragDrop(Location(1220, 565), Location(920, 565)) Thank you ankulua, it works like how i want it to now
|
|
|
Post by ragido on Sept 12, 2016 6:31:47 GMT
my final question sir, what command should I add in order to loop this script? -- ========== main program ===========
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1150, 145))
click(Location(1275, 170))
setDragDropTiming(2000, 3000)
setDragDropStepCount(10)
setDragDropStepInterval(100)
dragDrop(Location(1220, 565), Location(920, 565))
|
|
|
Post by AnkuLua on Sept 12, 2016 6:36:23 GMT
|
|
|
Post by ragido on Sept 12, 2016 6:50:00 GMT
Use for loop. www.lua.org/pil/4.3.4.htmlfor i = 1, 10 do -- run 10 times click(... .... dragDrop(... end
thanks again sir, is there a limit for the number of loops you can do or can you do an infinite loop?
|
|
|
Post by AnkuLua on Sept 12, 2016 7:29:33 GMT
you can do an infinite loop
while (true) do click(... ... dragDrop(... end
|
|
|
Post by Mercobots on Sept 27, 2016 1:31:42 GMT
hi there, im very new scripting ankulua/Lua and i have a dumm question, how i can print a bool value!
i have this code
imgSimilarity = 0.8;
imgTimeSearch = 3;
function imgFind(img)
local imgPattern = Pattern(img);
if (exists(imgPattern:similar(imgSimilarity),imgTimeSearch)) then
print(BOOL)<---------------------------------||
end
end
imgFind("img1.png");
print("END"); i have try this line and nothing
print(exists(imgPattern:similar(imgSimilarity),imgTimeSearch))
Thank you
|
|
|
Post by AnkuLua on Sept 27, 2016 3:52:52 GMT
bool = true print(tostring(bool))
|
|
|
Post by Mercobots on Sept 27, 2016 13:41:31 GMT
bool = true print(tostring(bool)) ty sir I have an other issue with dragdrop I'm trying to move continuously through the screen an object but he dont move, he pick the img and after a time he drop setDragDropTiming(500,500)
setDragDropStepCount(100)
setDragDropStepInterval(50)
dragDrop("img" , "img":offset(Location(200, 200)))
im doing somthing wrong or is it a issue
|
|
|
Post by AnkuLua on Sept 27, 2016 14:25:02 GMT
dragDrop("img" , Pattern("img"):targetOffset(Location(200, 200)))
|
|
|
Post by Mercobots on Sept 27, 2016 14:35:03 GMT
dragDrop("img" , Pattern("img"):targetOffset(Location(200, 200))) ok my mistake "img" was just to reference my code myImg = pattern("img1.png")
setDragDropTiming(500,500)
setDragDropStepCount(10)
setDragDropStepInterval(50)
dragDrop(myImg , myImg:targetOffset(Location(200, 200))) and i have the same issue
|
|