mirror of
https://github.com/Goppier/FindingFeebas.git
synced 2026-03-21 17:55:02 -05:00
Initial commit
This commit is contained in:
parent
988e8c8d5e
commit
28ae5317ca
65
FeebasCoordinates.py
Normal file
65
FeebasCoordinates.py
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
FEEBAS_COORDINATES = [
|
||||
[0, 0],[0, 0],[0, 0],[0, 0],
|
||||
[18*16, 18*16], [18*16, 19*16], [19*16, 19*16], [16*16, 20*16], [17*16, 20*16], [18*16, 20*16], [19*16, 20*16],
|
||||
[17*16, 21*16], [18*16, 21*16], [19*16, 21*16], [17*16, 22*16], [18*16, 22*16], [19*16, 22*16], [17*16, 23*16],
|
||||
[18*16, 23*16], [19*16, 23*16], [17*16, 24*16], [18*16, 24*16], [19*16, 24*16], [17*16, 29*16], [18*16, 29*16],
|
||||
[19*16, 29*16], [17*16, 30*16], [18*16, 30*16], [19*16, 30*16], [16*16, 31*16], [17*16, 31*16], [18*16, 31*16],
|
||||
[19*16, 31*16], [20*16, 31*16], [16*16, 32*16], [17*16, 32*16], [18*16, 32*16], [19*16, 32*16], [20*16, 32*16],
|
||||
[16*16, 35*16], [17*16, 35*16], [18*16, 35*16], [19*16, 35*16],
|
||||
[20*16, 35*16], [16*16, 36*16], [17*16, 36*16], [18*16, 36*16], [19*16, 36*16], [20*16, 36*16], [16*16, 37*16],
|
||||
[17*16, 37*16], [18*16, 37*16], [19*16, 37*16], [20*16, 37*16],
|
||||
[16*16, 38*16], [17*16, 38*16], [18*16, 38*16], [19*16, 38*16], [20*16, 38*16], [21*16, 38*16], [22*16, 38*16],
|
||||
[16*16, 39*16], [17*16, 39*16], [18*16, 39*16], [19*16, 39*16], [20*16, 39*16], [21*16, 39*16], [22*16, 39*16],
|
||||
[16*16, 40*16], [17*16, 40*16], [18*16, 40*16], [19*16, 40*16], [20*16, 40*16], [21*16, 40*16], [22*16, 40*16],
|
||||
[16*16, 41*16], [17*16, 41*16], [18*16, 41*16], [19*16, 41*16], [20*16, 41*16], [21*16, 41*16], [22*16, 41*16],
|
||||
[16*16, 42*16], [17*16, 42*16], [18*16, 42*16], [19*16, 42*16], [20*16, 42*16], [21*16, 42*16], [22*16, 42*16], [23*16, 42*16],
|
||||
[16*16, 43*16], [17*16, 43*16], [18*16, 43*16], [19*16, 43*16], [20*16, 43*16], [21*16, 43*16], [22*16, 43*16], [23*16, 43*16], [24*16, 43*16], [25*16, 43*16], [26*16, 43*16], [27*16, 43*16], [28*16, 43*16], [29*16, 43*16], [30*16, 43*16],
|
||||
[19*16, 44*16], [20*16, 44*16], [21*16, 44*16], [22*16, 44*16], [23*16, 44*16], [24*16, 44*16], [25*16, 44*16], [26*16, 44*16], [27*16, 44*16], [28*16, 44*16], [29*16, 44*16], [30*16, 44*16], [31*16, 44*16], [32*16, 44*16],
|
||||
[20*16, 45*16], [21*16, 45*16], [22*16, 45*16], [23*16, 45*16], [24*16, 45*16], [25*16, 45*16], [26*16, 45*16], [27*16, 45*16], [28*16, 45*16], [29*16, 45*16], [30*16, 45*16], [31*16, 45*16], [32*16, 45*16],
|
||||
[23*16, 46*16], [24*16, 46*16], [25*16, 46*16], [26*16, 46*16], [27*16, 46*16], [28*16, 46*16], [29*16, 46*16], [30*16, 46*16], [31*16, 46*16], [32*16, 46*16], [33*16, 46*16], [34*16, 46*16],
|
||||
[27*16, 47*16], [28*16, 47*16], [29*16, 47*16], [30*16, 47*16], [31*16, 47*16], [32*16, 47*16], [33*16, 47*16], [34*16, 47*16],
|
||||
[30*16, 48*16], [31*16, 48*16], [32*16, 48*16], [33*16, 48*16], [34*16, 48*16],
|
||||
[31*16, 49*16], [32*16, 49*16], [33*16, 49*16], [34*16, 49*16], [35*16, 49*16],
|
||||
[31*16, 50*16], [32*16, 50*16], [33*16, 50*16],
|
||||
[31*16, 51*16], [32*16, 51*16], [33*16, 51*16],
|
||||
[31*16, 52*16], [32*16, 52*16], [33*16, 52*16], [34*16, 52*16], [35*16, 52*16],
|
||||
[31*16, 53*16], [32*16, 53*16], [33*16, 53*16], [34*16, 53*16], [35*16, 53*16],
|
||||
[33*16, 54*16], [34*16, 54*16], [35*16, 54*16],
|
||||
[33*16, 55*16], [34*16, 55*16], [35*16, 55*16],
|
||||
[31*16, 56*16], [32*16, 56*16], [33*16, 56*16], [34*16, 56*16], [35*16, 56*16],
|
||||
[31*16, 57*16], [32*16, 57*16], [33*16, 57*16], [34*16, 57*16], [35*16, 57*16],
|
||||
[30*16, 58*16], [31*16, 58*16], [32*16, 58*16], [33*16, 58*16], [34*16, 58*16], [35*16, 58*16],
|
||||
[27*16, 59*16], [28*16, 59*16], [29*16, 59*16], [30*16, 59*16], [31*16, 59*16], [32*16, 59*16], [33*16, 59*16], [34*16, 59*16],
|
||||
[26*16, 60*16], [27*16, 60*16], [28*16, 60*16], [29*16, 60*16], [30*16, 60*16], [31*16, 60*16], [32*16, 60*16], [33*16, 60*16],
|
||||
[26*16, 61*16], [27*16, 61*16], [28*16, 61*16], [29*16, 61*16], [30*16, 61*16], [31*16, 61*16],
|
||||
[26*16, 62*16], [27*16, 62*16], [28*16, 62*16], [29*16, 62*16], [30*16, 62*16], [31*16, 62*16],
|
||||
[26*16, 63*16], [27*16, 63*16], [28*16, 63*16], [29*16, 63*16], [30*16, 63*16], [31*16, 63*16], [32*16, 63*16],
|
||||
[24*16, 64*16], [25*16, 64*16], [26*16, 64*16], [27*16, 64*16], [28*16, 64*16], [29*16, 64*16],
|
||||
[24*16, 65*16], [25*16, 65*16], [26*16, 65*16], [27*16, 65*16], [28*16, 65*16],
|
||||
[22*16, 66*16], [23*16, 66*16], [24*16, 66*16], [25*16, 66*16], [26*16, 66*16], [27*16, 66*16], [28*16, 66*16],
|
||||
[22*16, 67*16], [23*16, 67*16], [24*16, 67*16], [25*16, 67*16], [26*16, 67*16], [27*16, 67*16], [28*16, 67*16],
|
||||
[22*16, 68*16], [23*16, 68*16], [24*16, 68*16], [25*16, 68*16], [26*16, 68*16],
|
||||
[20*16, 69*16], [21*16, 69*16], [22*16, 69*16], [23*16, 69*16], [24*16, 69*16], [25*16, 69*16], [26*16, 69*16],
|
||||
[20*16, 70*16], [21*16, 70*16], [22*16, 70*16], [23*16, 70*16], [24*16, 70*16], [25*16, 70*16],
|
||||
[20*16, 71*16], [21*16, 71*16], [22*16, 71*16], [23*16, 71*16], [24*16, 71*16], [25*16, 71*16],
|
||||
[20*16, 72*16], [21*16, 72*16], [22*16, 72*16], [23*16, 72*16], [24*16, 72*16], [25*16, 72*16],
|
||||
[20*16, 73*16], [21*16, 73*16], [22*16, 73*16], [23*16, 73*16],
|
||||
[21*16, 74*16],
|
||||
[21*16, 75*16],
|
||||
[21*16, 83*16],[22*16, 83*16],[23*16, 83*16],
|
||||
[14*16, 98*16],
|
||||
[14*16, 99*16],
|
||||
[14*16, 100*16],[15*16, 100*16],[16*16, 100*16],[19*16, 100*16],[20*16, 100*16],[23*16, 100*16],[24*16, 100*16],
|
||||
[14*16, 101*16],[15*16, 101*16],[16*16, 101*16],[17*16, 101*16],[18*16, 101*16],[19*16, 101*16],[20*16, 101*16],[21*16, 101*16],[22*16, 101*16],[23*16, 101*16],[24*16, 101*16],
|
||||
[14*16, 102*16],[15*16, 102*16],[16*16, 102*16],[17*16, 102*16],[18*16, 102*16],[19*16, 102*16],[20*16, 102*16],[21*16, 102*16],[22*16, 102*16],[23*16, 102*16],[24*16, 102*16],
|
||||
[14*16, 103*16],[15*16, 103*16],[16*16, 103*16],[17*16, 103*16],[18*16, 103*16],[19*16, 103*16],[20*16, 103*16],[21*16, 103*16],[22*16, 103*16],[23*16, 103*16],[24*16, 103*16],
|
||||
[14*16, 104*16],[15*16, 104*16],[16*16, 104*16],[17*16, 104*16],[18*16, 104*16],[19*16, 104*16],[20*16, 104*16],[21*16, 104*16],[22*16, 104*16],[23*16, 104*16],[24*16, 104*16],[25*16, 104*16],
|
||||
[14*16, 105*16],[15*16, 105*16],[16*16, 105*16],[17*16, 105*16],[18*16, 105*16],[19*16, 105*16],[20*16, 105*16],[21*16, 105*16],[22*16, 105*16],[23*16, 105*16],[24*16, 105*16],[25*16, 105*16],
|
||||
[9*16, 106*16],[10*16, 106*16],[11*16, 106*16],[12*16, 106*16],[13*16, 106*16],[14*16, 106*16],[15*16, 106*16],[16*16, 106*16],[17*16, 106*16],[18*16, 106*16],[19*16, 106*16],[20*16, 106*16],[23*16, 106*16],[24*16, 106*16],[25*16, 106*16],
|
||||
[7*16, 107*16],[8*16, 107*16],[9*16, 107*16],[10*16, 107*16],[11*16, 107*16],[12*16, 107*16],[13*16, 107*16],[14*16, 107*16],[15*16, 107*16],[16*16, 107*16],[17*16, 107*16],[18*16, 107*16],[19*16, 107*16],[20*16, 107*16],[23*16, 107*16],[24*16, 107*16],[25*16, 107*16],
|
||||
[9*16, 108*16],[10*16, 108*16],[11*16, 108*16],[12*16, 108*16],[13*16, 108*16],[14*16, 108*16],[15*16, 108*16],[16*16, 108*16],[17*16, 108*16],[18*16, 108*16],[19*16, 108*16],[20*16, 108*16],[21*16, 108*16],[22*16, 108*16],[23*16, 108*16],[24*16, 108*16],[25*16, 108*16],
|
||||
[9*16, 109*16],[10*16, 109*16],[11*16, 109*16],[12*16, 109*16],[13*16, 109*16],[14*16, 109*16],[15*16, 109*16],[16*16, 109*16],[17*16, 109*16],[18*16, 109*16],[19*16, 109*16],[20*16, 109*16],[21*16, 109*16],[22*16, 109*16],[23*16, 109*16],
|
||||
[8*16, 110*16],[9*16, 110*16],[10*16, 110*16],[11*16, 110*16],[12*16, 110*16],[13*16, 110*16],[14*16, 110*16],[15*16, 110*16],[16*16, 110*16],[17*16, 110*16],[18*16, 110*16],[19*16, 110*16],
|
||||
[8*16, 111*16],[9*16, 111*16],[10*16, 111*16],[11*16, 111*16],[12*16, 111*16],
|
||||
[7*16, 112*16],[8*16, 112*16]
|
||||
]
|
||||
BIN
Recources/Feebas_Spot_Indicator.png
Normal file
BIN
Recources/Feebas_Spot_Indicator.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 133 B |
BIN
Recources/Hoenn_Route_119_E.png
Normal file
BIN
Recources/Hoenn_Route_119_E.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
24
blendTest.py
Normal file
24
blendTest.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from PIL import Image
|
||||
|
||||
photo_image_path = "Hoenn_Route_119_E.png"
|
||||
watermark_image_path = "RED.png"
|
||||
|
||||
image = Image.open(photo_image_path).convert('RGBA')
|
||||
watermark = Image.open(watermark_image_path).convert('RGBA')
|
||||
layer = Image.new('RGBA', image.size, (0, 0, 0, 0))
|
||||
layer.paste(watermark, (0, 0))
|
||||
layer.paste(watermark, (32, 0))
|
||||
|
||||
# Create a copy of the layer
|
||||
layer2 = layer.copy()
|
||||
|
||||
# Put alpha on the copy
|
||||
layer2.putalpha(180)
|
||||
|
||||
# merge layers with mask
|
||||
layer.paste(layer2, layer)
|
||||
|
||||
|
||||
result = Image.alpha_composite(image, layer)
|
||||
|
||||
result.show()
|
||||
173
feebasCalcs.py
Normal file
173
feebasCalcs.py
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
from tkinter import ttk
|
||||
from tkinter import *
|
||||
|
||||
from trendyPhrase import group_conditions, group_lifestyles, group_hobbies, DewfordTrend
|
||||
from FeebasCoordinates import FEEBAS_COORDINATES
|
||||
|
||||
|
||||
|
||||
|
||||
class FeebasCalculator:
|
||||
def __init__(self, trainer_id, lottery_number, trendy_phrase_1, trendy_phrase_2, is_rs):
|
||||
self.is_feebas_found = False
|
||||
if not((trendy_phrase_1 in group_conditions) and ((trendy_phrase_2 in group_lifestyles) or (trendy_phrase_2 in group_hobbies))):
|
||||
return
|
||||
if(trainer_id == '' or lottery_number == ''):
|
||||
return
|
||||
self.trainer_id = int(trainer_id)
|
||||
self.secret_id = 0
|
||||
self.lottery_number = int(lottery_number)
|
||||
self.trendy_phrase_1 = trendy_phrase_1
|
||||
self.trendy_phrase_2 = trendy_phrase_2
|
||||
self.starting_seeds = []
|
||||
self.calculated_feebas_spots = []
|
||||
self.rng_counter = 0
|
||||
self.vblank = 0xFFFFFFFF
|
||||
|
||||
if(is_rs):
|
||||
self.seedRng(0x5A0)
|
||||
else:
|
||||
self.seedRng(self.trainer_id)
|
||||
|
||||
self.findFeebasStartingPoint()
|
||||
for x in self.starting_seeds:
|
||||
self.findFeebasSpots(x)
|
||||
if(self.is_feebas_found == True):
|
||||
break
|
||||
if(self.is_feebas_found == False):
|
||||
print("FUCK")
|
||||
return
|
||||
|
||||
self.seedRng(self.dewford_trends[0].getRandomValue())
|
||||
|
||||
x = 0
|
||||
while(x != 6):
|
||||
feebas_id = self.getFeebasRandomValue() % 447
|
||||
if(feebas_id == 0):
|
||||
feebas_id = 447
|
||||
if(feebas_id >= 4):
|
||||
self.calculated_feebas_spots.append(FEEBAS_COORDINATES[feebas_id])
|
||||
x += 1
|
||||
|
||||
return
|
||||
|
||||
def isFeebasFound(self):
|
||||
return self.is_feebas_found
|
||||
|
||||
def getFeebasSpotCoordinates(self):
|
||||
return self.calculated_feebas_spots
|
||||
|
||||
def getSecretId(self):
|
||||
return self.secret_id
|
||||
|
||||
def seedRng(self, seed):
|
||||
self.random_value = seed & 0xFFFFFFFF
|
||||
|
||||
def getFeebasRandomValue(self):
|
||||
self.random_value = 0x41C64E6D * self.random_value + 0x00003039
|
||||
self.random_value &= 0xFFFFFFFF
|
||||
return (self.random_value >> 16)
|
||||
|
||||
def getRandomValue(self):
|
||||
self.random_value = 0x41C64E6D * self.random_value + 0x00006073
|
||||
self.random_value &= 0xFFFFFFFF
|
||||
self.rng_counter += 1
|
||||
if(self.vblank == self.rng_counter):
|
||||
self.random_value = 0x41C64E6D * self.random_value + 0x00006073
|
||||
self.random_value &= 0xFFFFFFFF
|
||||
self.rng_counter += 1
|
||||
#print(self.vblank)
|
||||
return (self.random_value >> 16)
|
||||
|
||||
def getPreviousRandomValue(self):
|
||||
self.random_value = 0xEEB9EB65 * self.random_value + 0x0A3561A1;
|
||||
self.random_value &= 0xFFFFFFFF
|
||||
return (self.random_value >> 16)
|
||||
|
||||
def findFeebasStartingPoint(self):
|
||||
self.starting_seeds = []
|
||||
for x in range(20000):
|
||||
random_value = self.getRandomValue()
|
||||
if(random_value == self.lottery_number):
|
||||
self.starting_seeds.append(self.random_value)
|
||||
print(self.starting_seeds)
|
||||
|
||||
def findFeebasSpots(self, lottery_seed):
|
||||
reverse_steps = 50
|
||||
lottery_no = 0
|
||||
final_trendy_prase = ["NO", "FEEBAS"]
|
||||
while((self.lottery_number != lottery_no) or (final_trendy_prase[0] != self.trendy_phrase_1 or final_trendy_prase[1] != self.trendy_phrase_2)):
|
||||
self.seedRng(lottery_seed)
|
||||
#print(lottery_seed)
|
||||
self.rng_counter = 0
|
||||
for x in range(reverse_steps):
|
||||
self.getPreviousRandomValue()
|
||||
self.nameItLaterGAMER()
|
||||
|
||||
final_trendy_prase = self.dewford_trends[0].getPhrase()
|
||||
|
||||
lottery_no = self.getRandomValue()
|
||||
|
||||
reverse_steps -= 1
|
||||
if(reverse_steps < 30):
|
||||
print("UGH")
|
||||
return
|
||||
print("FOUND!!!!!")
|
||||
print(self.dewford_trends[0].getRandomValue())
|
||||
self.is_feebas_found = True
|
||||
|
||||
def nameItLaterGAMER(self):
|
||||
self.secret_id = self.getRandomValue()
|
||||
print(self.secret_id)
|
||||
self.getRandomValue()
|
||||
self.getRandomValue()
|
||||
self.getRandomValue()
|
||||
self.dewford_trends = []
|
||||
for x in range(5):
|
||||
new_trend = DewfordTrend()
|
||||
phrase_1 = group_conditions[self.getRandomValue() % len(group_conditions)]
|
||||
if(self.getRandomValue() & 1 == 1):
|
||||
phrase_2 = group_lifestyles[self.getRandomValue() % len(group_lifestyles)]
|
||||
else:
|
||||
phrase_2 = group_hobbies[self.getRandomValue() % len(group_hobbies)]
|
||||
new_trend.setPhrase(phrase_1, phrase_2)
|
||||
#print(phrase_1)
|
||||
new_trend.setIsGainingTrendiness(self.getRandomValue() & 1)
|
||||
|
||||
rando = self.getRandomValue() % 98
|
||||
if (rando > 50):
|
||||
rando = self.getRandomValue() % 98
|
||||
if (rando > 80):
|
||||
rando = self.getRandomValue() % 98
|
||||
|
||||
new_trend.setMaxTrendiness(rando + 30)
|
||||
new_trend.setTrendiness((self.getRandomValue() % (rando + 1)) + 30)
|
||||
new_trend.setRandomValue(self.getRandomValue())
|
||||
|
||||
self.dewford_trends.append(new_trend)
|
||||
self.sortTrends()
|
||||
|
||||
|
||||
def sortTrends(self):
|
||||
for x in range(5):
|
||||
y = x + 1
|
||||
while(y < 5):
|
||||
if(self.compareTrends(y, x)):
|
||||
self.SWAP(self.dewford_trends, y, x)
|
||||
y += 1
|
||||
|
||||
def compareTrends(self, a, b):
|
||||
if(self.dewford_trends[a].getTrendiness() > self.dewford_trends[b].getTrendiness()):
|
||||
return True
|
||||
if(self.dewford_trends[a].getTrendiness() < self.dewford_trends[b].getTrendiness()):
|
||||
return False
|
||||
if(self.dewford_trends[a].getMaxTrendiness() > self.dewford_trends[b].getMaxTrendiness()):
|
||||
return True
|
||||
if(self.dewford_trends[a].getMaxTrendiness() < self.dewford_trends[b].getMaxTrendiness()):
|
||||
return False
|
||||
|
||||
return (self.getRandomValue() & 1)
|
||||
|
||||
def SWAP(self, list, pos1, pos2):
|
||||
list[pos1], list[pos2] = list[pos2], list[pos1]
|
||||
return list
|
||||
231
main.py
Normal file
231
main.py
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
from tkinter import ttk
|
||||
from tkinter import *
|
||||
from ttkwidgets.autocomplete import AutocompleteCombobox
|
||||
from feebasCalcs import FeebasCalculator
|
||||
|
||||
from trendyPhrase import group_conditions, group_lifestyles, group_hobbies
|
||||
|
||||
# pip install pillow
|
||||
from PIL import Image, ImageTk
|
||||
|
||||
|
||||
class Route119:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.canvas = Canvas(self.root, width=320, height=560, bg="white")
|
||||
image = Image.open('./Recources/Hoenn_Route_119_E.png')
|
||||
self.render = ImageTk.PhotoImage(image)
|
||||
img = self.canvas.create_image(192, 960, image=self.render)
|
||||
self.canvas.place(relx=0.25,rely=0.5,anchor=CENTER)
|
||||
|
||||
self.current_image_xpos = 192
|
||||
self.current_image_ypos = 960
|
||||
|
||||
self.current_mouse_xpos = 0
|
||||
self.current_mouse_ypos = 0
|
||||
|
||||
self.canvas.bind('<Button-1>', self.mousePressCanvas)
|
||||
self.canvas.bind("<B1-Motion>", self.mouseMove)
|
||||
|
||||
self.trendy_1 = group_conditions.copy()
|
||||
self.trendy_1.sort()
|
||||
|
||||
self.trendy_2 = group_lifestyles + group_hobbies
|
||||
self.trendy_2.sort()
|
||||
|
||||
self.var = IntVar()
|
||||
self.var.set(1)
|
||||
self.ruby_sapphire_checkbox = ttk.Checkbutton(self.root, text='Ruby/Sapphire',variable=self.var, onvalue=1, offvalue=0, command=self.rs_selected)
|
||||
self.ruby_sapphire_checkbox.place(x=320*0.55/2+320, y=150, anchor="center")
|
||||
|
||||
self.ruby_sapphire_checkbox = ttk.Checkbutton(self.root, text='Emerald',variable=self.var, onvalue=0, offvalue=1, command=self.rs_selected)
|
||||
self.ruby_sapphire_checkbox.place(x=320*1.45/2+320, y=150, anchor="center")
|
||||
# Create Dropdown menu
|
||||
self.drop1 = AutocompleteCombobox(root, completevalues=self.trendy_1)
|
||||
self.drop1.place(x=320*0.55/2+320, y=360, anchor="center")
|
||||
self.drop1.config(width = 17)
|
||||
|
||||
self.drop2 = AutocompleteCombobox(root, completevalues=self.trendy_2)
|
||||
self.drop2.place(x=320*1.45/2+320, y=360, anchor="center")
|
||||
self.drop2.config(width = 17)
|
||||
|
||||
vcmd = (self.root.register(self.validateNumber), '%d', '%i', '%P', '%s', '%S', '%v', '%V', '%W')
|
||||
|
||||
tid_label = ttk.Label(root, text='Trainer ID')
|
||||
tid_label.place(x=320*1.5/7+320, y=200, anchor="w")
|
||||
|
||||
sv = StringVar()
|
||||
sv.trace("w", lambda name, index, mode, sv=sv: self.maxNumberCallback(sv, 0xFFFF, 0))
|
||||
self.tid_entry = ttk.Entry(root, validate="key", validatecommand=vcmd, textvariable=sv, width=10)
|
||||
self.tid_entry.place(x=320*3.5/7+320, y=200, anchor="w")
|
||||
|
||||
lot_label = ttk.Label(root, text='Lottery No.')
|
||||
lot_label.place(x=320*1.5/7+320, y=225, anchor="w")
|
||||
|
||||
sv = StringVar()
|
||||
sv.trace("w", lambda name, index, mode, sv=sv: self.maxNumberCallback(sv, 0xFFFF, 1))
|
||||
self.lot_enrty = ttk.Entry(root, validate="key", validatecommand=vcmd, textvariable=sv, width=10)
|
||||
self.lot_enrty.place(x=320*3.5/7+320, y=225, anchor="w")
|
||||
|
||||
sid_label = ttk.Label(root, text='Secret ID')
|
||||
sid_label.place(x=320*1.5/7+320, y=250, anchor="w")
|
||||
|
||||
self.sid_entry = ttk.Label(root, text='')
|
||||
self.sid_entry.place(x=320*3.5/7+320, y=250, anchor="w")
|
||||
|
||||
calc_button = ttk.Button(root, text='Calculate', command=self.calculateFeebasSpots, state= NORMAL)
|
||||
calc_button.place(x=320*2/7+320, y=430, anchor="center")
|
||||
clear_button = ttk.Button(root, text='Clear', command=self.clearFeebasSpots, state= NORMAL)
|
||||
clear_button.place(x=320*5/7+320, y=430, anchor="center")
|
||||
|
||||
self.feebas_spot_buttons = []
|
||||
|
||||
spot_button = ttk.Button(root, text='1', command= lambda: self.goToFeebasSpot(0), state= DISABLED, width=4)
|
||||
spot_button.place(x=320/7+320, y=500, anchor="center")
|
||||
self.feebas_spot_buttons.append(spot_button)
|
||||
|
||||
spot_button = ttk.Button(root, text='2', command= lambda: self.goToFeebasSpot(1), state= DISABLED, width=4)
|
||||
spot_button.place(x=320*2/7+320, y=500, anchor="center")
|
||||
self.feebas_spot_buttons.append(spot_button)
|
||||
|
||||
spot_button = ttk.Button(root, text='3', command= lambda: self.goToFeebasSpot(2), state= DISABLED, width=4)
|
||||
spot_button.place(x=320*3/7+320, y=500, anchor="center")
|
||||
self.feebas_spot_buttons.append(spot_button)
|
||||
|
||||
spot_button = ttk.Button(root, text='4', command= lambda: self.goToFeebasSpot(3), state= DISABLED, width=4)
|
||||
spot_button.place(x=320*4/7+320, y=500, anchor="center")
|
||||
self.feebas_spot_buttons.append(spot_button)
|
||||
|
||||
spot_button = ttk.Button(root, text='5', command= lambda: self.goToFeebasSpot(4), state= DISABLED, width=4)
|
||||
spot_button.place(x=320*5/7+320, y=500, anchor="center")
|
||||
self.feebas_spot_buttons.append(spot_button)
|
||||
|
||||
spot_button = ttk.Button(root, text='6', command= lambda: self.goToFeebasSpot(5), state= DISABLED, width=4)
|
||||
spot_button.place(x=320*6/7+320, y=500, anchor="center")
|
||||
self.feebas_spot_buttons.append(spot_button)
|
||||
|
||||
def goToFeebasSpot(self, spot_id):
|
||||
calculated_spots = self.feebas_calcs.getFeebasSpotCoordinates()
|
||||
# x(0) = 480
|
||||
# x(640) = -160
|
||||
# y{0) = 1400
|
||||
# y(2240) = -840
|
||||
|
||||
self.current_image_xpos = (640 - calculated_spots[spot_id][0] - 160)
|
||||
self.current_image_ypos = (2240 - calculated_spots[spot_id][1] - 840)
|
||||
if(self.current_image_xpos > 16*20):
|
||||
self.current_image_xpos = 16*20
|
||||
elif(self.current_image_xpos < 0):
|
||||
self.current_image_xpos = 0
|
||||
if(self.current_image_ypos > 16*60):
|
||||
self.current_image_ypos = 16*60
|
||||
elif(self.current_image_ypos < -16*12):
|
||||
self.current_image_ypos = -16*12
|
||||
|
||||
img = self.canvas.create_image(self.current_image_xpos, self.current_image_ypos, image=self.render)
|
||||
|
||||
def calculateFeebasSpots(self):
|
||||
self.feebas_calcs = FeebasCalculator(self.tid_entry.get(), self.lot_enrty.get(), self.drop1.get(), self.drop2.get(), self.var.get())
|
||||
|
||||
if(self.feebas_calcs.isFeebasFound() == False):
|
||||
self.root.bell()
|
||||
return
|
||||
|
||||
image = Image.open("./Recources/Hoenn_Route_119_E.png").convert('RGBA')
|
||||
watermark = Image.open("./Recources/Feebas_Spot_Indicator.png").convert('RGBA')
|
||||
layer = Image.new('RGBA', image.size, (0, 0, 0, 0))
|
||||
print(self.feebas_calcs.getSecretId())
|
||||
self.sid_entry.config(text=str(self.feebas_calcs.getSecretId()))
|
||||
calculated_spots = self.feebas_calcs.getFeebasSpotCoordinates()
|
||||
for xy in calculated_spots:
|
||||
layer.paste(watermark, (xy[0], xy[1]))
|
||||
xy = xy[:2]
|
||||
layer2 = layer.copy()
|
||||
layer2.putalpha(180)
|
||||
layer.paste(layer2, layer)
|
||||
result = Image.alpha_composite(image, layer)
|
||||
self.render = ImageTk.PhotoImage(result)
|
||||
img = self.canvas.create_image(self.current_image_xpos, self.current_image_ypos, image=self.render)
|
||||
|
||||
for spot in self.feebas_spot_buttons:
|
||||
spot['state'] = "normal"
|
||||
|
||||
def clearFeebasSpots(self):
|
||||
image = Image.open('./Recources/Hoenn_Route_119_E.png')
|
||||
self.render = ImageTk.PhotoImage(image)
|
||||
img = self.canvas.create_image(self.current_image_xpos, self.current_image_ypos, image=self.render)
|
||||
|
||||
for spot in self.feebas_spot_buttons:
|
||||
spot['state'] = "disabled"
|
||||
|
||||
def mousePressCanvas(self, e):
|
||||
self.current_mouse_xpos = e.x
|
||||
self.current_mouse_ypos = e.y
|
||||
|
||||
def mouseMove(self, e):
|
||||
x_diff = self.current_mouse_xpos - e.x
|
||||
y_diff = self.current_mouse_ypos - e.y
|
||||
self.current_image_xpos -= x_diff
|
||||
self.current_image_ypos -= y_diff
|
||||
if(self.current_image_xpos > 16*20):
|
||||
self.current_image_xpos = 16*20
|
||||
elif(self.current_image_xpos < 0):
|
||||
self.current_image_xpos = 0
|
||||
if(self.current_image_ypos > 16*60):
|
||||
self.current_image_ypos = 16*60
|
||||
elif(self.current_image_ypos < -16*12):
|
||||
self.current_image_ypos = -16*12
|
||||
self.current_mouse_xpos = e.x
|
||||
self.current_mouse_ypos = e.y
|
||||
|
||||
img = self.canvas.create_image(self.current_image_xpos, self.current_image_ypos, image=self.render)
|
||||
|
||||
def maxNumberCallback(self, sv, max_number, id):
|
||||
current_number = 0
|
||||
try:
|
||||
current_number = int(sv.get())
|
||||
except ValueError:
|
||||
print("Nothing")
|
||||
|
||||
if current_number > max_number:
|
||||
if(id == 0):
|
||||
self.tid_entry.delete(0, END)
|
||||
self.tid_entry.insert(0, "65535")
|
||||
else:
|
||||
self.lot_enrty.delete(0, END)
|
||||
self.lot_enrty.insert(0, "65535")
|
||||
current_number = max_number
|
||||
self.root.bell()
|
||||
|
||||
def rs_selected(self):
|
||||
print("SELECTED")
|
||||
|
||||
def validateNumber(self, d, i, P, s, S, v, V, W):
|
||||
# %d = Type of action (1=insert, 0=delete, -1 for others)
|
||||
# %i = index of char string to be inserted/deleted, or -1
|
||||
# %P = value of the entry if the edit is allowed
|
||||
# %s = value of entry prior to editing
|
||||
# %S = the text string being inserted or deleted, if any
|
||||
# %v = the type of validation that is currently set
|
||||
# %V = the type of validation that triggered the callback
|
||||
# (key, focusin, focusout, forced)
|
||||
# %W = the tk name of the widget
|
||||
|
||||
# Disallow anything that isn't a number
|
||||
if S.isnumeric():
|
||||
return True
|
||||
else:
|
||||
self.root.bell()
|
||||
return False
|
||||
|
||||
|
||||
|
||||
root = Tk()
|
||||
|
||||
root.wm_title("Finding Feebas")
|
||||
root.geometry("640x560")
|
||||
root.resizable(0,0)
|
||||
|
||||
app = Route119(root)
|
||||
|
||||
root.mainloop()
|
||||
216
trendyPhrase.py
Normal file
216
trendyPhrase.py
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
class DewfordTrend:
|
||||
def __init__(self):
|
||||
self.trendiness = 0
|
||||
self.max_trendiness = 0
|
||||
self.is_gaining_trendiness = False
|
||||
self.random_value = 0
|
||||
self.easy_chat_words = ["", ""]
|
||||
|
||||
def setTrendiness(self, value):
|
||||
self.trendiness = value
|
||||
|
||||
def getTrendiness(self):
|
||||
return self.trendiness
|
||||
|
||||
def setMaxTrendiness(self, value):
|
||||
self.max_trendiness = value
|
||||
|
||||
def getMaxTrendiness(self):
|
||||
return self.max_trendiness
|
||||
|
||||
def setIsGainingTrendiness(self, value):
|
||||
self.is_gaining_trendiness = value
|
||||
|
||||
def getIsGainingTrendiness(self):
|
||||
return self.is_gaining_trendiness
|
||||
|
||||
def setRandomValue(self, value):
|
||||
self.random_value = value
|
||||
|
||||
def getRandomValue(self):
|
||||
return self.random_value
|
||||
|
||||
def setPhrase(self, phrase_1, phrase_2):
|
||||
self.easy_chat_words[0] = phrase_1
|
||||
self.easy_chat_words[1] = phrase_2
|
||||
|
||||
def getPhrase(self):
|
||||
return self.easy_chat_words
|
||||
|
||||
|
||||
group_conditions=[
|
||||
"HOT",
|
||||
"EXISTS",
|
||||
"EXCESS",
|
||||
"APPROVED",
|
||||
"HAS",
|
||||
"GOOD",
|
||||
"LESS",
|
||||
"MOMENTUM",
|
||||
"GOING",
|
||||
"WEIRD",
|
||||
"BUSY",
|
||||
"TOGETHER",
|
||||
"FULL",
|
||||
"ABSENT",
|
||||
"BEING",
|
||||
"NEED",
|
||||
"TASTY",
|
||||
"SKILLED",
|
||||
"NOISY",
|
||||
"BIG",
|
||||
"LATE",
|
||||
"CLOSE",
|
||||
"DOCILE",
|
||||
"AMUSING",
|
||||
"ENTERTAINING",
|
||||
"PERFECTION",
|
||||
"PRETTY",
|
||||
"HEALTHY",
|
||||
"EXCELLENT",
|
||||
"UPSIDEDOWN",
|
||||
"COLD",
|
||||
"REFRESHING",
|
||||
"UNAVOIDABLE",
|
||||
"MUCH",
|
||||
"OVERWHELMING",
|
||||
"FABULOUS",
|
||||
"ELSE",
|
||||
"EXPENSIVE",
|
||||
"CORRECT",
|
||||
"IMPOSSIBLE",
|
||||
"SMALL",
|
||||
"DIFFERENT",
|
||||
"TIRED",
|
||||
"SKILL",
|
||||
"TOP",
|
||||
"NONSTOP",
|
||||
"PREPOSTEROUS",
|
||||
"NONE",
|
||||
"NOTHING",
|
||||
"NATURAL",
|
||||
"BECOMES",
|
||||
"LUKEWARM",
|
||||
"FAST",
|
||||
"LOW",
|
||||
"AWFUL",
|
||||
"ALONE",
|
||||
"BORED",
|
||||
"SECRET",
|
||||
"MYSTERY",
|
||||
"LACKS",
|
||||
"BEST",
|
||||
"LOUSY",
|
||||
"MISTAKE",
|
||||
"KIND",
|
||||
"WELL",
|
||||
"WEAKENED",
|
||||
"SIMPLE",
|
||||
"SEEMS",
|
||||
"BADLY"
|
||||
]
|
||||
|
||||
group_lifestyles=[
|
||||
"CHORES",
|
||||
"HOME",
|
||||
"MONEY",
|
||||
"ALLOWANCE",
|
||||
"BATH",
|
||||
"CONVERSATION",
|
||||
"SCHOOL",
|
||||
"COMMEMORATE",
|
||||
"HABIT",
|
||||
"GROUP",
|
||||
"WORD",
|
||||
"STORE",
|
||||
"SERVICE",
|
||||
"WORK",
|
||||
"SYSTEM",
|
||||
"TRAIN",
|
||||
"CLASS",
|
||||
"LESSONS",
|
||||
"INFORMATION",
|
||||
"LIVING",
|
||||
"TEACHER",
|
||||
"TOURNAMENT",
|
||||
"LETTER",
|
||||
"EVENT",
|
||||
"DIGITAL",
|
||||
"TEST",
|
||||
"DEPT_STORE",
|
||||
"TELEVISION",
|
||||
"PHONE",
|
||||
"ITEM",
|
||||
"NAME",
|
||||
"NEWS",
|
||||
"POPULAR",
|
||||
"PARTY",
|
||||
"STUDY",
|
||||
"MACHINE",
|
||||
"MAIL",
|
||||
"MESSAGE",
|
||||
"PROMISE",
|
||||
"DREAM",
|
||||
"KINDERGARTEN",
|
||||
"LIFE",
|
||||
"RADIO",
|
||||
"RENTAL",
|
||||
"WORLD"
|
||||
]
|
||||
|
||||
group_hobbies=[
|
||||
"IDOL",
|
||||
"ANIME",
|
||||
"SONG",
|
||||
"MOVIE",
|
||||
"SWEETS",
|
||||
"CHAT",
|
||||
"CHILD_S_PLAY",
|
||||
"TOYS",
|
||||
"MUSIC",
|
||||
"CARDS",
|
||||
"SHOPPING",
|
||||
"CAMERA",
|
||||
"VIEWING",
|
||||
"SPECTATOR",
|
||||
"GOURMET",
|
||||
"GAME",
|
||||
"RPG",
|
||||
"COLLECTION",
|
||||
"COMPLETE",
|
||||
"MAGAZINE",
|
||||
"WALK",
|
||||
"BIKE",
|
||||
"HOBBY",
|
||||
"SPORTS",
|
||||
"SOFTWARE",
|
||||
"SONGS",
|
||||
"DIET",
|
||||
"TREASURE",
|
||||
"TRAVEL",
|
||||
"DANCE",
|
||||
"CHANNEL",
|
||||
"MAKING",
|
||||
"FISHING",
|
||||
"DATE",
|
||||
"DESIGN",
|
||||
"LOCOMOTIVE",
|
||||
"PLUSH_DOLL",
|
||||
"PC",
|
||||
"FLOWERS",
|
||||
"HERO",
|
||||
"NAP",
|
||||
"HEROINE",
|
||||
"FASHION",
|
||||
"ADVENTURE",
|
||||
"BOARD",
|
||||
"BALL",
|
||||
"BOOK",
|
||||
"FESTIVAL",
|
||||
"COMICS",
|
||||
"HOLIDAY",
|
||||
"PLANS",
|
||||
"TRENDY",
|
||||
"VACATION",
|
||||
"LOOK"
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user