Skip to content

Commit

Permalink
Merge pull request #15 from Cegaiel/Mar_26_2012
Browse files Browse the repository at this point in the history
Add Thermometer Macro, update error catching on many scripts. Fix/Replac...
  • Loading branch information
Vaevictusnet committed Mar 26, 2012
2 parents aa30761 + eda68a1 commit 52231dd
Show file tree
Hide file tree
Showing 26 changed files with 318 additions and 175 deletions.
Binary file removed VeggieTales/FlaxNileGreen.png
Binary file not shown.
Binary file removed VeggieTales/FlaxOldEgypt.png
Binary file not shown.
Binary file removed VeggieTales/FlaxTedra.png
Binary file not shown.
Binary file modified VeggieTales/Take.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VeggieTales/blank.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VeggieTales/kettle_take.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions VeggieTales/luaScripts/Casting.inc
Expand Up @@ -36,7 +36,7 @@ tools_button_names = {


function heavyleadbowl()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -58,7 +58,7 @@ function heavyleadbowl()
end

function monkeywrench()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -81,7 +81,7 @@ end


function silverbowl()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -104,7 +104,7 @@ end

function ironcookpot()

num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -127,7 +127,7 @@ end

function anvilbed()

num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -150,7 +150,7 @@ end

function orichalcumpellets()

num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -178,7 +178,7 @@ end

function mediumgear()

num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -206,7 +206,7 @@ end

function smallgear()

num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -233,7 +233,7 @@ function smallgear()
end

function bearing()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -261,7 +261,7 @@ function bearing()
end

function washers()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -289,7 +289,7 @@ function washers()
end

function bolts()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -316,7 +316,7 @@ function bolts()
end

function heavymallethead()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -344,7 +344,7 @@ function heavymallethead()
end

function widetungstenchisel()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -372,7 +372,7 @@ function widetungstenchisel()
end

function roundhammer()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -401,7 +401,7 @@ end

function ballpeenhammer()

num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand All @@ -428,7 +428,7 @@ function ballpeenhammer()
end

function shapingmallet()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -456,7 +456,7 @@ function shapingmallet()
end

function leadmallet()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down Expand Up @@ -484,7 +484,7 @@ function leadmallet()
end

function pewterincenseprong()
num_loops = promptNumber("How many passes ?", 100);
num_loops = promptNumber("How many passes ?", 1);
askForWindow("Fill casting boxes with charcoal, arrange, and fire the casting boxes first before you pin the menu.");

srReadScreen();
Expand Down
5 changes: 3 additions & 2 deletions VeggieTales/luaScripts/Casting.lua
Expand Up @@ -50,8 +50,9 @@ function clickAll(image_name)
local buttons = findAllImages(image_name);

if #buttons == 0 then
statusScreen("Could not find specified buttons...");
lsSleep(1500);
error 'Could not find \'Casting Box\' windows.'
--statusScreen("Could not find specified buttons...");
--lsSleep(1500);
else
statusScreen("Clicking " .. #buttons .. "button(s)...");
if up then
Expand Down
2 changes: 1 addition & 1 deletion VeggieTales/luaScripts/Fishing.lua
Expand Up @@ -52,7 +52,7 @@ function SetupLureGroup()
LastLure=nil;
end
else
error("didnt find pin");
error("Didn\'t find pin up.");
end


Expand Down
@@ -1,69 +1,69 @@
--
--
--

loadfile("luaScripts/screen_reader_common.inc")();
loadfile("luaScripts/ui_utils.inc")();

xyWindowSize = srGetWindowSize();
imgWork1 = "WorkThisMine.png";
imgWork2 = "WorkThisMine2.png";
imgRepair1 = "RepairThisMine1.png";
imgRepair2 = "RepairThisMine2.png";
imgStrBlack = "Strength-Black.png";
imgPerBlack = "Perception-Black.png";
delay_time = 10;

function doit()
local mine_count=0;
askForWindow("Make sure the Skills window is visible and Sand Mine window is pinned.");
local end_red;
local failures=0;
local just_repaired=nil;
while 1 do
checkBreak();
lsSleep(delay_time);
checkBreak();
if str_black and per_black then
statusScreen("(" .. mine_count .. " pulls) Mining...");
else
statusScreen("(" .. mine_count .. " pulls) Waiting (STR or PER is not black)");
end
srReadScreen();
str_black = srFindImage(imgStrBlack);
per_black = srFindImage(imgPerBlack);
if str_black and per_black then
local mine = srFindImage(imgWork1, 4000);
if not mine then
mine = srFindImage(imgWork2, 4000);
end
if mine then
srClickMouseNoMove(mine[0]+5, mine[1], 0);
mine_count = mine_count + 1;
failures = 0;
just_repaired = nil;
else
repair = srFindImage(imgRepair1, 4000);
if not repair then
repair = srFindImage(imgRepair2, 4000);
end
if repair then
if just_repaired then
error ("Repaired once, but still broken? (did " .. mine_count .. " pulls)");
else
srClickMouseNoMove(repair[0]+5, repair[1], 0);
lsSleep(500);
just_repaired = 1;
end
end
failures = failures + 1;
if (failures == 50) then
error ("Could not find Work This Mine button (did " .. mine_count .. " pulls)");
else
statusScreen("Failed to find Work This Mine button...");
lsSleep(1000);
end
end
end
end
end
--
--
--

loadfile("luaScripts/screen_reader_common.inc")();
loadfile("luaScripts/ui_utils.inc")();

xyWindowSize = srGetWindowSize();
imgWork1 = "WorkThisMine.png";
imgWork2 = "WorkThisMine2.png";
imgRepair1 = "RepairThisMine1.png";
imgRepair2 = "RepairThisMine2.png";
imgStrBlack = "Strength-Black.png";
imgPerBlack = "Perception-Black.png";
delay_time = 10;

function doit()
local mine_count=0;
askForWindow("Make sure the Skills window is visible and Sand Mine window is pinned.");
local end_red;
local failures=0;
local just_repaired=nil;
while 1 do
checkBreak();
lsSleep(delay_time);
checkBreak();
if str_black and per_black then
statusScreen("(" .. mine_count .. " pulls) Mining...");
else
statusScreen("(" .. mine_count .. " pulls) Waiting (STR or PER is not black)");
end
srReadScreen();
str_black = srFindImage(imgStrBlack);
per_black = srFindImage(imgPerBlack);
if str_black and per_black then
local mine = srFindImage(imgWork1, 4000);
if not mine then
mine = srFindImage(imgWork2, 4000);
end
if mine then
srClickMouseNoMove(mine[0]+5, mine[1], 0);
mine_count = mine_count + 1;
failures = 0;
just_repaired = nil;
else
repair = srFindImage(imgRepair1, 4000);
if not repair then
repair = srFindImage(imgRepair2, 4000);
end
if repair then
if just_repaired then
error ("Repaired once, but still broken? (did " .. mine_count .. " pulls)");
else
srClickMouseNoMove(repair[0]+5, repair[1], 0);
lsSleep(500);
just_repaired = 1;
end
end
failures = failures + 1;
if (failures == 50) then
error ("Could not find Work This Mine button (did " .. mine_count .. " pulls)");
else
statusScreen("Failed to find Work This Mine button...");
lsSleep(1000);
end
end
end
end
end
4 changes: 2 additions & 2 deletions VeggieTales/luaScripts/barrel_grinder.lua
Expand Up @@ -18,7 +18,7 @@ num_clicks = 0;
num_repairs = 0;

function doit()
askForWindow();
askForWindow("Pin up your barrel grinder menu, then press Shift to continue.");
while 1 do
lsSleep(100);
if (lsShiftHeld() and lsControlHeld()) then
Expand All @@ -29,7 +29,7 @@ function doit()
lsPrintln(lsGetTimer() .. " start it");
local st = srFindImage(imgStart, 4000);
if not st then
error 'Could not find start button';
error 'Could not find \'Start grinding\' button.';
end
lsPrintln(lsGetTimer() .. " winding and waiting");
statusScreen("Winding and waiting.");
Expand Down
8 changes: 4 additions & 4 deletions VeggieTales/luaScripts/barrel_vise.lua
Expand Up @@ -164,7 +164,7 @@ function process_vise(window_pos)
return "DANGER; No Stoke (0 Wood)";
end;

return 'Flame: OK; Fuel OK;';
return 'Flame: OK; Fuel OK';
end


Expand All @@ -176,15 +176,15 @@ end
function doit()

-- testReorder();
num_barrels = promptNumber("How many barrels?", 100);
num_barrels = promptNumber("How many barrels?", 1);
askForWindow("Have 100 Boards, 2 Copper Straps, and 80 Wood in your inventory for every barrel you want to make.\n \nFor large numbers of barrels you can get away with less wood, the average used is 60.\n \nPin as many vises as you want, put the cursor over the ATITD window, press Shift.");

srReadScreen();

local vise_windows = findAllImages("ThisIs.png");

if #vise_windows == 0 then
error 'Did not find any open windows';
error 'Could not \'Barrel Vice\' windows.';
end

local last_ret = {};
Expand Down Expand Up @@ -221,7 +221,7 @@ function doit()
if not (#vise_windows == #vise_windows2) then
lsPrintWrapped(10, 45, 5, lsScreenX-15, 1, 1, 0xFF7070ff, "Expected " .. #vise_windows .. " windows, found " .. #vise_windows2 .. ", not ticking.");
elseif (made>=num_barrels) or (taken >= num_barrels) or (stop_cooking>0) then
lsPrint(10, 45, 5, 1.5, 1.5, 0x70FF70ff, "finishing up.");
lsPrint(10, 45, 5, 1.5, 1.5, 0x70FF70ff, "Finishing up.");
elseif (taken > made) then
lsPrint(10, 45, 5, 1.5, 1.5, 0xFFFFFFff, taken .. "/" .. num_barrels .. " finished");
else
Expand Down

0 comments on commit 52231dd

Please sign in to comment.