Valatros Cheater Reputation: 1
Joined: 21 Nov 2015 Posts: 36
|
Posted: Mon Jan 30, 2017 3:00 pm Post subject: Deactivating and activating a timer in Auto Assembly |
|
|
Trying to make it so that when a box is enabled, tmer.enabled=True (my timer is named tmer, because I outright leeched the code from Zanzer), then when it's disabled tmer.Enabled=False. However, any time I do
Code: | [Enable]
luacall(tmer.Enabled=True)
[Disable]
luacall(tmer.Enabled=False) |
which strikes me as the most obvious way to accomplish this, the timer gives up and dies. If I just manually enable it via the lua window by typing in tmer.Enabled=True, or disable it by doing the opposite, it works fine. Can luacall not interact with timers? It works for messing with variables.
I'll put the LUA script below in case it becomes relevant, but since the timer is just giving up and dying I assume I'm doing something wrong in the auto assembly.
Code: | TPEnabled = 1
tmer = createTimer(nil, false)
local i=1
tmer.OnTimer = function(timer)
i = i + 1
TPRestore()
print ("Timer is Enabled. Tick number: ", i)
end
tmer.Interval = 2000
function TPRestore ()
--Below writes to Max TP
writeBytes("[citra-qt.exe+0032AB88]+E74",03,09)
writeBytes("[citra-qt.exe+0032AB88]+FE0",03,09)
writeBytes("[citra-qt.exe+0032AB88]+114C",03,09)
writeBytes("[citra-qt.exe+0032AB88]+12B8",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1424",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1590",03,09)
writeBytes("[citra-qt.exe+0032AB88]+16FC",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1868",03,09)
writeBytes("[citra-qt.exe+0032AB88]+19D4",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1B40",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1CAC",03,09)
--Below writes to Current TP
writeBytes("[citra-qt.exe+0032AB88]+E9A",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1006",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1172",03,09)
writeBytes("[citra-qt.exe+0032AB88]+12DE",03,09)
writeBytes("[citra-qt.exe+0032AB88]+144A",03,09)
writeBytes("[citra-qt.exe+0032AB88]+15B6",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1722",03,09)
writeBytes("[citra-qt.exe+0032AB88]+188E",03,09)
writeBytes("[citra-qt.exe+0032AB88]+19FA",03,09)
writeBytes("[citra-qt.exe+0032AB88]+1B66",03,09)
end
|
Note that the functions both work correctly when called via the script, so I'm not concerned with that; I just can't get the timer to respect my checkbox, and was hoping not to have it constantly ticking in the background if the cheats off.
Though, as a side question, the bytes immediately following Current TP are for exp; I was using writeinteger and constantly resetting my experience (d'oh) when it executed, because I guess writeinteger writes as a 4 byte? Is there a more intuitive way then manually writing in the bytes to equal 2307(it reads backwords, for some reason, in the memory; 03, 09 reads as 0903 in hex, which is 2307 (just... something absurdly high I used so that I'd know for a fact it was the cheat.)
|
|