Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- piecevalues = {
- [0x00] = "I",
- [0x01] = "T",
- [0x02] = "Z",
- [0x03] = "S",
- [0x04] = "J",
- [0x05] = "L",
- [0x06] = "O",
- };
- pieces = {};
- for k,v in pairs(piecevalues) do
- pieces[k] = 0;
- end;
- sum = 0;
- print("butt");
- donepiece = true;
- lasty = 0xFF;
- while true do
- -- if donepiece and memory.readbyte(0xAF81) == 0x01 then
- piecey = memory.readbyte(0xAF81);
- if piecey < lasty then
- local curpiece = memory.readbyte(0xAF85);
- donepiece = true;
- pieces[curpiece] = pieces[curpiece] + 1;
- sum = sum + 1;
- --memory.writebyte(0xAF80, math.random(0x02, 0x08));
- --memory.writebyte(0xAF81, math.random(0x03, 0x0F));
- --joypad.set(1,{down=1});
- --elseif donepiece and memory.readbyte(0xAF81) ~= 0x01 then
- -- donepiece = false;
- end;
- lasty = piecey;
- local temp = 0;
- inpt = input.get();
- if true or inpt['X'] then
- gui.box(96, 0, 159, 144, 0x000000af, 0x000000af);
- for k,v in pairs(piecevalues) do
- gui.text(100, temp * 7, string.format("%s %6d %5.2f%%", v, pieces[k], pieces[k] / sum * 100));
- temp = temp + 1;
- end;
- temp = temp + 1;
- end;
- gui.text(100, temp * 7, string.format("%8d", sum));
- emu.frameadvance();
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement