|
Post by tinotk on Sept 12, 2016 16:52:33 GMT
tinok, I have one more question. Is there's a way to have loop within the loop? Say, if I wanted to loop clicks #1-10 for 20 times and *then* click #11-15, is there's a way to do so? I've tried having 400+ clicknum and assign coordinates for each to simulate the effect, but my phone just can't handle that much script at once it seems . Any help (or walkaround) would be much appreciated! You can do that by breaking the original for-loop into 2 for-loops. For example: for j=1,20 do -- loop for 20 times, also don't forget to use different variable names for nested for loops for i=1,10 do -- click #1-#10 -- clik click click end end for i=11,15 do -- click#11-#15 click click click end
|
|
yuria
New Member
Posts: 8
|
Post by yuria on Sept 25, 2016 1:58:57 GMT
I'm sorry tinotk, I don't think I fully understand your advice. After numerous attempts, this is my best interpretation:
setImmersiveMode(true)
clicks = {}
dialogInit() --list = {"1","2","3","4","5"} --addSpinnerIndex("clicknum", list, "1") --addSpinner("clicknum",list,"1") addEditNumber("clicknum",5) dialogShow("How many click location?")
dialogInit() clicknum=tonumber(clicknum) for i = 1, clicknum do addTextView("Click#"..i.." ") addTextView("X:") addEditNumber("xcord"..i,0) addTextView("Y:") addEditNumber("ycord"..i,0) addTextView("Wait:") addEditNumber("wait"..i,1) addCheckBox("continuous"..i,"Continuous ",false) addCheckBox("rand"..i,"Randomize",false) newRow() end addTextView("Random Offset:") addEditNumber("offset",0) dialogShow("Click settings")
clicknum=tonumber(clicknum) for j = 1, clicknum do addTextView("Click#"..j.." ") addTextView("X:") addEditNumber("xcord"..j,0) addTextView("Y:") addEditNumber("ycord"..j,0) addTextView("Wait:") addEditNumber("wait"..j,1) addCheckBox("continuous"..j,"Continuous ",false) addCheckBox("rand"..j,"Randomize",false) newRow() end addTextView("Random Offset:") addEditNumber("offset",0) dialogShow("Click settings")
for j=1,20 do clicks[j] = {location = Location(_G["xcord"..j], _G["ycord"..j]), wait=_G["wait"..j], rpt=_G["continuous"..j], rand=_G["rand"..j]} end
for i=14,15 do clicks = {location = Location(_G["xcord"..i], _G["ycord"..i]), wait=_G["wait"..i], rpt=_G["continuous"..i], rand=_G["rand"..i]} end
Ankulua simply crashes when I try to run the script. Could you please enlighten this noob?
|
|
|
Post by tinotk on Sept 28, 2016 20:15:16 GMT
you changed the wrong part. try this code. what this does is it will click #1-10 20 times then click #11-15. Modify it as you need.
clicks = {}
dialogInit()
addEditNumber("clicknum",5)
dialogShow("How many click location?")
dialogInit()
clicknum=tonumber(clicknum)
for i = 1, clicknum do
addTextView("Click#"..i.." ")
addTextView("X:")
addEditNumber("xcord"..i,0)
addTextView("Y:")
addEditNumber("ycord"..i,0)
addTextView("Wait:")
addEditNumber("wait"..i,1)
addCheckBox("continuous"..i,"Continuous ",false)
addCheckBox("rand"..i,"Randomize",false)
newRow()
end
addTextView("Random Offset:")
addEditNumber("offset",0)
dialogShow("Click settings")
for i=1,clicknum do
clicks[i] = {location = Location(_G["xcord"..i], _G["ycord"..i]), wait=_G["wait"..i], rpt=_G["continuous"..i], rand=_G["rand"..i]}
end
while true do
for j=1,20 do -- loop for 20 times, also don't forget to use different variable names for nested for loops
for i=1,10 do -- click #1-#10
if(clicks[i].rand) then
math.randomseed(os.time())
math.random() ; math.random()
randomOffset = math.random(-offset,offset)
randomOffset2 = math.random(-offset,offset)
loc = Location(clicks[i].location:getX()+randomOffset,clicks[i].location:getY()+randomOffset2)
else
loc = clicks[i].location
end
if(clicks[i].rpt) then
continueClick(loc,100)
else
click(loc)
end
wait(clicks[i].wait) end
end
for i=11,15 do -- click#11-#15
if(clicks[i].rand) then
math.randomseed(os.time())
math.random() ; math.random()
randomOffset = math.random(-offset,offset)
randomOffset2 = math.random(-offset,offset)
loc = Location(clicks[i].location:getX()+randomOffset,clicks[i].location:getY()+randomOffset2)
else
loc = clicks[i].location
end
if(clicks[i].rpt) then
continueClick(loc,100)
else
click(loc)
end
wait(clicks[i].wait) end end --end while
|
|
|
Post by pureevil on Dec 15, 2016 18:26:59 GMT
Hei. I downloaded the script, I moved it to my AnkuLua folder on my phone but how do I edit the clicks? I don't know how do I get to that pop-up where you can select the number of clicks and the location. With AnkuLua app I can only start and stop the script but how do I edit it?
|
|
centy
New Member
Posts: 4
|
Post by centy on Dec 20, 2016 3:26:12 GMT
Hi, I was trying to implement this for pokemon go using bubble strat where I just need a quick burst of taps on the gym screen but using the cintinueClick option taps way too fast for the game to recognise the taps by the looks of it. Is their a way to implement in the script a way to slow down the intervals for continueclick ?
|
|
centy
New Member
Posts: 4
|
Post by centy on Dec 21, 2016 23:04:41 GMT
Well after some experimenting and not really knowing how the values worked with continueclick I was able to come up with an acceptable solution of changing it to setContinueClickTiming(1,100) which effectively taps slow enough to register as "fast finger taps" for 10 seconds - just enough time to startthe fight, beat the pokemon and stop by the end of the battle screen to start again (different values made continue click spam for up to a minute or more!!) Ideally I would like to adjust it to not make continue click last so long but still tap at a moderate speed.
|
|
|
Post by indefinite1992 on Jan 18, 2019 4:48:58 GMT
Hi, I just found your script which exactly fits my need. I only have 1 problem. I have atleast 7 click locations and the option is max 5 Can you possibly add more click locations, please? I can see your code but I cant edit as much as I want to because I only have my cp (no laptop, pc access) sorry to tell but Im just a poor guy. anyway, i will greatly appreciate it if you will reply or if there's an available work around for me. This post is kinda old so Im hoping that you will still see this .
|
|
|
Post by tuanny on Feb 6, 2020 2:09:00 GMT
hello how do i edit this code to add a randomizer timer after my set amount of time. for example it clicks then waits 60 seconds "+ random couple of seconds after" this is the original code
--Auto Clicker v1.1
--by tinotk
--Link to Original thread: http://ankulua.boards.net/thread/115/auto-clicker
setImmersiveMode(true)
clicks = {}
dialogInit()
--list = {"1","2","3","4","5"}
--addSpinnerIndex("clicknum", list, "1")
--addSpinner("clicknum",list,"1")
addEditNumber("clicknum",5)
dialogShow("How many click location?")
dialogInit()
clicknum=tonumber(clicknum)
for i = 1, clicknum do
addTextView("Click#"..i.." ")
addTextView("X:")
addEditNumber("xcord"..i,0)
addTextView("Y:")
addEditNumber("ycord"..i,0)
addTextView("Wait:")
addEditNumber("wait"..i,1)
addCheckBox("continuous"..i,"Continuous ",false)
addCheckBox("rand"..i,"Randomize",false)
newRow()
end
addTextView("Random Offset:")
addEditNumber("offset",0)
dialogShow("Click settings")
for i=1,clicknum do
clicks = {location = Location(_G["xcord"..i], _G["ycord"..i]), wait=_G["wait"..i], rpt=_G["continuous"..i], rand=_G["rand"..i]}
end
while true do
for i=1,#clicks do
if(clicks.rand) then
math.randomseed(os.time())
math.random() ; math.random()
--randomOffset = math.random(-math.floor(offset/2),offset-math.floor(offset/2))
--randomOffset2 = math.random(-math.floor(offset/2),offset-math.floor(offset/2))
randomOffset = math.random(-offset,offset)
randomOffset2 = math.random(-offset,offset)
loc = Location(clicks.location:getX()+randomOffset,clicks.location:getY()+randomOffset2)
else
loc = clicks.location
end
print("Click "..i.." ".."of "..#clicks)
if(clicks.rpt) then
print("Continuous click at:")
print(loc)
continueClick(loc,100)
else
print("Single click at:")
print(loc)
click(loc)
end
wait(clicks.wait)
end
end
|
|
|
Post by alex105playyy on May 25, 2020 16:50:03 GMT
This is a simple script for those of you who are too lazy to write the code, or for doing simple tasks that require fixed coordinate clicks. Download here (version 1.0) For v1.1, please visit Github link below to download.I've uploaded the .lua file to the following github for everyone to improve the code:github.com/tinotk/autoclickerChangelog: v1.1:- Added Random offset - Enter your own # of clicks v1.0:- First release How to use:1. Enter number of clicks location. 2. Enter XY coordinate for each click location, wait time between click locations (in seconds), continuous click or single click, 3. Enjoy Note:- If continuous is checked, the script will click at the location for 100 times (using continueClick()) - Check Randomize if you want the script to perform random clicks about the original location. Be sure to enter a random offset (in pixel), the new coordinate will be XY ± "your random offset range". - The script will keep clicking until you stop it. What can you do with this?- Anything that needs to be clicked at a fixed coordinate like farming stuff in RPG games, or watch ad for free gems in some gems...
|
|
|
Post by stranger001 on Nov 30, 2020 11:01:07 GMT
I spent 5 hours to understand how it works and I was still able to start it, I got an error all the time. can you explain to me what and where exactly I need to change in order for the script to work. Скрипт завершен: Ошибка скрипта: luaj.o: /storage/emulated/0/Download/autoclicker-1.1/autoclicker-1.1/autoclicker.lua:5 `setImmersiveMode(true)` attempt to call a nil value (global 'setImmersiveMode') level = 1, const = 52, proto = 0, upval = 1, vars = 11, code = 223 CALL v0..v1 ; PC 2 CODE 0100401D OP 29 A 0 B 2 C 1 Bx 1025 sBx -130046 stack traceback: /storage/emulated/0/Download/autoclicker-1.1/autoclicker-1.1/autoclicker.lua:5 in main chunk [Java]: in ? at luaj.LuaValue.a(src:2835) at luaj.LuaValue.Z(src:1966) at luaj.LuaValue.a(src:1419) at luaj.LuaClosure.a(src:534) at luaj.LuaClosure.l(src:160) at android.ext.Script.d(src:6056) at android.ext.Script$ScriptThread.run(src:5785)
|
|