Ejemplo n.º 1
0
 def update(self):
     canvas = self.canvas
     me = (-round(mem.readMemFloat(base + 0x1042B18,[0])*2)+self.win[0],
           -round(mem.readMemFloat(base + 0x1042B20,[0])*4)+self.win[1])
     me = (me[0] + self.off[0],me[1] + self.off[1])
     #print (me)
     canvas.create_rectangle(me[0], me[1], me[0]+2, me[1]+2, fill='#fff')
     for w in want:
         try:
             w['rare'] = mem.readMem(b+0xd0,[0])
             outline = self.rare[w['rare']]
             fill = self.tree[w['tier']]
             new = mem.readMem(w['base']+0xD4,[0])
             x = round(w['pos'][0]*2.0)+self.win[0]
             y = round(w['pos'][1]*2.0)+self.win[1]
             x,y=rotate((500,500),(x,y),-45)
             x2 = x + 20
             y2 = y + 20
             #print(x,y,w)
             if(new != w['charges']):
                 w['charges'] = new
                 fill = "#f00"
                 outline = '#f00'
             canvas.create_rectangle(x, y, x2, y2,
                 outline=outline, fill=fill, width=2)
             canvas.create_text(x+10, y+10, text=w['charges'])
         except:
             #print ("Unexpected error:", sys.exc_info()[0])
             pass
Ejemplo n.º 2
0
def adjustVector():
    global now
    now = (mem.readMemFloat(base + 0x1042B18,[0]),mem.readMemFloat(base + 0x1042B20,[0]))
    sys.stdout.write(str(now) + ',' + str(go) + '\r')
    sys.stdout.flush()
    dy = (now[1] - go[1])
    dx = -(go[0] - now[0])
    deg = math.atan2(dy,dx)
    random_movement((int(c[0]+math.cos(deg)*r),int(c[1]+math.sin(deg)*r)))
Ejemplo n.º 3
0
def getnextnode():
    treebase = []
    treebase.append(
        mem.readMem(base2 + 0x1F65EC, [0, 0x40, 0x48, 0x34, 0x14, 0x194, 0]))
    print(hex(treebase[0]))
    for t in treebase:
        nodes = mem.search(base, t)
        global want
        want = []
        for n in nodes:
            #print (hex(n))
            b = copy.deepcopy(n - 0x5c)
            y = mem.readMemFloat(b + 0x78, [0])
            x = mem.readMemFloat(b + 0x7C, [0])
            charges = mem.readMem(b + 0xD4, [0])
            tier = mem.readMem(b + 0xc8, [0])
            node = mem.readMem(b + 0x6c, [0])
            rare = mem.readMem(b + 0xd0, [0])
            if (not (math.isnan(x) or math.isnan(y)) and tier > 1):
                x = round(x)
                y = round(y)
                doc = {
                    'pos': (x, y),
                    'charges': charges,
                    'node': node,
                    'tier': tier,
                    'base': b,
                    'rare': rare
                }
                want.append(doc)
                print(doc)
    #print(len(want),len(nodes))
    return
    while 1:
        me = (mem.readMemFloat(base + 0x1042B18,
                               [0]), mem.readMemFloat(base + 0x1042B20, [0]))
        closest = (10000, 10000)
        closesti = 0
        for i in range(len(want)):
            #print(want[i])
            want[i]['charges'] = mem.readMem(want[i]['base'] + 0xD4, [0])
            if (distance(want[i]['pos'], me) < distance(closest, me)):
                closesti = i
                closest = want[i]['pos']
        sys.stdout.write(
            str(round(me[0])) + ',' + str(round(me[1])) + ' ' +
            str(round(want[closesti]['pos'][0])) + ',' +
            str(round(want[closesti]['pos'][1])) + ' ' + '\r')
        sleep(1)
Ejemplo n.º 4
0
def bankCallback():
    key.KeyStroke('i')
    key.KeyStroke('i')
    sleep(.1)
    load = mem.readMemFloat(base + 0x01044B24,[0,0x68,0x778,0xc,0x54,0x5c])
    if(load >= 98):
        repairAndBank()
Ejemplo n.º 5
0
 def update(self):
     canvas = self.canvas
     me = (
         -round(mem.readMemFloat(base + 0x1042B18, [0]) * self.mult[0]) +
         self.win[0], -round(
             mem.readMemFloat(base + 0x1042B20, [0]) * 2.0 * self.mult[1]) +
         self.win[1])
     #print (me)
     canvas.create_rectangle(0, 0, 2000, 1000, fill='#000')
     canvas.create_rectangle(me[0] - 4,
                             me[1] - 4,
                             me[0] + 4,
                             me[1] + 4,
                             fill='#fff')
     for w in want:
         try:
             outline = self.rare[w['rare']]
             fill = self.tree[w['tier']]
             new = mem.readMem(w['base'] + 0xD4, [0])
             x = round(w['pos'][0] * self.mult[0]) + self.win[0]
             y = round(w['pos'][1] * self.mult[1]) + self.win[1]
             x, y = rotate((self.win[0], self.win[1]), (x, y), -45)
             x2 = x + 20
             y2 = y + 20
             #print(x,y,w)
             if (new != w['charges']):
                 w['charges'] = new
                 fill = "#f00"
                 outline = '#f00'
             if (w['rare'] != 0):
                 canvas.create_rectangle(x,
                                         y,
                                         x2,
                                         y2,
                                         outline=outline,
                                         fill='',
                                         width=2)
             canvas.create_text(x + 10,
                                y + 10,
                                text=w['charges'],
                                fill=fill)
         except:
             #print ("Unexpected error:", sys.exc_info()[0])
             pass
Ejemplo n.º 6
0
 def gather(cur):
     click(cur)
     harvesting = True
     gathers = 0
     while harvesting:
         sleep(0.2)
         gathers += 1
         if(mem.readMemFloat(base + 0x109060C,[0,0x6f4,0xd8,0x1f4,0x5c8,0x318]) == 0 or gathers > 100):
             harvesting = False
             break
Ejemplo n.º 7
0
 def searchUntilCursor(maxserches,callback):
     searches = 0
     deg = 2*math.pi*random.random()
     while searches < maxserches:
         sleep(0.05)
         searches += 1
         r = searchrad + (10-20*random.random())
         #random_movement((int(c[0]),int(c[1])))
         cur = (int(c[0]+math.cos(deg)*r),int(c[1]+math.sin(deg)*r))
         random_movement(cur)
         sleep(0.05)
         #check if cursor diff 9 normal 24 is clickable
         if(mem.readMemFloat(base + 0x1093224,[0,0x18]) == 24):
             callback(cur)
             searches = 99999
         deg+=.4#~70deg
Ejemplo n.º 8
0
import mem
import msvcrt

filename = "test-r.txt"
done = False
todo = ['move', 'gather', 'bank', 'repair']
resource = 'move'
base = mem.BASE
while not done:
    if msvcrt.kbhit():
        char = msvcrt.getch().decode('UTF-8')
        if (char == ']'):
            x = mem.readMemFloat(base + 0x1042B18, [0])
            y = mem.readMemFloat(base + 0x1042B20, [0])
            with open(filename, "a") as f:
                f.write(str(x) + ',' + str(y) + ',' + str(resource) + '\n')
            print(x, y, resource)
        if (char == '['):
            done = True
        if (char == 'f'):
            filename = input('Input File Name: ')
        if (char == '\''):
            resource = todo[(todo.index(resource) + 1) % len(todo)]
            print('todo: ', resource)