Skip to content
Outlands Hub

Razor script

Auto-PEACE

by dennozz · 234 lines
Download

Compatibility unverified

This community Razor script has not been tested in game by the Hub. Read its setup and client requirements before use.

1.20

Bard
Auto-PEACE.razor
1# This is an automated backup - check out https://outlands.uorazorscripts.com/script/48b06b54-1ede-4076-a9c4-f9b879f492fd for latest2# Automation by Jaseowns3## Script: Auto-PEACE4## Created by: dennozz#05#############################################6 7#Auto-PEACE 1.208 9#********** INFORMATION **********# 10 11#Made by @dennozz on discord. 12#Inspired/learned by other scrips in https://outlands.uorazorscripts.com/13 14#This script will auto peace the closest gray creature, if the creature is already peaced it will start looking for other nearby creatures.15 16#Optional: Set overhead messages on Razor > Display/Counters > Overhead messages17           #Add overhead messages when success peacemaking, fail peacemaking or skill needs to wait for use.18           19#********** SET YOUR SETTINGS **********#            20 21@setvar! attackAfterBarding 122 23#********** DO NOT EDIT FROM HERE UNLESS YOU KNOW HOW TO SCRIPT **********# 24 25@setvar! currentTarget 026@setvar! foundTarget 027 28removelist peacedCreatures29createlist peacedCreatures30 31#********** SET INSTRUMENT **********# 32 33if not varexist myInstruz34    @setvar! myInstruz 035endif36 37while findtype 3740|3742|3762|3763|10245|20006|20008|20010|20012|20014|20016 backpack as inst 38    getlabel inst myLabel39    40    if "supremely" in myLabel or "exceedingly" in myLabel41        @setvar! myInstruz inst42        break43    endif44    45    @ignore inst46endwhile47 48@clearignore49 50if not find myInstruz backpack51    clearsysmsg52    overhead "Select instrument:" 5553    @setvar! myInstruz54    wait 10055    while not targetexists and not insysmsg "Select"56        @setvar! myInstruz    57    endwhile58    wait 10059    if find myInstruz backpack as inst60        getlabel inst iLabel61        62        if "flute" in iLabel or "drums" in iLabel or "harp" in iLabel or "lute" in iLabel or "tambourine" in iLabel or "gemshorn" in iLabel or "hurdy" in iLabel or "psaltery" in iLabel or "sackbut" in iLabel or "shawm" in iLabel or "Vielle" in iLabel63            dclick inst64            wait 20065        else 66            @setvar! myInstruz 067            overhead "Not an instrument!" 3368            stop69        endif70    else71        @setvar! myInstruz 072        overhead "Not in backpack" 3373        stop    74    endif75endif76 77clearsysmsg78 79if targetexists80    hotkey 'cancel current target'81endif82 83getlabel myInstruz myLabel84sysmsg myLabel 4485 86#********* AUTO-SELECT NEW TARGET *********87 88sysmsg "Peace Start.." 6589hotkey 'target closest grey monster'90wait 2591 92if not find lasttarget ground -1 -1 1293    overhead 'No target found' 3394else95    while index != 2096        @setvar! tempTarget lasttarget 97        if index != 0 98            hotkey "next non-friendly monster target"99            @setvar! tempTarget lasttarget 100            #overhead "*{{index}}*" 34 tempTarget101            102            if index = 1103                @setvar! firstTarget lasttarget104            elseif firstTarget = tempTarget105                @setvar! foundTarget 2106                break107            endif108        endif109        110        if find tempTarget ground -1 -1 12111            getlabel tempTarget targetLabel112                        113            if "pacified" in targetLabel or "provoked" in targetLabel114                #next115                pushlist peacedCreatures tempTarget116            elseif "-" in targetLabel117                sysmsg "Label error, replaying search.." 34118                replay119            else 120                clearsysmsg121                122                skill 'begging'123                waitfortarget 325124                target tempTarget125                wait 100126                127                if insysmsg "Target cannot be seen"128                    sysmsg "*Not visible* [{{index}}]" 44129                    overhead  "*Not visible* [{{index}}]" 44 tempTarget130                elseif insysmsg "That is too far away"131                    overhead "*Too far* [{{index}}]" 44 tempTarget132                elseif insysmsg "You must wait"133                    overhead "*Skill cooldown*" 11134                    sysmsg "*Skill cooldown*" 11135                    break136                else137                    @setvar! foundTarget 1 138                    @setvar! currentTarget tempTarget139                    getlabel currentTarget myLabel140                    sysmsg "Target: {{myLabel}}" 55141                    break142                endif143                144            endif145        endif146        wait 50147    endwhile148endif149 150#********* PEACE IF TARGET FOUND *********151 152if 1 = foundTarget153    skill 'peacemaking'154    waitfortarget 650  155    156    if insysmsg "What instrument"    157        target myInstruz158        replay159    else 160        target currentTarget161    endif162    163    wait 100164    165    if insysmsg 'You fail to peace'166        overhead "Peace FAILED" 44 currentTarget167    elseif insysmsg "You play successfully, disrupting" 168        getlabel currentTarget myLabel169        overhead "{{myLabel}}" 88 currentTarget170    endif171    172    getlabel myInstruz instLabel173    174    if "(10/" in instLabel175        overhead "Instrument : 10 uses left" 33176        sysmsg "Instrument : 10 uses left" 33177    elseif "(8/" in instLabel178        overhead "Instrument : 8 uses left" 33179        sysmsg "Instrument : 8 uses left" 33180    elseif "(6/" in instLabel181        overhead "Instrument : 6 uses left" 33182        sysmsg "Instrument : 6 uses left" 33183    elseif "(4/" in instLabel184        overhead "Instrument : 4 uses left" 33185        sysmsg "Instrument : 4 uses left" 33186    elseif "(2/" in instLabel187        overhead "Instrument : 2 uses left" 33188        sysmsg "Instrument : 2 uses left" 33189    elseif "(1/" in instLabel190        overhead "Instrument : 1 use left" 33191        sysmsg "Instrument : 1 use left" 33192    endif193    194    if followers > 0195        say 'all guard me' 32196    endif197    198    if 1 = attackAfterBarding199        attack currentTarget200    endif201    202elseif 2 = foundTarget203    if followers > 0204        say 'all guard me' 32205    endif206    207    if 1 = attackAfterBarding208        hotkey 'target closest grey monster'209        attack lasttarget210    endif211    212    #look here for closest peaced target213    #foreach creature in peacedCreatures214        215    #endfor216    ###217endif218 219#********* SONG BUFF *********220 221if not findbuff "Song Of Peacemaking"222    wait 650223    skill 'peacemaking'224    wait 200225    226    if insysmsg "You must wait"227        overhead "Peace buff skill cooldown" 11228    else229        waitfortarget 650230        target backpack231    endif232endif233 234sysmsg "Peace Finish!" 44