Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/fceux.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqfox <qfox@users.sf.net>2008-07-27 20:32:10 +0400
committerqfox <qfox@users.sf.net>2008-07-27 20:32:10 +0400
commitd7383158d500e6a03ff0901c8c96df1ac5924745 (patch)
treeb31e14886aba25184a59d7047834cc14942a93cf /documentation
parentc66da282ff770439e7e20192836a0d6c1ab5986d (diff)
Hm I thought I updated this thing. Some small LuaBot improvements.
Diffstat (limited to 'documentation')
-rw-r--r--documentation/luabot.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/documentation/luabot.lua b/documentation/luabot.lua
index 6633d8bd..67d99b37 100644
--- a/documentation/luabot.lua
+++ b/documentation/luabot.lua
@@ -1,6 +1,6 @@
-- LuaBot, concept bot for FCEU and ZSnes and any other emu that has compatible Lua engine
-- qFox, 24 July 2008
--- version 1.01
+-- version 1.03
local function realcount(t) -- accurately count the number of elements of a table, even if they contain nil values. not fast, but accurate.
local n = 0;
@@ -357,7 +357,7 @@ while (rand_if(isRunEnd())) do
-- press keys from bot
gui.text(10,10,"Attempt: "..attempt.." / "..maxattempts.."\nFrame: "..frame.." / "..maxframes);
if (segments[segment] and segments[segment].best and segments[segment].prev) then
- gui.text(10,30,"Last score: "..segments[segment].prev.score.." ok="..okattempts..", fails="..failattempts.."\nBest score: "..segments[segment].best.score);
+ gui.text(10,30,"Last score: "..segments[segment].prev.score.." ok="..okattempts..", fail="..failattempts.."\nBest score: "..segments[segment].best.score);
elseif (segments[segment] and segments[segment].prev) then
gui.text(10,30,"Last score: "..segments[segment].prev.score.."\nBest score: none, fails="..failattempts);
end;
@@ -388,8 +388,6 @@ while (rand_if(isRunEnd())) do
if (rand_if(pressKeySelect2())) then key2.select = 1; end;
if (rand_if(pressKeyStart2())) then key2.start = 1; end;
- gui.text(50,70,"key1: "..realcount(key1)..", key2: "..realcount(key2).."\nlast1: "..realcount(lastkey1)..", last2: "..realcount(lastkey2));
-
onInputEnd();
lastkey1 = key1;
@@ -401,7 +399,7 @@ while (rand_if(isRunEnd())) do
-- actually set the keys here.
joypad.set(1, key1);
- joypad.set(1, key2);
+ joypad.set(2, key2);
-- next frame
FCEU.frameadvance();