Razor:Lumberjacking

Z Endor Revived Wiki

Tento skript tahá dřevo mezitím co hýbete se svou postavou a zároveň se snaží každé 2 vteřiny posekat strom na západ od vaší postavy. Tento skript umožňuje sekat stromy s minimálním úsilím z hráčské strany, naprosto bez problému si můžete pustit Netflix na druhém monitoru a zároveň sekat dřevo, jen se vyvarujte divoké zvěři. 😊

Požadavky

  • Mějte sekyrku v ruce a nejlépe pár náhradních seker v batohu.
  • Běžte na místo kde jsou stromy, které se dají sekat.

Skript

// Lumberjacking
// version 1.0

if listexists 'lumber-loghues'
    removelist 'lumber-loghues'
endif
createlist 'lumber-loghues'

### start of configuration ###

# logs that will be dropped on the ground 
# and dragged behind
pushlist 'lumber-loghues' "0"

### end of configuration ###

if not timerexists 'lumber - check'
    createtimer 'lumber - check'
endif

while 1 = 1
    // try lumbering tree north of character
    if timer 'lumber - check' > 2000
        sysmsg 'Checking for tree..'

        setvar! 'lumber-lumbering' 1
        while varexist! 'lumber-lumbering'
            clearsysmsg 
        
            if not lhandempty or not rhandempty
                hotkey 'use item in hand'
            elseif findtype 3907 'backpack' as 'tool' or findtype 3908 'backpack' as 'tool'
                dress 'tool'
                wait 500
                dclick 'tool'
            else
                sysmsg 'No tool found'
                stop
            endif
            waitfortarget 
            targetrelloc 0 -1

            setvar! 'lumber-wait' 1
            while varexist! 'lumber-wait'
                // invalid tile/use
                if insysmsg "What do you want to do" or insysmsg "That is too far away"
                    unsetvar! 'lumber-wait'
                    unsetvar! 'lumber-lumbering'
                endif
                // lubering done
                if insysmsg "There's not enough wood here to chop." or insysmsg "You stop chopping."
                    unsetvar! 'lumber-wait'
                    unsetvar! 'lumber-lumbering'
                endif
                // try again
                if insysmsg "Your tool broke"
                    unsetvar! 'lumber-wait'
                endif
                wait 50
            endwhile
            wait 250
        endwhile

        // drop all logs
        @clearignore
        foreach loghue in 'lumber-loghues'
            while findtype 7133 'backpack' loghue as 'backpackstack'
                @ignore 'backpackstack'
                while findtype 7133 'backpack' loghue as 'otherstack'
                    @ignore 'otherstack'
                endwhile
                
                lift 'backpackstack' 0
                if findtype 7133 true loghue as 'groundstack'
                    sysmsg 'Dropping {{loghue}} to ground stack'
                    drop 'groundstack'
                else
                    sysmsg 'Dropping {{loghue}} to ground location'
                    droprelloc 0 0
                endif
                wait 100
                
                @clearignore
            endwhile
        endfor
        @clearignore
        
        settimer 'lumber - check' 0
    endif

    // drag logs
    sysmsg 'Dragging logs..'
    @clearignore
    foreach loghue in 'lumber-loghues'
        while findtype 7133 'backpack' loghue as 'stack'
            @ignore 'stack'
        endwhile
        
        // first stack
        unsetvar! 'lumbervacuumgroundstack';
        while findtype 7133 true loghue as 'stack'
            lift 'stack' 0
            if varexist! 'lumbervacuumgroundstack'
                drop 'lumbervacuumgroundstack'
            else
                droprelloc 0 0
                setvar! 'lumbervacuumgroundstack' 'stack'
            endif
            wait 50
            @ignore 'stack'
        endwhile
    endfor
    @clearignore
endwhile