|
Post by AnkuLua on Sept 4, 2015 2:36:28 GMT
It's not easy to write code in Android device. It's even harder to capture part of the screen into image files. Therefore, I suggest to develop script and capture images on PC. Then sync to Android and run it. Step one: Android SimulatorBecause AnkuLua comarison images files are resolution related. And the speed is faster if the images are captured under lower resolution. 1280x720 should be enough for most cases. There is another benefit for developing AnkuLua script on emulators. You can try different resolutions quickly. Step two: Image captureThere are many Windows snap tools. If you don't have one, I recommend MWSnap. Because image matching is the basic operation for AnkuLua, the saved image format should be lossless. In short, please save the image as png format. For MWSnap, go through Tools --> Settings --> Auto-saving and set format to png. It's also better to enable "Auto Saving is active" and "prompt for each filename". Step three: sync filesAfter capturing images, choose any preferred editor to write your lua script. To sync files between PC and Android, SyncMe is one of the best. Suggest to sync the entire "AnkuLua" directory between PC and /sdcard on Android. Note: Do not use Blue Stacks 2 share folder. For some unknown reasons, the files are corrupted during the transfer from PC to BS2. Now, you are ready to run the script on Android. Enjoy it. [Next]: IntelliJ IDEA: the recommended editor[Previous]: First Example: the usage of AnkuLua in real application[Home]: AnkuLua Introduction
|
|
|
Post by AnkuLua on Sept 21, 2015 3:17:52 GMT
One user told AnkuLua that he cannot make his script works. After many email back and forth, we found the problem is from cropping screen shot. The user use two methods to crop screenshot, team viewer and device screenshot then cropping on pc. But the view of the screenshot on pc is not 100%. It works perfectly after cropping on 100% view.
Make sure cropping on 100% view.
|
|
|
Post by bazinga on Oct 8, 2015 14:55:41 GMT
How do I use "require" properly? Lua cannot find my script even though it is running in the same directory.
tried this...
insert code here local scriptPath = arg[0] local dir = string.match(scriptPath, '^.*/') package.path = package.path .. ";" .. dir .. '?.lua'
require(polygon)
but there is no arg
Thanks
|
|
|
Post by AnkuLua on Oct 8, 2015 15:10:28 GMT
arg[0] is not supported in AnkuLua AnkuLua provide scriptPath() method to provide the path of the script. Try this.
local dir = scriptPath() package.path = package.path .. ";" .. dir .. '?.lua' print(package.path) require(polygon)
|
|
|
Post by kaka90 on Jan 3, 2016 10:01:15 GMT
My mobile screan resolution is 480*854 if I want to make script using bluestack I have to change resolution of bluestack according to abdroid screan resolution.
|
|
|
Post by AnkuLua on Jan 3, 2016 13:00:02 GMT
My mobile screan resolution is 480*854 if I want to make script using bluestack I have to change resolution of bluestack according to abdroid screan resolution. Basically, the answer is no. You can develop script on bluestacks with different resolution. The script will run correctly on your device. The resolution 480x854 is strange. What's your device model?
|
|
|
Post by kaka90 on Jan 3, 2016 14:23:59 GMT
My mobile screan resolution is 480*854 if I want to make script using bluestack I have to change resolution of bluestack according to abdroid screan resolution. Basically, the answer is no. You can develop script on bluestacks with different resolution. The script will run correctly on your device. The resolution 480x854 is strange. What's your device model? lenovo A328
|
|
|
Post by cryzed on Jan 15, 2016 21:01:58 GMT
When using BlueStacks and attempting to run a FTP server from within Android for synchronization instead, you are given an IP address. On my Windows 7 system, connecting to this IP address with WinSCP unfortunately doesn't work (TimeOut) -- but using FTP with WinSCP's synchronization feature would be easier and faster than the currently suggested solution. Have you managed to connect to a BlueStacks FTP server?
EDIT: I actually found a better way, which you might want to add to the post. At least when using BlueStacks 2, a shared folder for the VirtualBox machine (I assume) is automatically created. On the emulator it is accessible via the "/sdcard/windows/BstSharedFolder" path and mirrored on the Windows host machine at "C:\ProgramData\BlueStacks\UserData\SharedFolder". Simply creating your AnkuLua project within that folder on the windows machine and then using the correct path in AnkuLua, allows for instantaneous changes to the files within the emulator and removes the slight delay between updates or manual steps involved when using SyncMe or similar solutions. At least when using Sublime Text you want to enable "atomic_saves" for your project, incremental saves seem to corrupt the file on Android's side until manually deleted and saved again.
|
|
|
Post by AnkuLua on Jan 16, 2016 1:48:33 GMT
When using BlueStacks and attempting to run a FTP server from within Android for synchronization instead, you are given an IP address. On my Windows 7 system, connecting to this IP address with WinSCP unfortunately doesn't work (TimeOut) -- but using FTP with WinSCP's synchronization feature would be easier and faster than the currently suggested solution. Have you managed to connect to a BlueStacks FTP server? EDIT: I actually found a better way, which you might want to add to the post. At least when using BlueStacks 2, a shared folder for the VirtualBox machine (I assume) is automatically created. On the emulator it is accessible via the "/sdcard/windows/BstSharedFolder" path and mirrored on the Windows host machine at "C:\ProgramData\BlueStacks\UserData\SharedFolder". Simply creating your AnkuLua project within that folder on the windows machine and then using the correct path in AnkuLua, allows for instantaneous changes to the files within the emulator and removes the slight delay between updates or manual steps involved when using SyncMe or similar solutions. At least when using Sublime Text you want to enable "atomic_saves" for your project, incremental saves seem to corrupt the file on Android's side until manually deleted and saved again. We never managed to connect to a BlueStacks FTP server. Excellent. Already add your information. Do you know any solution to change the BS2 resolution?
|
|
|
Post by cryzed on Jan 16, 2016 1:57:33 GMT
The BS2 resolution can be changed the same way already described as in your original post, i.e. importing the registry keys and then starting BlueStacks. Additionally if proper root support is wanted, you can download the KingRoot APK file, open it via the BlueStack 2 interface and install it. It allows you to root the emulator with a single key-press (due to an existing root exploit within the ROM) and then use the root mode within AnkuLua for easy development.
|
|
|
Post by AnkuLua on Jan 16, 2016 2:09:23 GMT
The BS2 resolution can be changed the same way already described as in your original post, i.e. importing the registry keys and then starting BlueStacks. Additionally if proper root support is wanted, you can download the KingRoot APK file, open it via the BlueStack 2 interface and install it. It allows you to root the emulator with a single key-press (due to an existing root exploit within the ROM) and then use the root mode within AnkuLua for easy development. Unfortunately, the register file doesn't work on our BS2. Thanks again for the root information.
|
|
|
Post by cryzed on Jan 16, 2016 2:11:34 GMT
That's strange, it's the exact same registry keys. Is it possible that you have both versions installed and BlueStacks creates a different registry section in that case, to prevent conflicting settings?
|
|
|
Post by AnkuLua on Jan 16, 2016 2:22:22 GMT
That's strange, it's the exact same registry keys. Is it possible that you have both versions installed and BlueStacks creates a different registry section in that case, to prevent conflicting settings? OK. We upgraded from BS1. Will try to uninstall first.
|
|
|
Post by dragonscale15 on Mar 21, 2017 14:49:46 GMT
All steps done as in the discription How can i autofarm Runes in Summoners war now lol? I just dont understand it .Could you make some videos? It is realy very difficult to understand how it works for people ,who doent have any clue in informatics
Ty
|
|
srl
New Member
Posts: 3
|
Post by srl on May 19, 2017 5:37:03 GMT
hy.. my pc hard to run bluestack,, so i try search, and found memu in android emulator.. and in memu when im try to change resolution there is 3 field. there is Width, Height and Dpi. so whats dpi you all use in emulator? just want to know for develop my first own script. thanks in advance
|
|