Razor:Mining: Porovnání verzí

Z Endor Revived Wiki

(založena nová stránka s textem „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. *…“)
 
(Tato verze je označená pro překlad)
 
(Nejsou zobrazeny 2 mezilehlé verze od stejného uživatele.)
Řádek 1: Řádek 1:
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. 😊
<translate>
<!--T:1-->
Tento skript těží do pěti směrů - 4 kolmé na nakonfigurovaný směr chůze a jeden přímo pod vámi. Když je těchto 5 polí vytěženo, skript vás přesune o jedno pole v nakonfigurovaném směru, veškerou nakonfigurovanou rudu vyhodí z batohu na zem a dá rudu pod vaši postavu. Varování - veme to veškerou rudu 2 pole od vaší postavy, takže se držte dál od jiných hráčů, pokud ovšem nemilujete drama. 😊


<!--T:2-->
== Požadavky ==
== Požadavky ==
* Mějte lopatu nebo krumpáč v ruce a nejlépe i nějaké náhradní ve svém batohu.
* Běžte do jeskyně, ve které se dá těžit.


* Mějte sekyrku v ruce a nejlépe pár náhradních seker v batohu.
== Skript == <!--T:3-->
* Běžte na místo kde jsou stromy, které se dají sekat.
</translate>


== Skript ==
<pre>// Mining
// version 1.1
//
// Changelog:
// 1.1: added food checking


<pre>// Lumberjacking
if listexists 'mine-direction'
// version 1.0
    removelist 'mine-direction'
 
endif
if listexists 'lumber-loghues'
createlist 'mine-direction'
     removelist 'lumber-loghues'
if listexists 'mine-orehues'
    removelist 'mine-orehues'   
endif
createlist 'mine-orehues'
if listexists 'mine-foodtypes'
     removelist 'mine-foodtypes'  
endif
endif
createlist 'lumber-loghues'
createlist 'mine-foodtypes'


### start of configuration ###
### start of configuration ###


# logs that will be dropped on the ground
# change mining direction here
# and dragged behind
# must be exactly one of these values: West East North South
pushlist 'lumber-loghues' &quot;0&quot;
pushlist 'mine-direction' 'West'
 
# change which ores you want dropped on ground and dragged behind here
# note that if ore drops to ground due to weight and is not listed here it will be left on the spot
# iron ore
pushlist 'mine-orehues' &quot;0&quot;
# copper ore
pushlist 'mine-orehues' &quot;1118&quot;
# tin ore
pushlist 'mine-orehues' &quot;2401&quot;
# lead ore
pushlist 'mine-orehues' &quot;1045&quot;
# zinc ore
pushlist 'mine-orehues' &quot;2403&quot;
# silver ore
pushlist 'mine-orehues' &quot;2951&quot;
# gold ore
pushlist 'mine-orehues' &quot;2213&quot;
# gorinite ore
pushlist 'mine-orehues' &quot;1645&quot;
# chlorite ore
pushlist 'mine-orehues' &quot;2128&quot;
# hieronite ore
pushlist 'mine-orehues' &quot;2428&quot;
# sangvine ore
pushlist 'mine-orehues' &quot;41&quot;
# arite ore
pushlist 'mine-orehues' &quot;1344&quot;
 
# change which foods do you want to try to consume from your backpack
# cuts of ribs
pushlist 'mine-foodtypes' 2546
# fish steak
pushlist 'mine-foodtypes' 2427


### end of configuration ###
### end of configuration ###


if not timerexists 'lumber - check'
if listexists 'mine-locations'
     createtimer 'lumber - check'
     removelist 'mine-locations'
endif
endif
createlist 'mine-locations'
pushlist 'mine-locations' -2
pushlist 'mine-locations' -1
pushlist 'mine-locations' 0
pushlist 'mine-locations' 1
pushlist 'mine-locations' 2


while 1 = 1
# eat
    // try lumbering tree north of character
setvar! 'mine-hungry' 1
    if timer 'lumber - check' &gt; 2000
while varexist! 'mine-hungry'
        sysmsg 'Checking for tree..'
    clearsysmsg


        setvar! 'lumber-lumbering' 1
    setvar! 'mine-eating' 1
         while varexist! 'lumber-lumbering'
    foreach foodtype in 'mine-foodtypes'
             clearsysmsg
         if varexist! 'mine-eating' and findtype foodtype 'backpack' as 'food'
          
             dclick 'food'
            if not lhandempty or not rhandempty
            unsetvar! 'mine-eating'
                hotkey 'use item in hand'
            wait 250
            elseif findtype 3907 'backpack' as 'tool' or findtype 3908 'backpack' as 'tool'
        endif
                dress 'tool'
    endfor
                wait 500
   
                dclick 'tool'
    if varexist! 'mine-eating'
             else
        sysmsg 'Warning: no food'
                 sysmsg 'No tool found'
         unsetvar! 'mine-hungry'
                 stop
    endif
   
    if insysmsg 'You are too full to eat any more'
        unsetvar! 'mine-hungry'
    endif
   
endwhile
 
# cut gems
@clearignore
while findtype 5031 'backpack' as 'chunk'
    if findtype 7868 'backpack' 5 as 'tool'
        clearsysmsg
        dclick 'tool'
        waitfortarget
        target 'chunk'
        while 1 = 1
            if insysmsg 'Your tool broke'
                break;
             endif
            if insysmsg 'You have created a gem'
                 break;
            endif
            if insysmsg 'You have failed to create a gem'
                 break;
             endif
             endif
             waitfortarget
              
             targetrelloc 0 -1
             wait 50
        endwhile
        wait 250
    else
        break
    endif
endwhile
 
# mine locations
foreach loc in 'mine-locations'
    if inlist 'mine-direction' 'West' or inlist 'mine-direction' 'East'
        sysmsg 'Mining at 0 {{loc}}'
    elseif inlist 'mine-direction' 'North' or inlist 'mine-direction' 'south'
        sysmsg 'Mining at {{loc}} 0'
    else
        sysmsg 'Mining direction is misconfigured'
        stop
    endif


            setvar! 'lumber-wait' 1
    setvar! 'mine_minespot' 1
            while varexist! 'lumber-wait'
    while varexist 'mine_minespot'
                // invalid tile/use
        clearsysmsg
                if insysmsg &quot;What do you want to do&quot; or insysmsg &quot;That is too far away&quot;
       
                    unsetvar! 'lumber-wait'
        // shovel &gt; rhand &gt; pickaxe in bag
                    unsetvar! 'lumber-lumbering'
        if findtype 3897 'backpack' as 'tool'
                endif
            dclick 'tool'  
                // lubering done
        elseif not rhandempty
                if insysmsg &quot;There's not enough wood here to chop.&quot; or insysmsg &quot;You stop chopping.&quot;
            hotkey 'use item in hand'
                    unsetvar! 'lumber-wait'
        elseif findtype 3718 'backpack' as 'tool' or findtype 3717 'backpack' as 'tool'
                    unsetvar! 'lumber-lumbering'
            dress 'tool'
                endif
            while rhandempty
                // try again
                if insysmsg &quot;Your tool broke&quot;
                    unsetvar! 'lumber-wait'
                endif
                 wait 50
                 wait 50
             endwhile
             endwhile
             wait 250
             wait 500
            dclick 'tool'
        else
            sysmsg 'No tool found'
            stop
        endif
       
        waitfortarget
        if inlist 'mine-direction' 'West' or inlist 'mine-direction' 'East'
            targetrelloc 0 loc
        elseif inlist 'mine-direction' 'North' or inlist 'mine-direction' 'south'
            targetrelloc loc 0
        else
            sysmsg 'Mining direction is misconfigured'
            stop
        endif
       
        setvar! 'mine_wait' 1
        while varexist 'mine_wait'
            if insysmsg 'You can mine only from cave floor' or insysmsg 'That is too far away' or insysmsg &quot;You cannot see that&quot;
                unsetvar! 'mine_wait'
                unsetvar! 'mine_minespot'
            elseif insysmsg 'there is no more'
                unsetvar! 'mine_wait'
                unsetvar! 'mine_minespot'
            elseif insysmsg 'tool broke'
                unsetvar! 'mine_wait'
            endif
            wait 500
         endwhile
         endwhile


        // drop all logs
    endwhile
        @clearignore
endfor
        foreach loghue in 'lumber-loghues'
 
            while findtype 7133 'backpack' loghue as 'backpackstack'
# change direction to next spot
                @ignore 'backpackstack'
foreach step in 'mine-direction'
                while findtype 7133 'backpack' loghue as 'otherstack'
    walk step
                    @ignore 'otherstack'
endfor
                endwhile
# make step on next spot
               
foreach step in 'mine-direction'
                lift 'backpackstack' 0
    walk step
                if findtype 7133 true loghue as 'groundstack'
endfor
                    sysmsg 'Dropping {{loghue}} to ground stack'
 
                    drop 'groundstack'
wait 500
                else
                    sysmsg 'Dropping {{loghue}} to ground location'
                    droprelloc 0 0
                endif
                wait 100
               
                @clearignore
            endwhile
        endfor
        @clearignore
       
        settimer 'lumber - check' 0
    endif


    // drag logs
# drop ores from backpack
    sysmsg 'Dragging logs..'
@clearignore
    @clearignore
foreach orehue in 'mine-orehues'
    foreach loghue in 'lumber-loghues'
    while findtype 6585 'backpack' orehue as 'backpackstack'
         while findtype 7133 'backpack' loghue as 'stack'
        @ignore 'backpackstack'
             @ignore 'stack'
         while findtype 6585 'backpack' orehue as 'otherstack'
             @ignore 'otherstack'
         endwhile
         endwhile
          
          
         // first stack
         lift 'backpackstack' 0
        unsetvar! 'lumbervacuumgroundstack';
        if findtype 6585 true orehue as 'groundstack'
        while findtype 7133 true loghue as 'stack'
            sysmsg 'Dropping {{orehue}} to ground stack'
            lift 'stack' 0
            drop 'groundstack'
            if varexist! 'lumbervacuumgroundstack'
        else
                drop 'lumbervacuumgroundstack'
            sysmsg 'Dropping {{orehue}} to ground location'
            else
            droprelloc 0 0
                droprelloc 0 0
        endif
                setvar! 'lumbervacuumgroundstack' 'stack'
        wait 150
            endif
       
            wait 50
        @clearignore
            @ignore 'stack'
    endwhile
        endwhile
endfor
     endfor
 
     @clearignore
wait 500
endwhile</pre>
 
# drag ores under our character
@clearignore
foreach orehue in 'mine-orehues'
    // backpack ores should have been dropped already
    // but to be sure lets ignore them
    while findtype 6585 'backpack' orehue as 'stack'
        @ignore 'stack'
    endwhile
   
    // first stack
    unsetvar! 'minevacuumgroundstack';
    while findtype 6585 true orehue as 'stack'
        lift 'stack' 0
        if varexist! 'minevacuumgroundstack'
            drop 'minevacuumgroundstack'
        else
            droprelloc 0 0
            setvar! 'minevacuumgroundstack' 'stack'
        endif
        wait 150
        @ignore 'stack'
    endwhile
endfor
 
wait 500
 
// pickup all chunks
@clearignore
while findtype 5031 'backpack' as 'chunk'
    @ignore 'chunk'
endwhile
while findtype 5031 true as 'chunk'
     lift 'chunk' 0
    drop 'backpack' -1 -1
    wait 150
     @ignore 'chunk'
endwhile
 
// go again
loop</pre>

Aktuální verze z 12. 2. 2024, 20:45

Tento skript těží do pěti směrů - 4 kolmé na nakonfigurovaný směr chůze a jeden přímo pod vámi. Když je těchto 5 polí vytěženo, skript vás přesune o jedno pole v nakonfigurovaném směru, veškerou nakonfigurovanou rudu vyhodí z batohu na zem a dá rudu pod vaši postavu. Varování - veme to veškerou rudu 2 pole od vaší postavy, takže se držte dál od jiných hráčů, pokud ovšem nemilujete drama. 😊

Požadavky

  • Mějte lopatu nebo krumpáč v ruce a nejlépe i nějaké náhradní ve svém batohu.
  • Běžte do jeskyně, ve které se dá těžit.

Skript

// Mining
// version 1.1
//
// Changelog:
// 1.1: added food checking

if listexists 'mine-direction'
    removelist 'mine-direction'
endif
createlist 'mine-direction'
if listexists 'mine-orehues'
    removelist 'mine-orehues'    
endif
createlist 'mine-orehues'
if listexists 'mine-foodtypes'
    removelist 'mine-foodtypes'    
endif
createlist 'mine-foodtypes'

### start of configuration ###

# change mining direction here
# must be exactly one of these values: West East North South
pushlist 'mine-direction' 'West'

# change which ores you want dropped on ground and dragged behind here
# note that if ore drops to ground due to weight and is not listed here it will be left on the spot
# iron ore
pushlist 'mine-orehues' "0"
# copper ore
pushlist 'mine-orehues' "1118"
# tin ore
pushlist 'mine-orehues' "2401"
# lead ore
pushlist 'mine-orehues' "1045"
# zinc ore
pushlist 'mine-orehues' "2403"
# silver ore
pushlist 'mine-orehues' "2951"
# gold ore
pushlist 'mine-orehues' "2213"
# gorinite ore
pushlist 'mine-orehues' "1645"
# chlorite ore
pushlist 'mine-orehues' "2128"
# hieronite ore
pushlist 'mine-orehues' "2428"
# sangvine ore
pushlist 'mine-orehues' "41"
# arite ore
pushlist 'mine-orehues' "1344"

# change which foods do you want to try to consume from your backpack
# cuts of ribs
pushlist 'mine-foodtypes' 2546
# fish steak 
pushlist 'mine-foodtypes' 2427

### end of configuration ###

if listexists 'mine-locations'
    removelist 'mine-locations'
endif
createlist 'mine-locations'
pushlist 'mine-locations' -2
pushlist 'mine-locations' -1
pushlist 'mine-locations' 0
pushlist 'mine-locations' 1
pushlist 'mine-locations' 2

# eat
setvar! 'mine-hungry' 1
while varexist! 'mine-hungry'
    clearsysmsg 

    setvar! 'mine-eating' 1
    foreach foodtype in 'mine-foodtypes'
        if varexist! 'mine-eating' and findtype foodtype 'backpack' as 'food'
            dclick 'food'
            unsetvar! 'mine-eating'
            wait 250
        endif
    endfor
    
    if varexist! 'mine-eating'
        sysmsg 'Warning: no food'
        unsetvar! 'mine-hungry'
    endif
    
    if insysmsg 'You are too full to eat any more'
        unsetvar! 'mine-hungry'
    endif
    
endwhile

# cut gems
@clearignore
while findtype 5031 'backpack' as 'chunk'
    if findtype 7868 'backpack' 5 as 'tool'
        clearsysmsg 
        dclick 'tool'
        waitfortarget 
        target 'chunk'
        while 1 = 1
            if insysmsg 'Your tool broke'
                break;
            endif
            if insysmsg 'You have created a gem'
                break;
            endif
            if insysmsg 'You have failed to create a gem'
                break;
            endif
            
            wait 50
        endwhile
        wait 250
    else
        break
    endif
endwhile

# mine locations
foreach loc in 'mine-locations'
    if inlist 'mine-direction' 'West' or inlist 'mine-direction' 'East'
        sysmsg 'Mining at 0 {{loc}}'
    elseif inlist 'mine-direction' 'North' or inlist 'mine-direction' 'south'
        sysmsg 'Mining at {{loc}} 0'
    else
        sysmsg 'Mining direction is misconfigured'
        stop
    endif

    setvar! 'mine_minespot' 1
    while varexist 'mine_minespot'
        clearsysmsg
        
        // shovel > rhand > pickaxe in bag
        if findtype 3897 'backpack' as 'tool'
            dclick 'tool'    
        elseif not rhandempty
            hotkey 'use item in hand'
        elseif findtype 3718 'backpack' as 'tool' or findtype 3717 'backpack' as 'tool'
            dress 'tool'
            while rhandempty
                wait 50
            endwhile
            wait 500
            dclick 'tool'
        else
            sysmsg 'No tool found'
            stop
        endif
        
        waitfortarget 
        if inlist 'mine-direction' 'West' or inlist 'mine-direction' 'East'
            targetrelloc 0 loc
        elseif inlist 'mine-direction' 'North' or inlist 'mine-direction' 'south'
            targetrelloc loc 0
        else
            sysmsg 'Mining direction is misconfigured'
            stop
        endif
        
        setvar! 'mine_wait' 1
        while varexist 'mine_wait'
            if insysmsg 'You can mine only from cave floor' or insysmsg 'That is too far away' or insysmsg "You cannot see that"
                unsetvar! 'mine_wait'
                unsetvar! 'mine_minespot'
            elseif insysmsg 'there is no more'
                unsetvar! 'mine_wait'
                unsetvar! 'mine_minespot'
            elseif insysmsg 'tool broke'
                unsetvar! 'mine_wait'
            endif
            wait 500
        endwhile

    endwhile
endfor

# change direction to next spot
foreach step in 'mine-direction'
    walk step
endfor
# make step on next spot
foreach step in 'mine-direction'
    walk step
endfor

wait 500

# drop ores from backpack
@clearignore
foreach orehue in 'mine-orehues'
    while findtype 6585 'backpack' orehue as 'backpackstack'
        @ignore 'backpackstack'
        while findtype 6585 'backpack' orehue as 'otherstack'
            @ignore 'otherstack'
        endwhile
        
        lift 'backpackstack' 0
        if findtype 6585 true orehue as 'groundstack'
            sysmsg 'Dropping {{orehue}} to ground stack'
            drop 'groundstack'
        else
            sysmsg 'Dropping {{orehue}} to ground location'
            droprelloc 0 0
        endif
        wait 150
        
        @clearignore
    endwhile
endfor

wait 500

# drag ores under our character
@clearignore
foreach orehue in 'mine-orehues'
    // backpack ores should have been dropped already
    // but to be sure lets ignore them
    while findtype 6585 'backpack' orehue as 'stack'
        @ignore 'stack'
    endwhile
    
    // first stack
    unsetvar! 'minevacuumgroundstack';
    while findtype 6585 true orehue as 'stack'
        lift 'stack' 0
        if varexist! 'minevacuumgroundstack'
            drop 'minevacuumgroundstack'
        else
            droprelloc 0 0
            setvar! 'minevacuumgroundstack' 'stack'
        endif
        wait 150
        @ignore 'stack'
    endwhile
endfor

wait 500

// pickup all chunks
@clearignore
while findtype 5031 'backpack' as 'chunk'
    @ignore 'chunk'
endwhile
while findtype 5031 true as 'chunk'
    lift 'chunk' 0
    drop 'backpack' -1 -1
    wait 150
    @ignore 'chunk'
endwhile

// go again
loop