|
Post by chezzy on Mar 22, 2017 18:57:19 GMT
Hello, first I would like to thank for creating such awesome tool, been looking for something like this for very long time. Now my problem: I'm trying to create pretty simple account creator. It should just click and type name from text file one row each loop. I have plenty of experience doing this on websites, but this is completely new for me. I have this script, but getting syntax error:7: function arguments expected near "line"
-- ========== Settings ================ Settings:setCompareDimension(true, 500) Settings:setScriptDimension(true, 500) -- ========== main program =========== theFile = file("/storage/emulated/0/scripts/usfemalenames.txt") for line in theFile: print line wait(3) click("signup.png") wait(3) click("first.png") wait(3) type(line) print("Script ended!") theFile.close() So i have recreated the script, it now looks like this:
-- ========== Settings ================ Settings:setCompareDimension(true, 500) Settings:setScriptDimension(true, 500) -- ========== main program =========== click("signup.png") wait(3) fh,err = io.open("/sdcard/scripts/usfemalenames.txt") if err then print("OOps"); return; end line = fh:read() wait(3) click("first.png") type (line) print (line) It prints the exact data I want, but for some reason it does not type them. When I use type like this type ("example") it writes example, but when i write it like this type (line) it gives me error: Runtime error: java.ioIOException:Result 137Result 137Result 137 stack traceback: [C]: in function type
|
|
|
Post by AnkuLua on Mar 23, 2017 0:59:03 GMT
It seems strange. Please put print(line) before type(line). Then share the screen with error dialog. What's your device and android version?
|
|
|
Post by chezzy on Mar 23, 2017 10:43:52 GMT
My phone is Lenovo A7000-a and Android 6 
|
|
|
Post by AnkuLua on Mar 23, 2017 11:44:17 GMT
Is your device rooted? Use daemon instead. If both fail, then it's possible AnkuLua is not compatible with your device. It's also possible that root destroy the compatibility.
|
|
|
Post by chezzy on Mar 23, 2017 12:05:26 GMT
Yeah its rooted, Ill check out what I can do about it.
|
|
|
Post by chezzy on Mar 23, 2017 23:38:38 GMT
So I have installed daemon, now Im not getting any error, but It just does not type anything, while print still shows the data I want.
|
|
|
Post by AnkuLua on Mar 24, 2017 0:42:46 GMT
Did you say that it works as following? type("Hello")
How about line = "Hello" type(line)
|
|
|
Post by chezzy on Mar 24, 2017 15:24:43 GMT
When written like that, it works, it just does not work when I use this: line = fh:read()
|
|
|
Post by AnkuLua on Mar 24, 2017 23:45:01 GMT
Is it possible because the text from the file? Try putting "Hello" on the first line of the file.
|
|
|
Post by chezzy on Mar 25, 2017 20:25:37 GMT
I have decided to try different approach, now I use tables instead of trying to get data from file and it works perfectly.
|
|