Skip to content

Commit

Permalink
Harvest Potates with Grimme SE 260
Browse files Browse the repository at this point in the history
Courseplay#1546
Grimme SE 260 causes nil in tool.cp.driveOnAtFillLevel
  • Loading branch information
pseudex committed Jan 3, 2017
1 parent fc327f8 commit 1b2bc98
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions mode6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -446,23 +446,24 @@ function courseplay:handle_mode6(vehicle, allowedToDrive, workSpeed, lx , lz, re
if tool.pipeIsUnloading and (tool.courseplayers == nil or tool.courseplayers[1] == nil) and tool.cp.stopWhenUnloading and tankFillLevelPct >= 1 then
tool.stopForManualUnloader = true
end

if tool.cp.totalFillLevelPercent >= min(tool.cp.driveOnAtFillLevel,99) and tool.cp.hasUnloadingRefillingCourse then
if courseplay:timerIsThrough(tool, 'emptyStrawBox', false) then
if tool.cp.abortWork == nil then
courseplay:setAbortWorkWaypoint(tool);
courseplay:resetCustomTimer(tool, 'emptyStrawBox', true);

if tool.cp.driveOnAtFillLevel ~= nil then
if tool.cp.totalFillLevelPercent >= min(tool.cp.driveOnAtFillLevel,99) and tool.cp.hasUnloadingRefillingCourse then
if courseplay:timerIsThrough(tool, 'emptyStrawBox', false) then
if tool.cp.abortWork == nil then
courseplay:setAbortWorkWaypoint(tool);
courseplay:resetCustomTimer(tool, 'emptyStrawBox', true);
end
else
allowedToDrive = false;
end
else
allowedToDrive = false;
end
if tool.isStrawEnabled and courseplay:timerIsThrough(tool, 'emptyStrawBox', true) and tool.cp.abortWork == nil then
local strawTimer = tool.strawToggleTime or 3500;
strawTimer = strawTimer / 1000
courseplay:setCustomTimer(tool, 'emptyStrawBox', strawTimer);
end
end

if tool.isStrawEnabled and courseplay:timerIsThrough(tool, 'emptyStrawBox', true) and tool.cp.abortWork == nil then
local strawTimer = tool.strawToggleTime or 3500;
strawTimer = strawTimer / 1000
courseplay:setCustomTimer(tool, 'emptyStrawBox', strawTimer);
end
end
end
if tankFillLevelPct >= 100
or tool.waitingForDischarge
or (tool.cp.stopWhenUnloading and tool.pipeIsUnloading and tool.courseplayers and tool.courseplayers[1] ~= nil and tool.courseplayers[1].cp.modeState ~= 9)
Expand Down

0 comments on commit 1b2bc98

Please sign in to comment.