Skip to content
Outlands Hub

Razor script

Plants - The Auto-Gardener

by jfrostp · 377 lines
Download

Auto-gardener by Frost Make sure to have lots of gardening tools in your backpack. You will be prompted for any new seeds to plant. This script will use the first planter spade it finds in your pack, so be sure to only have the one you…

Plants - The Auto-Gardener.razor
1# This is an automated backup - check out https://outlands.uorazorscripts.com/script/7e444b9b-24ae-49d9-b181-d7544cf01380 for latest2# Automation by Jaseowns3## Script: Plants - The Auto-Gardener4## Created by: jfrostp#05#############################################6 7# Auto-gardener by Frost8# Make sure to have lots of gardening tools in your backpack.9# You will be prompted for any new seeds to plant.10# This script will use the first planter spade it finds in your pack, so be sure to only have the one you want to use in your pack.11 12# Adjust the variables below to turn on/off what you want the script to manage. It defaults to doing everything.13 14# Set these if you want it to cure **detrimental** effects15setvar! cureCreatures 116setvar! cureFungus 117setvar! curePestilents 118 19# Set these for how you want it to 20setvar! useFertilizer 121setvar! useGrowthSerum 122setvar! useWaterBooster 123setvar! useHeatingGrate 124 25setvar! plantSeeds 126 27# Set this if you are near water and want it to refill your watering cans for you28setvar! autoRefillWateringCans 029 30#-------------------------------------------31#-------------------------------------------32clearignore33clearsysmsg34gumpclose35setvar! debug 036 37if autoRefillWateringCans = 138    overhead 'Refilling watering cans..'39    while findtype 25570 backpack as wateringCan40        getlabel wateringCan waterLevel41        if " 0/" in waterLevel42            dclick wateringCan43            wait 75044            45            if insysmsg "nearby water"46                break47            endif48        endif49        ignore wateringCan50    endwhile51    clearignore52endif53 54# Harvest any finished plants first55while findtype 6330|6333|6334|6335|6337|6338|6341|28987|6341|4550|4551|6327|6328|6330 true as planter56    getlabel planter planterLabel57    58    if "arvest" in planterLabel59        dclick planter60        waitforgump 322460837561        wait 15062        gumpresponse 263        waitforgump 322460837564        wait 15065        gumpclose66    endif67    68    @ignore planter69endwhile70 71clearignore72 73while findtype 6330|6333|6334|6335|6337|6338|6341|28987|6341|4550|4551|6327|6328|6330 true as planter74    if debug = 175        overhead 'Begin planter'76    endif77    clearsysmsg78    getlabel planter planterLabel79    dclick planter80    waitforgump 322460837581    wait 15082    83    if "%" in planterLabel84        gumpresponse 285        waitfortarget86        waitforgump 322460837587    elseif plantSeeds = 088        ignore planter89        continue90    else91        gumpclose92        gumpclose 93        wait 50094        dclick planter95        wait 10096        waitforgump 322460837597        98        overhead 'Select a seed to plant'99        unsetvar seed100        setvar! seed101        102        gumpresponse 2103        waitfortarget104        waitforgump 3224608375105        target seed106        107        if debug = 1108            overhead 'planting new seed'109            overhead seed110        endif111        if insysmsg "not a plant seed"112            overhead 'No seed selected, aborting script'113            stop114        endif115        waitforgump 3224608375116        117        # Estimate levels for new plant118        gumpresponse 3119        waitforgump 3224608375120        gumpresponse 4121        waitforgump 3224608375122        gumpresponse 5123        waitforgump 3224608375124        wait 150125    endif126    127    if debug = 1128        overhead 'heat'129    endif130    # Add boosters if missing131    if useHeatingGrate = 1132        if findtype 28741|11942|28719 backpack as heatingGrate133            gumpresponse 2134            waitfortarget 135            waitforgump 3224608375136            target heatingGrate137            wait 300138        else139            overhead 'Out of heating grates!'140        endif141    endif142    143    if debug = 1144        overhead 'filter'145    endif146    if useWaterBooster = 1147        if findtype 20501|20502|20503 backpack as waterBooster148            gumpresponse 2149            waitfortarget 150            waitforgump 3224608375151            target waterBooster152            wait 300153        else154            overhead 'Out of water boosters!'155        endif156    endif157    158    if debug = 1159        overhead 'fert'160    endif161    if useFertilizer = 1162        if findtype 4154|19403|29217 backpack as fertilizer163            gumpresponse 2164            waitfortarget 165            waitforgump 3224608375166            target fertilizer167            wait 300168        else169            overhead 'Out of fertilizer!'170        endif171    endif172    173    if debug = 1174        overhead 'growth'175    endif176    if useGrowthSerum = 1177        if findtype 20498|20499|20500 backpack as growthSerum178            gumpresponse 2179            waitfortarget 180            waitforgump 3224608375181            target growthSerum182            wait 300183        else184            overhead 'Out of growth serum!'185        endif186    endif187    188    if debug = 1189        overhead 'watering'190    endif191    # Water192    clearsysmsg193    setvar! waterDone 0194    while findtype 25570 backpack as wateringCan195        # Use watering cans until done196        getlabel wateringCan waterLevel197        if " 0/" in waterLevel198            ignore wateringCan199        else200            gumpresponse 2201            waitfortarget202            waitforgump 3224608375203            target wateringCan204            waitforgump 3929333591205            gumpresponse 2206            waitforgump 3929333591207            gumpclose 3929333591208            209            if insysmsg "not yet estimated"210                # Estimate levels211                gumpclose 3224608375212                wait 500213                dclick planter214                wait 100215                waitforgump 3224608375216                gumpresponse 3217                waitforgump 3224608375218                219                if insysmsg "spade is required"220                    overhead 'No plater spade found!'221                    stop222                endif223                224                gumpresponse 4225                waitforgump 3224608375226                gumpresponse 5227                waitforgump 3224608375228                wait 150229            endif230        endif231        232        if insysmsg "unable to meet"233            gumpclose234            gumpclose 235            wait 500236            dclick planter237            wait 100238            waitforgump 3224608375239            ignore wateringCan240        else241            setvar! waterDone 1242            break243        endif244        wait 200245    endwhile246    gumpclose 3224608375247    wait 500248    249    if waterDone = 0250        overhead 'Out of water!'251        stop252    endif253    254    if debug = 1255        overhead 'soil'256    endif257    # Soil258    clearsysmsg 259    setvar! soil 0260    if findtype 2323 backpack as dirt261        setvar! soil dirt262    endif263    if soil = 0264        overhead 'Out of soil'265        stop266    endif267    dclick planter268    wait 100269    waitforgump 3224608375270    gumpresponse 2271    waitfortarget272    waitforgump 3224608375273    target soil274    waitforgump 3224608375275    waitforgump 4024474571276    gumpresponse 2277    waitforgump 3224608375278    waitforgump 4024474571279    gumpclose 3224608375280    wait 500281    282    # Labor and toil283    dclick planter284    wait 100285    waitforgump 3224608375286    gumpresponse 2287    waitfortarget288    289    if findtype 29868 backpack as spade290        target spade291    else292        overhead 'No spade found in backpack!'293        stop294    endif295 296    waitforgump 1429840072297    gumpresponse 6298    waitforgump 3224608375299    waitforgump 1429840072300    gumpclose 1429840072301    gumpclose 3224608375302    wait 500303    304    # Pests/etc305    if debug = 1306        overhead 'cure detrimental pests'307    endif308    dclick planter309    wait 100310    waitforgump 3224608375311    312    # Try to fix up to 3 negative effects313    for 3314        gumpresponse 10315        waitforgump 3224608375316        wait 100317        if insysmsg 'Reduces'318            gumpresponse 10319            waitforgump 3224608375320            wait 100321            if insysmsg 'Fungal' and cureFungus = 1322                if findtype 6193 backpack as cure323                    overhead 'Cured fungus'324                    gumpresponse 2325                    waitfortarget326                    waitforgump 3224608375327                    target cure328                    wait 500329                else330                    overhead 'Out of fungicide!'331                endif332            endif333            gumpresponse 10334            waitforgump 3224608375335            wait 100336            if insysmsg 'Creature' and cureCreatures = 1337                if findtype 29343 backpack as cure338                    overhead 'Cured creature'339                    gumpresponse 2340                    waitfortarget341                    waitforgump 3224608375342                    target cure343                    wait 500344                else345                    overhead 'Out of farmers almanacs!'346                endif347            endif348            gumpresponse 10349            waitforgump 3224608375350            wait 100351            if insysmsg 'Pestilent' and curePestilents = 1352                if findtype 6187 backpack as cure353                    overhead 'Cured pestilent'354                    gumpresponse 2355                    waitfortarget356                    waitforgump 3224608375357                    target cure358                    wait 500359                else360                    overhead 'Out of defoliant!'361                endif362            endif363        else364            break365        endif366    endfor367    368    if debug = 1369        overhead 'Planter done'370    endif371    372    ignore planter373endwhile374 375gumpclose376overhead 'Done! Move to the next 3x3 area of planters'377clearignore