Skip to content

Commit

Permalink
Merge pull request #42 from Cegaiel/May_5_2012
Browse files Browse the repository at this point in the history
May 5 2012
  • Loading branch information
Vaevictusnet committed May 9, 2012
2 parents 8ea04b5 + 01f7f25 commit eba3d3b
Show file tree
Hide file tree
Showing 11 changed files with 730 additions and 547 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
761 changes: 362 additions & 399 deletions VeggieTales/luaScripts/Casting.inc

Large diffs are not rendered by default.

107 changes: 28 additions & 79 deletions VeggieTales/luaScripts/Casting.lua
@@ -1,86 +1,34 @@
-- Open, Add Charcoal, Fire, Pin, and arrange your casting box windows
-- **Does not take items**
-- ***********************
--Below times are exact teppy minutes + 3 seconds *1000 (ms)
-- Times:
-- 1 Minute = 69000
-- 2 Minutes = 138000
-- 3 Minutes = 207000
-- 4 Minutes = 276000
-- 5 Minutes = 345000
-- 6 Minutes = 414000
-- 10 Minutes = 690000
-- 15 Minutes = 1035000
-- 20 minutes = 1380000
-- 25 minutes = 1725000
-- 30 minutes = 2070000
-- ***********************
-- Casting Box v1.1 by Bardoth, Revised by Cegaiel
-- You must manually add charcoal and fire up each casting box before pinning them up.
-- Does not take items from casting box.

assert(loadfile("luaScripts/common.inc"))();
assert(loadfile("luaScripts/casting.inc"))();

askText = singleLine([[
Casting Box v1.2 (by Bardoth Revised by Cegaiel) --
Automatically run one or more casting boxes.
Make sure the VT window is in the TOP-RIGHT
corner of the screen.
]]);

loadfile("luaScripts/screen_reader_common.inc")();
loadfile("luaScripts/ui_utils.inc")();
loadfile("luaScripts/Casting.inc")();
-- loadfile("luaScripts/Forge_Bars.lua")();
wmText = "1) Manually add charcoal and light CB\'s.\n2) Make sure CB\'s are lit before pinning!\n3) Tap Ctrl on CB\'s to open and pin.";

local per_click_delay = 0;
--Global Variables. Dont change!
click_delay = 0;
stalled = 0;
made = 0;
project_windows = 0;

function setWaitSpot(x0, y0)
setWaitSpot_x = x0;
setWaitSpot_y = y0;
setWaitSpot_px = srReadPixel(x0, y0);
end

function waitForChange()
local c=0;
while srReadPixel(setWaitSpot_x, setWaitSpot_y) == setWaitSpot_px do
lsSleep(1);
c = c+1;
if (lsShiftHeld() and lsControlHeld()) then
error 'broke out of loop from Shift+Ctrl';
end
end
-- lsPrintln('Waited ' .. c .. 'ms for pixel to change.');
end

function clickAll(image_name)
-- Find buttons and click them!
srReadScreen();
xyWindowSize = srGetWindowSize();
local buttons = findAllImages(image_name);

if #buttons == 0 then
error 'Could not find \'Casting Box\' windows.'
--statusScreen("Could not find specified buttons...");
--lsSleep(1500);
else
statusScreen("Clicking " .. #buttons .. "button(s)...");
if up then
for i=#buttons, 1, -1 do
srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3);
lsSleep(per_click_delay);
end
else
for i=1, #buttons do
srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3);
lsSleep(per_click_delay);
end
end
statusScreen("Done clicking (" .. #buttons .. " clicks).");
lsSleep(100);
end
function doit()
askForWindow(askText);
windowManager("Casting Box Setup", wmText);
unpinOnExit(runCasting);
end

function refocus()
statusScreen("Refocusing...");
for i=2, #window_locs do
setWaitSpot(window_locs[i][0], window_locs[i][1]);
srClickMouseNoMove(window_locs[i][0] + 321, window_locs[i][1] + 74);
waitForChange();
end
end

function doit()
function runCasting()
while 1 do
-- Ask for which button
local image_name = nil;
Expand Down Expand Up @@ -112,19 +60,19 @@ function doit()
bsize = 130;
elseif button_names[i] == "Fuel" then
x = 30;
y = 170;
y = 160;
bsize = 130;
elseif button_names[i] == "Gearwork" then
x = 30;
y = 200;
y = 190;
bsize = 130;
elseif button_names[i] == "Hardware" then
x = 30;
y = 230;
y = 220;
bsize = 130;
elseif button_names[i] == "Tools" then
x = 30;
y = 260;
y = 250;
bsize = 130;
end
if lsButtonText(x, y, 0, 250, 0xe5d3a2ff, button_names[i]) then
Expand All @@ -133,7 +81,8 @@ function doit()
end
end

if lsButtonText(lsScreenX - 220, lsScreenY - 30, z, 150, 0xFF0000ff, "End script") then

if lsButtonText(lsScreenX - 110, lsScreenY - 30, z, 100, 0xFFFFFFff, "End script") then
error "Clicked End Script button";
end
lsDoFrame();
Expand Down
58 changes: 44 additions & 14 deletions VeggieTales/luaScripts/Fishing.lua
Expand Up @@ -42,7 +42,7 @@

--CUSTOM VARIABLES -- EDIT HERE To Change Fishing Casts, Skips, Updates.

TotalCasts=5; --Total Casts per lure, if a fish caught. If no fish then it skips.
TotalCasts=3; --Total Casts per lure, if a fish caught. If no fish then it skips.
SkipCommon = false; --Skips to next lure if fish caught is a common (Choose True or False).
LureChangesToUpdateTimer = 7; --Total lures used before time is updated. Zero updates every new lure.

Expand All @@ -54,7 +54,7 @@ LureChangesToUpdateTimer = 7; --Total lures used before time is updated. Zero up

-- Additional reporting in the log file
-- Choose True or False.
-- Note LogStrange and LogOdd overrides LogFails setting..
-- Note 'LogStrangeUnusual' and 'LogOdd' (below) overrides LogFails setting. ie if LogStrange true, then it would still log even if LogFails = False
--If LogFails = false and LogStrangeUnusual or LogOdd = true, then failed catches those would still be included in the log file.


Expand Down Expand Up @@ -118,7 +118,7 @@ function SetupLureGroup()
LastLure=nil;
end
else
error("Didn\'t find a pinned window.");
error("Didn\'t find Lures pinned window - Self Click->Skills, Fishing -> Use Lure, PIN THIS WINDOW!");
end


Expand Down Expand Up @@ -411,7 +411,6 @@ function GetTime()

srReadScreen();
imgs = findAllImages("Fishing/chatlog_reddots.png");

Coords = imgs[#imgs];

-- Look for the ** red dots in main chat to see if they exist.
Expand Down Expand Up @@ -547,7 +546,7 @@ function doit()


--Write an entry into log file to show this is a new session
WriteFishLog("[New Session]\n\n");
WriteFishLog("[New Session]\n");


while 1 do
Expand Down Expand Up @@ -676,14 +675,29 @@ function doit()
GrandTotalStrange = GrandTotalStrange + 1;
GrandTotalFailed = GrandTotalFailed + 1;
if LogStrangeUnusual == true then
WriteFishLog("[" .. CurrentTime .. "]\t[" .. CurrentLure .. "]\t" .. "You almost caught a STRANGE fish, but your rod was to clumsy." .. "\n");
WriteFishLog("[" .. CurrentTime .. "]\t[" .. CurrentLure .. "]\t" .. "You almost caught a STRANGE fish, but your rod was just too clumbsy." .. "\n");
end

-- if AlmostCaughtAttempts > 0 then
-- strangecounter = strangecounter +1;
-- end


elseif ChatType == "strangelostlure" then
-- Strange Fish and lost lure
GrandTotalStrange = GrandTotalStrange + 1;
GrandTotalLostLures = GrandTotalLostLures + 1;
GrandTotalFailed = GrandTotalFailed + 1;
--Reset, skip to next lure
castcount=0;
WriteFishLog("[" .. CurrentTime .. "]\t[" .. CurrentLure .. "]\t" .. "You almost caught a STRANGE fish, but your rod was just too clumbsy. You also lost your lure." .. "\n");

-- if AlmostCaughtAttempts > 0 then
-- strangecounter = strangecounter +1;
-- end



elseif ChatType == "unusual" then
-- Unusual Fish
GrandTotalUnusual = GrandTotalUnusual + 1;
Expand All @@ -698,6 +712,29 @@ function doit()




-- Can't uncomment below elseif statement until we get a screenshot of a message of you were not quick enough. You also lost your lure.
-- This would need to be added to Fishing_Func.inc , in the Chat_Types {array} along with adding Chatlog_AlmostUnusualLostlure.png). Add above "unusual" line in the array


--elseif ChatType == "unusuallostlure" then
-- Unusual Fish
--GrandTotalUnusual = GrandTotalUnusual + 1;
--GrandTotalLostLures = GrandTotalLostLures + 1;
--GrandTotalFailed = GrandTotalFailed + 1;
--if LogStrangeUnusual == true then
--WriteFishLog("[" .. CurrentTime .. "]\t[" .. CurrentLure .. "]\t" .. "You almost caught an UNUSUAL fish, but you were not quick enough." .. "\n");
--end



-- if AlmostCaughtAttempts > 0 then
-- strangecounter = strangecounter +1;
-- end




elseif ChatType == "odd" then
-- Odd Fish
GrandTotalOdd = GrandTotalOdd + 1;
Expand All @@ -709,6 +746,7 @@ function doit()

elseif ChatType == "oddlostlure" then
-- Odd Fish and lost lure
GrandTotalOdd = GrandTotalOdd + 1;
GrandTotalLostLures = GrandTotalLostLures + 1;
GrandTotalFailed = GrandTotalFailed + 1;
--Reset, skip to next lure
Expand All @@ -718,14 +756,6 @@ function doit()




-- Need to add "strangelostlure" and "unusuallostlure" here. But can't do it until I can get a screenshot of losing a lure on those two fish.
-- strange would be an image like this [clumsy. You also lost your lure]
-- unusual would be an image like [enough. You also lost your lure]
-- Those need to also be added to Fishing_Func.inc , in the Chat_Types {array}



elseif ChatType == "carry" then
--chat lines are messed up now
castcount=0;
Expand Down
1 change: 1 addition & 0 deletions VeggieTales/luaScripts/Fishing_Func.inc
Expand Up @@ -110,6 +110,7 @@ CL_Fish = {
"Chatlog_Fish_SeaUrchin.png",
"Chatlog_Fish_ShelomitsPuffer.png",
"Chatlog_Fish_SingingLamprey.png",
"Chatlog_Fish_SpottedSeaCucumber.png",
"Chatlog_Fish_StripedBatfin.png",
"Chatlog_Fish_Tilapia.png",
"Chatlog_Fish_Tilefish.png",
Expand Down
2 changes: 1 addition & 1 deletion VeggieTales/luaScripts/acro.lua
Expand Up @@ -6,7 +6,7 @@ loadfile("luaScripts/screen_reader_common.inc")();
loadfile("luaScripts/ui_utils.inc")();

function doit()
askForWindow();
askForWindow("This will randomly click your acro buttons (moves), but only when the \"Acro\" timer is not present. Hover ATITD window and Press Shift to continue.");

local num_clicks = 0;

Expand Down

0 comments on commit eba3d3b

Please sign in to comment.