Skip to content

Instantly share code, notes, and snippets.

@asiansteev
Created September 18, 2012 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asiansteev/3740975 to your computer and use it in GitHub Desktop.
Save asiansteev/3740975 to your computer and use it in GitHub Desktop.
Walk around in the grass
require "gd"
for i=1,5000 do
savestate.load(0)
for j=1,1000 do
r = math.random(10)
print(r)
if r == 1 then joypad.set(1, {up=1})
elseif r == 2 then joypad.set(1, {up=1, right=1})
elseif r == 3 then joypad.set(1, {right=1})
elseif r == 4 then joypad.set(1, {right=1, down=1})
elseif r == 5 then joypad.set(1, {down=1})
elseif r == 6 then joypad.set(1, {down=1, left=1})
elseif r == 7 then joypad.set(1, {left=1})
elseif r == 8 then joypad.set(1, {left=1, up=1})
else joypad.set(1, {})
end
emu.frameadvance()
end
gdstr = gui.gdscreenshot()
ss = string.format('C:\\Users\\steev\\Desktop\\shiny\\%d.png',i)
gd.createFromGdStr(gdstr):png(ss)
savestate.save(i)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment