The Bytecode Club
Log inJoin the club
Programming

[LP][LF][DD]Clash of Clans Farming Bot Cracking and Coding

Started by Proxy · Oct 20, 2014

523 replies7,066,889 views
Nov 25, 2014#231

ok, thanks all for sharing your scripts, really amazing guys that we can help each others, im now using carpealexdiem script and its working fine on win8.1 64bit, thanks all, may GOD bless u all

Nov 25, 2014#232

Hello everybody, I'm ZxPwd and I just want to thank KeyWay for making
us a script however I don't know why I just didn't think of it myself.

But a lot of you have been having problem running it in windows 8 with Autoit.
I created a new version of the script in visual studio 2013 and works great!

I posted a preview below and i will be increasing it today after work.
I will be adding more features to it once I get the time.

Credits to KeyWay for the script!

Skype: ZxPwds

Screenshots:

This is awesome do you plan to release this? Would really like to see the source tweak lines used to authorize

Nov 25, 2014#233

Thanks Keeway and Xpiamchris, been messing around with autoit for a few days now and liking it so far. Used bits and pieces from both of your scripts to get a working script for my machine, this is working so far with an occasional hiccup now again where lfbot will wig out for a while pressing on random wall sections. (I think it fails to find my spell factory and is trying to train troops but hasn’t brought up the training window properly; this seems to only occur while using the script oddly enough not really sure why though.) It should be pretty easy for everyone to get a working script now by just plugging in parts of and or modifying the two scripts listed above, each function is well annotated. Thanks so much for your contributions guys, gives us a pretty decent temporary bot until something else gets released.

Nov 25, 2014#234

This thread is really coming along, glad to see everyone coming together and helping eachother. This is exactly what I wanted TBC to be about, thank you all.

:D

Nov 25, 2014#237

Thanks Keeway and Xpiamchris, been messing around with autoit for a few days now and liking it so far. Used bits and pieces from both of your scripts to get a working script for my machine, this is working so far with an occasional hiccup now again where lfbot will wig out for a while pressing on random wall sections. (I think it fails to find my spell factory and is trying to train troops but hasn’t brought up the training window properly; this seems to only occur while using the script oddly enough not really sure why though.) It should be pretty easy for everyone to get a working script now by just plugging in parts of and or modifying the two scripts listed above, each function is well annotated. Thanks so much for your contributions guys, gives us a pretty decent temporary bot until something else gets released.

Might be due to lag? Try adjusting sleep timers. If the issue is still a problem, let me know and I'll try debugging it with you.

Nov 25, 2014#238

Does anyone have any recommendations when it comes to the LF Robot settings for a TH10?

Thanks for any and all help,
Proxy.

hmm. try using balloons and minions on bully mode

btw
i figured out for what were those modes for:

Kill em' all - Attacks bases where it can think for 100%
Bully Mode - Attacks bases and tries to get the storages and like 50%-60% Destruction
Dead Fish - Tries to attack inactive bases with full collectors

Nov 25, 2014#239

hi new here can anyone pls make loot search only? thanks!
i found a code but i dont know how to use it here it is

#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Clash of Clans Auto Tool for Genymotion (VirtualBox Android VM)
"""
 
import os
import sys
import virtualbox
import subprocess
import cv2.cv as cv
import tesseract
import PIL.ImageOps as ImageOps
from time import sleep
from PIL import Image
 
# Genymotion Android VM name
genymotion_vm_name = "Google Nexus 7"
 
menu_text = """Choose function?
1. Keep Alive
2. Auto Search
3. Quit
"""
 
vbox = virtualbox.VirtualBox()
genymotion_vm = vbox.find_machine(genymotion_vm_name)
genymotion_session = genymotion_vm.create_session()
 
def keep_alive():
    while True:
        genymotion_session.console.mouse.put_mouse_event_absolute(360,223,0,0,0)
        genymotion_session.console.mouse.put_mouse_event_absolute(360,223,0,0,1)
        genymotion_session.console.mouse.put_mouse_event_absolute(360,223,0,0,0)
        sleep(60)
 
 
def auto_search():
    # click search button
    genymotion_session.console.mouse.put_mouse_event_absolute(660,280,0,0,0)
    genymotion_session.console.mouse.put_mouse_event_absolute(660,280,0,0,1)
    genymotion_session.console.mouse.put_mouse_event_absolute(660,280,0,0,0)
    sleep(12)
 
    # processing
    subprocess.call("adb shell screencap -p /sdcard/screen.png", shell=True)
    subprocess.call("adb pull /sdcard/screen.png", shell=True)
    im = Image.open("screen.png")
    #box = (60, 80, 165, 180)
    #box = (53, 72, 140, 165)
    box = (53, 72, 140, 130)
    loot = im.crop(box).convert('L')
    loot = ImageOps.invert(loot)
    loot.save("loot.png", "png")
 
    api = tesseract.TessBaseAPI()
    api.Init(".", "coc",tesseract.OEM_DEFAULT)
    api.SetVariable("tessedit_char_whitelist", "0123456789")
    api.SetPageSegMode(tesseract.PSM_AUTO)
 
    image = cv.LoadImage("loot.png", cv.CV_LOAD_IMAGE_UNCHANGED)
    tesseract.SetCvImage(image,api)
    text = api.GetUTF8Text()
    conf = api.MeanTextConf()
    total_loot = text.splitlines()
    gold_loot, elixir_loot = total_loot[0:2]
    gold_expr = gold_loot.find(" ") == 3 and int(gold_loot.split(" ")[0]) >= 180
    elixir_expr = elixir_loot.find(" ") == 3 and int(elixir_loot.split(" ")[0]) >= 180
 
    if gold_expr or elixir_expr:
        print gold_loot
        print elixir_loot
        subprocess.call("mplayer /home/mrtux/Downloads/gun.mp3", shell=True)
        api.End()
        return True
 
    return False
 
if __name__ == "__main__":
    try:
        while True:
            print menu_text
            answer = raw_input("Your choice: ")
            if answer == "1":
                try:
                    keep_alive()
                except:
                    pass
            elif answer == "2":
                try:
                    while auto_search() is False:
                        pass
                except:
                    pass
            elif answer == "3":
                sys.exit(0)
    except:
        sys.exit(1)

please make loot search for bluestacks! D:

Nov 25, 2014#240

Spadone wrote:

Proxy wrote:

Does anyone have any recommendations when it comes to the LF Robot settings for a TH10?

Thanks for any and all help,
Proxy.

hmm. try using balloons and minions on bully mode

btw
i figured out for what were those modes for:

Kill em' all - Attacks bases where it can think for 100%
Bully Mode - Attacks bases and tries to get the storages and like 50%-60% Destruction
Dead Fish - Tries to attack inactive bases with full collectors

Pretty sure you're mistaken.
Kill em' all - attacks all bases that meet criteria
Bully Mode - attacks only bases at least one TH level under
Dead Fish - raids any base with full collectors

Pretty sure this is how it works.
Also, been using giant, archer, etc nose and it's been going good. Planning on trying balloonion mode tonight.🙂

Thanks for all the contribution in the thread.
Proxy.

Got something to add?

Log in to post a reply.

Join the conversation