剃刀:伐木

Z Endor Revived Wiki

Verze z 14. 2. 2024, 18:40, kterou vytvořil Pyhus (diskuse | příspěvky) (založena nová stránka s textem „==脚本==“)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)

該腳本會在您移動角色時拉動木材,同時嘗試每 2 秒砍倒角色西邊的一棵樹。該腳本允許玩家以最小的努力砍伐樹木,您可以在砍伐木材的同時在第二個顯示器上觀看 Netflix,只需避開野生動物即可。 😊

要求

  • 手裡拿著一把斧子,背包里最好有幾把備用斧子
  • 跑到有可以砍伐樹木的地方

腳本

// 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