Posts for Chamale

Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
luckytyphlosion wrote:
If you really wanted the TAS to beat Red, you could always glitch a Level 1 Geodude and underflow it from level 1 to 100 (yes Experience Underflow works in GSC too). You still are beating RED, it's just that the battle ends instantly because you don't have any Pokemon in your party.
While this would work, Geodude would have to go up all 99 levels individually. Zanoab is right, it's faster to glitch one of your Pokémon to a higher level anyway.
against the Scyther, you 2HKO it without crits, doesn’t that mean that you could OHKO with a crit, considering crit is 2× damage? or does the boosted Rage attack not activate on the first turn, but only in the second, so in the first turn you can’t do as much damage as in 2 turns?
In Gen 1 and Gen 2 crit is slightly less than 2x damage, so I don't think it would be possible to get the OHKO with a crit there.
Post subject: Re: TASing multplayer continued: Using Gamepads....
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
YushiroGowa wrote:
So, I have two XBox 360 controllers that I got to work with my laptop, and I use them to play on my rr emulators. Now suppose I was going to TAS a two player game of River City Ransom, for example. How would I go about such using controllers and not the keyboard? I already know: - Make 1P and 2P directions the same for one part - Save states for optimization I suppose it'd be a bit difficult but not impossible. Suggestions?
I've done two-player TASes of River City Ransom, and I think it would be much more difficult. I usually do the recording by figuring out the best input sequence for one player for a short (30-120 frames) segment, then holding down those keys as I work on input for the other character. River City Ransom is tricky because one player's input can increase lag or change the AI's behaviour, so I often have to rework a stretch of input. Some keyboards can't accept certain combinations of key presses, so I set up redundant input configurations for the times I have to press several buttons and the frame advance key. Unless you have three hands I think it would be too tedious to use controllers instead of the keyboard to make a TAS. Are you planning to work on a two-player RCR TAS? I'm curious to know if you've found improvements to my run.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
MrWint wrote:
About the text boxes: I'm answering from memory here, and I never seriously looked into that feature of Trainer-Fly, so don't rely on this too heavily, but the way it works is basically that it stores the text box to play when engaging a trainer, to play it when he finally walked up to you (not sure what the address was, but it should be reasonably easy to find it). When trainer-flying, you overwrite the value when fighting other trainers or do stuff like talking to NPCs. After a battle the value is reset to 0, which opens the main menu instead. If you want any specific text box, you would need to manipulate that byte to be the text you want. If you're adventurous, you might even try to get an invalid text ID in to setup arbitrary code execution, but that's just an idea (I might acutally look into some time), it will probably not work that way.
I did get the game to do something unusual with an invalid text ID, but I'm not sure it can be used for arbitrary code execution. Here is the .bkm file that gets to that point. I'm not sure why the stored text ID isn't working in Mount Moon, but I was able to use it for other dialogue in Viridian Forest. It appears that the anomalous dialogue won't come up even if I return directly to Mount Moon, maybe something is resetting the value to 0 on its own. I'll do some testing and try to find a way to use this bug to pick up a Rare Candy.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
MrWint wrote:
My currently published TAS uses this strat, I even pointed it out in the submission text. Talking to oak from the side is even faster than from behind, I believe it was 2 frames, but not exactly sure anymore. Also, it saves only about 15 frames compared to talking to Oak from below (3 extra steps, but 2 less steps from the rival). Also, grats to Werster.
I did a quick test and thought it was a couple frames faster from the top, I guess I was mistaken. I'm having some trouble getting the anomalous text box to work outside of Viridian Forest. I'm trying to pick up the Rare Candy in Mount Moon, as picking it up from a distance would reduce the number of battles Mew needs, but doing the blackout Trainer-Fly in Mount Moon always gives me a start menu.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
The streamer Werster made a new record for the glitchless unassisted speedrun with a time of 1:51. I noticed a little improvement in his run that TASers have been missing for years - the second time in Professor Oak's lab, it's faster to go around Oak and talk to him from above. This takes 4 extra steps, but it saves about half a second because the rival spends less time walking around.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
luckytyphlosion wrote:
The new change would be to 1. battle the rocket 2. pick up TM01 3. get ether 4. get mew 5. teach TM01 to mew 6. let [Pokemon] gain 54 special EV by switching out 7. level up mew to 10 with mega punch and learn transform.
I'm not sure about this route, teaching Mega Punch and travelling further to find the Rocket with Raticate is potentially slower than the extra attacks from solely using Pound. At this point I think it's something that requires testing rather than discussion, I have midterms but I'll try to get on this soon.
There is no Poke Ball in Mt. Moon.
You're completely right, I got confused between Mount Moon and Viridian Forest.
I've also been thinking about the "no glitched warps" category and I was wondering what the "no glitched warps" category specifies. Does no glitched warps mean that only wrong warping is banned? If the above is true, then would other glitches such as "Item Underflow" and "ZZAZZ glitch" as long as the player does not wrong warp?
The current title for the category is "no glitch warps", a better name might be "no memory manipulation." Tricks like ZZAZZ that get a desired result by RAM manipulation are considered part of the heavy glitch abuse category.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
luckytyphlosion wrote:
I've also found a faster way to get Mew: 1. Perform a Black-Out Trainer Fly on any trainer except the Lass with Clefairy.
Why not that Lass?
2. Walk into Mt. Moon and enter the bottom floor where the ether is. 3. Battle the rocket and let him walk to you. 4. Pick up the Ether. 5. Get an encounter for a level 12 Clefairy. The clefairy should have a special DV of 7, 8, 9 or 10. 6. Walk up to the first floor. 7. Get Mew.
This route looks even better. I'll look into manipulating dialogue boxes to pick up a Poké Ball remotely, which would let the run skip the Mart entirely.
Also, I was thinking about instead of using Charmander for the box data, you would use another Pokemon, say Pidgey. You would manipulate the DVs as usual, and in order to have 0x36, you would have Pidgey in front, battle 2 paras but switch out to charmander to split the EV from 55 to 27, which would then be 54.
That's an interesting idea. It skips a couple battles but that route would definitely require a trip to the Mart.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
luckytyphlosion wrote:
Recently, I figured out a way to get Mew in Mt. Moon, although it is slightly complicated. This could possibly save time rather than Trainer-Flying on Route 24, and lead to a faster TAS.
This is intriguing, and I'm happy to see a new member getting into this thread. If this route works, it's brilliant, and I'll be testing it soon. I have some questions about your route:
2. Don't PC save and quit. Instead, go inside Mt. Moon and pick up the ether required for the Cooltrainer move. (not neccesary to actually find mew)
It would be necessary to PC save and quit in order to pick up that Ether. It may be possible to glitch an Ether into our inventory with blackout Trainer-Fly.
3. Set up a blackout Trainer-Fly with the youngster. 6. Your Start menu should pop up, and it'll bring an encounter for a level 6 Gengar. The Gengar needs to have 21 special, or else it won't bring Mew up.
Actually, a dialogue box should pop up. It may be possible to trigger the dialogue box for "I found Rare Candy", depending on the last one loaded by the game. It may also be possible to use a blackout Trainer-Fly in B2F to glitch Ether into the inventory.
2. Defeat level 2 Pidgey with a critical. This allows to jump from level 6 to 8 after the Weedle fight and allowing you to get ember earlier. (It has to be a pidgey, because special EVs are different from current route.)
Do you know precisely what special EVs and DVs are needed for this route?
Note that I'm not entirely sure if this would work, because Metapod's Data could crash the game.
What's this about Metapod's data? There's no reference to Metapod in your route plan. (Edit: I think you're referring to the Bug Catcher's 4th Pokémon, a Metapod. We don't need to fight that Metapod if its data is a problem, because it's possible to fight the Lass above that Bug Catcher and return to Pewter to reset her position. This would have an impact on Charmander's EVs.) I have some questions for myself that I'll try to test soon. 1. What dialogue can trigger "I found Rare Candy" and "I found Ether"? 2. Can there be 2 areas in a state of Trainer-Fly, or does the glitch require completely separate executions?
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
thatguy wrote:
When activating Trainer-Fly in Viridian Forest, wouldn't it be more efficient to black out against a wild Pokemon that already has the appropriate Special stat? It would save you an encounter.
I need a trainer battle to fix the trainer-fly status, otherwise the game will bug out and I won't get any wild Pokemon. The old man catching Weedle counts as a trainer battle, so that's the quickest way to set up the wild Nidoking. Earlier I planned on losing the second Rival fight, but when I discovered that the old man counts as a trainer battle this saved a lot of time. When the trainer-fly glitch is used, the game tries to open the last dialogue box it tried to open. It normally opens the start menu because that's how the old glitch was performed, but the new method allows the game to open any dialogue box from the area of the glitch. The dialogue in Viridian where the old man says "time is money..." happens to correspond with the dialogue in Viridian Forest "I found Pokeball!" This allows a fast way to get a Pokeball for Nidoking without visiting the store in Viridian, which does not stock Escape Ropes.
Also, what do you mean "after you finish River City Ransom"? Was there an improvement to the TAS that just got published?
There might be. I'm trying a single-player TAS because the lag reduction might make it faster than my two-player TAS, right now it's too early to say for sure.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
If the glitch isn't useful for arbitrary code, at least it's still faster than getting Gyarados for a no-glitch-warps run. I've done some testing and found that the glitch loses about 3 minutes getting through Viridian Forest, and then gains over 4 minutes Thrashing everything on the way to getting Mew. Nidoking wins battles faster than Mew, so it should stay in front of the team until the Juggler who poisons Mew in Koga's gym. I may start working on the TAS after I finish River City Ransom, but someone else can feel free to start on it if they want. Here's the planned route 1. Get Charmander with 18 HP and low DVs. All DVs even, defense DV of 0, 2, 4, or 6, special 0, 2, 4, 6, or 8. 2. Lose to 3 max-damage critical Tackles, or a tail whip and 3 non-crit Tackles if AI can't get a crit on the first turn. (I forgot if that is the case in Generation 1) 3. Heal at Pokémon Center in Viridian 4. Run Oak's parcel errand, proceed to Viridian Forest. 5. Run into level 5 wild Pikachu just in front of trainer, lose to 2 Thundershocks. Pikachu's special DV should be 10 or more so its special stat is 11. 6. Talk to Old Man, answer "No". Talk to him again and answer "Yes". 7. Encounter level 3-5 Caterpie or Weedle with 7 special, growl 6 times, run 8. Walk into forest, Poké Ball immediately added to inventory. Encounter level 1 Nidoking, catch it. 15 speed DV, and attack DV high enough to give it attack 7. 9. Fight level 3 Caterpie with Speed DV 0-4 so it has speed 7, same as Nidoking. HP and Defense DVs low enough to knock it out with 2 critical Poison Stings. 10. At Mart, buy 2 Poké Balls and 2 Escape Ropes. Out of money, but this route will require 3 Escape Ropes - for Bill, Sabrina, and Pokémon Mansion. Could either pick up the hidden one on Route 3 or just Teleport away from Bill's front door, whichever is faster. 11. Go through trainers with Nidoking. Always Thrash against three or more Pokémon. Use Thrash against two Pokémon if Poison Sting is not very effective or super effective against one or both of the trainer's team members. 12. Go through Mount Moon, fighting both trainers in the way. 13. Proceed as in Primo's run, but with Nidoking. Don't bother teaching the Bubblebeam TM, Nidoking gets by with Thrash and Poison Sting. 14. Catch Mew, but continue fighting with Nidoking. Get HM02. 15. Use Nidoking for fights until using Mew to face the last Juggler in Koga's gym. Rest of the run looks like the current run. Time savings at this point at least 5 minutes.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
thatguy wrote:
Nice! Knowing this game, there's almost certainly a way of getting arbitrary code execution out of this.
There probably is, and I don't have the knowledge to do it. I discovered the save corruption glitch used in the Yellow run but other people figured out how to make it useful. Unfortunately it looks like p4wn3r and MrWint haven't been on the forums in several months, I'll message FractalFusion and ask if he can figure out what's going on with this glitch.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
Sorry for the double post, but this could be a big deal. It looks like the glitch to enter Trainer-Fly without using the Start menu puts the player in a different state of Trainer-Fly, where the trainer used to perform the glitch is considered defeated and the player can still use the A button. It may involve the Old Man from the Missingno. glitch, or it may be entirely about the method of fainting away from a trainer just before the battle. If it's the latter, that means we have a new method of performing Trainer-Fly that could skip the battle in Viridian Forest and more efficiently skip battles in Mount Moon. Also, it may be possible to use this glitch to pick up any item in an area, since I just used it to pick up a Poke Ball from the other side of the map. Requires more testing. edit: I made a bkm movie to show off the process of triggering a version of the glitch that crashes the game.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
On another note, I just found an intriguing youtube video showing a method of performing Trainer-Fly in Viridian Forest. This could catch a Nidoking very early in the game, but it's agonizingly slow to perform the glitch. I'm not sure what the fastest route is to exploit this, but it's intriguing. Route 2 has plenty of Pokémon to give us Nidoking. The correct route might involve losing fights early on rather than winning - does anyone have an accurate damage calculator for Generation 1? I'm exploring a lot of different routes because I'd like to make an improvement to Primo's no-glitch-warps run if there's a significant route change to be made. I wouldn't be interested in, as you said, splicing the second half of his run onto the first half of the glitched warps run.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
They had a problem with a walking trainer in the Pokémon Mansion. They talked to him from that position and fought, causing the trainer to stay there. It took over an hour for all the stream's team to faint from random encounter battles.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
thatguy wrote:
It's Sod's Law that you can get all the Poison-type third-stage Pokemon early game, when those are precisely the ones that prevent WtW abuse.
Over half of all the Poison-types in existence are from Generation 1.
So to clarify, Snorlax doesn't disappear if you cancel a Trainer-Fly by saving and resetting? Just when I thought I'd actually had a good idea for once...
To make Snorlax disappear, it has to load onto the top of the list of disappearable objects, because the trainer-fly glitch removes the first object from that list. I'm not sure if Snorlax disappears if I do the first part of trainer-fly before meeting it but trigger the encounter later. Now that I think about it, I think triggering the "wild" encounter is the event that actually deletes Snorlax. Unfortunately skipping the Gambler battle requires triggering Trainer-Fly twice, since we have to pass him once to load Snorlax onto the list of disappearing objects and pass him again once Snorlax is gone.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
thatguy wrote:
Actually, there is one other place I have thought of where Trainer-PC may be worth it, it depends on the effect saving/resetting after a Trainer-Fly has been set up has on Snorlax... My idea is to first acquire the Bike Voucher, then to Trainer-Fly (by Abra's Teleport) off the first Trainer in Route 11 (having set the warp point to Cerulean, where it would naturally be anyway at that point in the route), and save/reset. That way you can pick up the Bicycle and cycle back to Vermilion to progress, whereas otherwise you'd have to walk (because you couldn't access the menu). You also skip the Trainer-Fly "wild" encounter you'd normally get to unlock the menu again, and the otherwise mandatory fight versus the Gambler just before the gate to Route 12. Of course none of this works if save/resetting to deactivate a Trainer-Fly doesn't remove Snorlax. EDIT: Oh derp, much more obviously than all that, it may well save time on Route 25.
Yeah, you need to pay Snorlax a visit before making it disappear. Unfortunately trainer-fly can't be used to skip anything on Route 25, because the nearby trainer who can be used for the trick is technically on Route 24. I ran the numbers, a level 100 Nidoking would definitely be faster than Charmander or Gyarados for the path to Mew. Unfortunately, I don't think it's possible to meet something with only 7 Special in the cave, as the weakest Zubats and Geodudes still have 9 Special. It's possible to get level 100 Gengar, Ivysaur, or Nidoqueen in the cave, but they're all part-Poison and so not useful for wall-warping later. I can't do an exact comparison between runs because of route differences, but Charmander is 1 minute faster through Mount Moon and Gyarados gains 50 seconds on all the battles near Cerulean. A level 100 Nidoking would save time from always moving first, always getting a one-hit win, and from Thrash being so fast to use.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
What route changes would be made in a new no-glitches-warps run? It's possible to skip Brock and the existing NGW run was made before discovering that trick. There's also the discovery that it's possible to save and regain menu control during the first stage of Trainer-Fly by going to a PC. It's possible to skip 2 mandatory battles and the optional battle in Mount Moon instead of catching Gyarados in Mount Moon - it's not possible to do both. It could also be used to skip 2 mandatory battles on Route 6, but this involves backtracking to Cerulean and may be slower than just fighting. A route that skips the Mount Moon fights would certainly want to pick up Mega Punch and teach it to Charmander for a faster Rival fight. If we skip grabbing a Gyarados in Mount Moon, that means only performing the trainer-fly glitch to get a level 100 Mew, or possibly a different Pokémon. Mew is a great choice because it can learn Fly, Take Down, and any other moves we want. If we catch a Mew in the same place, I believe there are no route changes after that point, but the run will already be several minutes ahead. A strong non-Mew candidate would be any non-poison type that can go from level 1 to 100, preferably one that can learn Fly and Take Down. I'm open to suggestion, but I suspect Mew will still be the best main battle mon for a new run. Are there any route changes for a non-glitch-warped run that I missed? I have to admit I'm curious how much time can be gained now that we can skip Brock and use trainer-fly to get past certain fights.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
I can't stop laughing. I just found out that the stream successfully beat Giovanni on the second stream, and then used Dig to escape without picking up the Silph Scope. Time to go in the maze again!
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
They've finally reached the battle with the Rocket who has the Lift Key, and now viewers are voting for anarchy again.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
Sappharad wrote:
I can post a beta build of 1.6.0 later this week which won't have any problems with the UI freezing because the cause of that problem was the approach I use to mix the OS X and Windows UI's. The next release will just have the windows UI (which will work fine on OS X, it just won't look right) until a native OS X UI is ready. Work has begun on a fully native OS X UI, but it's going to be vastly inferior to the Windows version for a long time since I'll need to re-implement features that are in the Windows version from scratch.
That would be great, thanks. I'm on vacation with just a Macbook so I can't work on any runs at the moment, but just having Bizhawk for Mac is a big improvement over nothing.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
I'm having trouble getting RAM Watch to work in Bizhawk 1.5.2 on OSX 10.8.3. When I click on it, the program stops accepting any mouse input and must be quit with command+Q. Are there any fixes to this issue to make RAM Watch usable?
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
Warp wrote:
Somehow this reminds me of a little experiment I did quite many years on a usenet forum. I wanted to create a collaboration chess game: I set up a chess game, and every day people could suggest moves and vote for moves, and the move with the most votes would then be performed. The next day it would be the same for the "other player". The intent was not to win anything, but to see what kind of game would result from this voting system. (And my purpose was to create a game that was as good as possible, ie. both "players" playing as strongly as possible, via the cooperation of many people.) It went quite well for a while, but unfortunately it ended before even the first game was even half-way through. Many people lost interest, and some other people started kind of "soft-boycotting" the entire project by suggesting and voting for deliberately bad moves in order to make it "more interesting". I didn't want one of the "players" making deliberately bad moves, so at some point I just ended the whole project. Quite a pity, really. I wonder if this idea could work here.
There was a similar experiment in 1999, with Kasparov against the world. Kasparov won, but the world team played very well. They had a team of skilled players recommending moves, and the voters tended to choose good moves because bad players couldn't coordinate on which bad moves to play. I suspect that a democratic run of this game would be much faster and much less funny.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
Here's a bug from some abnormal use. I was emulating Pokémon Red in Bizhawk running two lua scripts, and left it alone with the turbo button taped down for an hour. At some point it crashed with the error "System.NotSupportedException: Memory stream is not expandable." I'm running it again and keeping an eye on the computer so I can report when it happens. Are there are any fixes for this? Other than the obvious "don't emulate a game for 24 hours."
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
FractalFusion wrote:
Once execution reaches while true do ... end, it will never leave (unless you use break or something). So the first while true do ... end and everything before it should not be there. It should be more like this:
local buttons = {"Start"} 
local keyinput={} 

while true do 
  r=math.random(1000)
  for key,value in pairs(buttons) do
   if r==1 then
    keyinput[value]=true
   else
    keyinput[value]=false    
   end
  end 
  joypad.set(keyinput) 
  emu.frameadvance() 
end
Note: math.random(n), where n is an integer, returns a random integer from 1 to n.
Thanks, but that doesn't seem to work. It runs but doesn't press Start at all. I got the following scripts to work, and I got the result I wanted by running them concurrently. To press A, B, up, left, down, and right 50% of frames:
local buttons = {"A","B","Up","Left","Down","Right"} 
local state = {true,false} 
local keyinput={} 

while true do 
  for key,value in pairs(buttons) do 
    keyinput[value]=state[math.random(2)] 
  end 
  joypad.set(keyinput) 
end
And to press Start 0.1% of frames:
local buttons = {"Start"} 
local state = {true,false} 
local keyinput={} 

while true do 
  for key,value in pairs(buttons) do 
    keyinput[value]=state[math.random(1000)] 
  end 
  joypad.set(keyinput) 
  emu.frameadvance() 
end
I don't precisely understand it, but it works. Now I'll set it on turbospeed and make it play Pokemon Red for twelve hours.
Chamale
He/Him
Experienced Forum User, Published Author, Player (178)
Joined: 10/20/2006
Posts: 1352
Location: Canada
I actually need this too, thanks! Now I'm trying to modify it to change the probability of each button press, but I'm not sure how. This is what I attempted to give it a 1/1000 chance of pressing Start:
local buttons = {"A","B","Up","Left","Down","Right"} 
local state = {true,false} 
local keyinput={} 

while true do 
  for key,value in pairs(buttons) do 
    keyinput[value]=state[math.random(2)] 
  end 
  joypad.set(keyinput) 
end

local buttons = {"Start"} 
local state = {true,false} 
local keyinput={} 

while true do 
  for key,value in pairs(buttons) do 
    keyinput[value]=state[math.random(1000)] 
  end 
  joypad.set(keyinput) 
  emu.frameadvance() 
end
That didn't work. Can you tell me what I did wrong, please? edit: Wait, I think I know. I need to put the frame advance after all the key inputs. edit 2: ":22: '=' expected near 'end'". I don't see where to put the = sign near either "end" in this code, so it won't run. When I put an = in front of end, it says "unexpected symbol near 'end'."