Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local togglecamhack = false
- local toggleeditstats = false
- editStats = function()
- memory.writebyte(0xc5ee, 99) -- life
- memory.writebyte(0xc5f0, 99) -- hunger
- memory.writebyte(0xc5f2, 99) -- water
- memory.writebyte(0xc5f4, 0) -- fatigue
- memory.writebyte(0xc19d,1) -- time
- end
- displaceStuff = function()
- --overwrite cam pos:
- -- maze forest: -46 -72
- -- before cave: -60 +48
- -- swamp: -66 +96(or 80)
- ynew=ypos*8 - 66
- xnew=xpos*8 + 80
- memory.writebyte(0xc126,ynew) --ycam (mostly reliable)
- memory.writebyte(0xc127,xnew) --xcam (mostly reliable)
- --memory.writebyte(0xff86,ypos*8 - 64) --ymap (kinda glitchy)
- --draw player sprite displaced:
- memory.writebyte(0xdc04,80) --yleft1
- memory.writebyte(0xdc00,80) --yright1
- memory.writebyte(0xdd04,80) --yleft2
- memory.writebyte(0xdd00,80) --yright2 (1 and 2 alternate)
- memory.writebyte(0xdc05,72) --xleft1
- memory.writebyte(0xdc01,80) --xright1
- memory.writebyte(0xdd05,72) --xleft2
- memory.writebyte(0xdd01,80) --xright2 (1 and 2 alternate)
- end
- vba.registerbefore(function()
- status = ""
- if movie.active() == false then
- status = status .. "movie not recording!\n"
- end
- if toggleeditstats == true then
- status = status .. "stats are being edited!\n"
- end
- status = status .. vba.framecount() .. " : " ..vba.lagcount() .. "\n"
- gui.text(1,1,status,"yellow")
- end)
- while true do
- Daytimeid = memory.readbyte(0xc19e) --0 morn, 1 noon, 2 eve, 3 night
- if Daytimeid < 3 then Daytimelimit = 255 else Daytimelimit = 191 end
- if Daytimeid == 0 then Daytimename = "morning"
- elseif Daytimeid ==1 then Daytimename = "noon"
- elseif Daytimeid ==2 then Daytimename = "evening"
- elseif Daytimeid ==3 then Daytimename = "night" end
- Animalspawn = 120 - memory.readbyte(0xc6fd)
- Day = memory.readbyte(0xcb9c)
- if Day > 9 then Day = 10 + Day%16 end-- this works until Day 19. When day 20 is reached, this is wrong.
- Time = memory.readbyte(0xc19d)
- L = memory.readbyte(0xc5ee)
- H = memory.readbyte(0xc5f0)
- W = memory.readbyte(0xc5f2)
- F = memory.readbyte(0xc5f4)
- love = memory.readbyte(0xc5f6)
- Item1 = memory.readbyte(0xc700)
- Item2 = memory.readbyte(0xc701)
- Item3 = memory.readbyte(0xc702)
- Item4 = memory.readbyte(0xc703)
- Item5 = memory.readbyte(0xc704)
- Item6 = memory.readbyte(0xc705)
- Item7 = memory.readbyte(0xc706)
- Item8 = memory.readbyte(0xc707)
- Item9 = memory.readbyte(0xc708)
- Item10 = memory.readbyte(0xc709)
- Item11 = memory.readbyte(0xc70a)
- Item12 = memory.readbyte(0xc70b)
- -- player position
- xplayer = memory.readbytesigned(0xc5c1)
- yplayer = memory.readbytesigned(0xc5c0)
- -- player position on screen and in map
- xpos = memory.readbytesigned(0xd904)
- ypos = memory.readbytesigned(0xd905)
- --cam pos
- xcam = memory.readbytesigned(0xc127)
- ycam = memory.readbytesigned(0xc126)
- -- display
- gui.text(106,32, "X: " .. xpos)
- gui.text(106,40, "Y: " .. ypos)
- gui.text(106,56, "L: " .. L)
- gui.text(106,64, "H: " .. H)
- gui.text(106,72, "W: " .. W)
- gui.text(106,80, "F: " .. F)
- gui.text(106,88, "Love: " .. love)
- gui.text(106,96, "D " .. Day .. ", " .. Time .. "/" .. Daytimelimit)
- gui.text(106,104, "Animal " .. Animalspawn .."/120")
- gui.text(6,40, Item1)
- gui.text(6,48, Item2)
- gui.text(6,56, Item3)
- gui.text(6,64, Item4)
- gui.text(6,72, Item5)
- gui.text(6,80, Item6)
- gui.text(6,88, Item7)
- gui.text(6,96, Item8)
- gui.text(6,104, Item9)
- gui.text(6,112, Item10)
- gui.text(6,120, Item11)
- gui.text(6,128, Item12)
- -- camhack
- gui.opacity(0.5)
- gui.drawbox(100,8,152,18, "red", "white")
- gui.opacity(1)
- keytable = input.get() -- keys currently pressed on keyboard/mouse
- if keytable["xmouse"] > 100 and keytable["xmouse"] < 152 and keytable["ymouse"] > 8 and keytable["ymouse"] < 18 and keytable["leftclick"] == true then
- togglecamhack = not togglecamhack end
- if keytable["xmouse"] > 100 and keytable["xmouse"] < 152 and keytable["ymouse"] > 20 and keytable["ymouse"] < 30 and keytable["leftclick"] == true then
- toggleeditstats = not toggleeditstats end
- if togglecamhack then
- displaceStuff() -- edits cam location and edits location of the drawn character sprite
- gui.opacity(0.5)
- gui.drawbox(100,8,152,18, "#00ff00", "white")
- gui.opacity(1)
- gui.text(105,10,"camhack on")
- else
- gui.opacity(0.5)
- gui.drawbox(100,8,152,18, "red", "white")
- gui.opacity(1)
- gui.text(105,10,"camhack off")
- end
- -- edit stats
- if toggleeditstats then
- editStats()
- gui.opacity(0.5)
- gui.drawbox(100,20,152,30, "#00ff00", "white")
- gui.opacity(1)
- gui.text(105,22,"stats on")
- else
- gui.opacity(0.5)
- gui.drawbox(100,20,152,30, "red", "white")
- gui.opacity(1)
- gui.text(105,22,"stats off")
- end
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement