Created
May 30, 2020 02:29
-
-
Save tlindner/0199ee5ee64ab6fb1e3340856bfdece9 to your computer and use it in GitHub Desktop.
Robot to play Timberman on the Color Computer 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emu.pause() | |
j = manager:machine():ioport().ports[":joystick_rx"].fields["AD Stick X"] | |
b = manager:machine():ioport().ports[":joystick_buttons"].fields["Right Button 1"] | |
s = manager:machine().screens[":composite"] | |
a = 0 | |
c = 0 | |
function draw_hud() | |
if s:pixel(200,32) == 38424 then | |
if s:pixel(442,111) == 3087104 then | |
j:set_value(-100000) | |
else | |
j:set_value(100000) | |
end | |
a = a + 1 | |
if a > 2 then | |
c = 1 | |
else | |
c = 0 | |
end | |
if a == 5 then | |
a = 0 | |
end | |
b:set_value(c) | |
end | |
end | |
emu.register_frame(draw_hud, "frame") | |
emu.unpause() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well,
Here is my version of your code that will go on as long as you want it. :) or at least it worked on mine for an hour lol.