-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathliveEditExp.lua
63 lines (52 loc) · 2.01 KB
/
liveEditExp.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--[[
On the warrior 'list', select a warrior in the list (don't actually click through to their page)
Run the script and the values should be shown on screen.
LeftArrowKey = decrease exp once per click
RightArrowKey = increase exp once per click
K = decrease exp once per frame while key is held
L = increase exp once per frame while key is held
To update the displayed link value, click the down then up arrow to deselect and reselect that pokemon.
I have already used this to get the exact exps for link X.00 values if this is what you want
https://pastebin.com/r6ys0P3Z
--]]
local selectedWarriorOffset = 0x22EA160
local warriorInfoOffset = 0x022797F0
local scenarioWarriorLength = 0x20
local scenarioPokemonOffset = 0x022724F8
local scenarioPokemonLength = 0x8
local lock = false
while true do
local selectedWarrior = memory.readbyte(selectedWarriorOffset)
local selectedWarriorInfoOffset = warriorInfoOffset + selectedWarrior * scenarioWarriorLength
local firstPokemon = memory.readword(selectedWarriorInfoOffset + 14)
local pokeOffset = scenarioPokemonOffset + firstPokemon * scenarioPokemonLength
local exp = memory.readword(pokeOffset + 2)
local keys= input.get()
if keys.K then
exp = exp - 1
memory.writeword(pokeOffset + 2, exp)
elseif keys.L then
exp = exp + 1
memory.writeword(pokeOffset + 2, exp)
else
if keys.left then
if lock == false then
lock = true
exp = exp - 1
memory.writeword(pokeOffset + 2, exp)
end
elseif keys.right then
if lock == false then
lock = true
exp = exp + 1
memory.writeword(pokeOffset + 2, exp)
end
else
lock = false
end
end
gui.text(10, 10, "Warrior: " .. tostring(selectedWarrior), "white")
gui.text(10, 20, "Pokemon: " .. tostring(firstPokemon), "white")
gui.text(10, 30, "EXP : " .. tostring(exp), "white")
emu.frameadvance()
end