Auto-PEACE by dennozz
#Auto-PEACE 1.20
#********** INFORMATION **********#
#Made by @dennozz on discord.
#Inspired/learned by other scrips in https://outlands.uorazorscripts.com/
#This script will auto peace the closest gray creature, if the creature is already peaced it will start looking for other nearby creatures.
#Optional: Set overhead messages on Razor > Display/Counters > Overhead messages
#Add overhead messages when success peacemaking, fail peacemaking or skill needs to wait for use.
#********** SET YOUR SETTINGS **********#
@setvar! attackAfterBarding 1
#********** DO NOT EDIT FROM HERE UNLESS YOU KNOW HOW TO SCRIPT **********#
@setvar! currentTarget 0
@setvar! foundTarget 0
removelist peacedCreatures
createlist peacedCreatures
#********** SET INSTRUMENT **********#
if not varexist myInstruz
@setvar! myInstruz 0
endif
while findtype 3740|3742|3762|3763|10245|20006|20008|20010|20012|20014|20016 backpack as inst
getlabel inst myLabel
if "supremely" in myLabel or "exceedingly" in myLabel
@setvar! myInstruz inst
break
endif
@ignore inst
endwhile
@clearignore
if not find myInstruz backpack
clearsysmsg
overhead "Select instrument:" 55
@setvar! myInstruz
wait 100
while not targetexists and not insysmsg "Select"
@setvar! myInstruz
endwhile
wait 100
if find myInstruz backpack as inst
getlabel inst iLabel
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 iLabel
dclick inst
wait 200
else
@setvar! myInstruz 0
overhead "Not an instrument!" 33
stop
endif
else
@setvar! myInstruz 0
overhead "Not in backpack" 33
stop
endif
endif
clearsysmsg
if targetexists
hotkey 'cancel current target'
endif
getlabel myInstruz myLabel
sysmsg myLabel 44
#********* AUTO-SELECT NEW TARGET *********
sysmsg "Peace Start.." 65
hotkey 'target closest grey monster'
wait 25
if not find lasttarget ground -1 -1 12
overhead 'No target found' 33
else
while index != 20
@setvar! tempTarget lasttarget
if index != 0
hotkey "next non-friendly monster target"
@setvar! tempTarget lasttarget
#overhead "*{{index}}*" 34 tempTarget
if index = 1
@setvar! firstTarget lasttarget
elseif firstTarget = tempTarget
@setvar! foundTarget 2
break
endif
endif
if find tempTarget ground -1 -1 12
getlabel tempTarget targetLabel
if "pacified" in targetLabel or "provoked" in targetLabel
#next
pushlist peacedCreatures tempTarget
elseif "-" in targetLabel
sysmsg "Label error, replaying search.." 34
replay
else
clearsysmsg
skill 'begging'
waitfortarget 325
target tempTarget
wait 100
if insysmsg "Target cannot be seen"
sysmsg "*Not visible* [{{index}}]" 44
overhead "*Not visible* [{{index}}]" 44 tempTarget
elseif insysmsg "That is too far away"
overhead "*Too far* [{{index}}]" 44 tempTarget
elseif insysmsg "You must wait"
overhead "*Skill cooldown*" 11
sysmsg "*Skill cooldown*" 11
break
else
@setvar! foundTarget 1
@setvar! currentTarget tempTarget
getlabel currentTarget myLabel
sysmsg "Target: {{myLabel}}" 55
break
endif
endif
endif
wait 50
endwhile
endif
#********* PEACE IF TARGET FOUND *********
if 1 = foundTarget
skill 'peacemaking'
waitfortarget 650
if insysmsg "What instrument"
target myInstruz
replay
else
target currentTarget
endif
wait 100
if insysmsg 'You fail to peace'
overhead "Peace FAILED" 44 currentTarget
elseif insysmsg "You play successfully, disrupting"
getlabel currentTarget myLabel
overhead "{{myLabel}}" 88 currentTarget
endif
getlabel myInstruz instLabel
if "(10/" in instLabel
overhead "Instrument : 10 uses left" 33
sysmsg "Instrument : 10 uses left" 33
elseif "(8/" in instLabel
overhead "Instrument : 8 uses left" 33
sysmsg "Instrument : 8 uses left" 33
elseif "(6/" in instLabel
overhead "Instrument : 6 uses left" 33
sysmsg "Instrument : 6 uses left" 33
elseif "(4/" in instLabel
overhead "Instrument : 4 uses left" 33
sysmsg "Instrument : 4 uses left" 33
elseif "(2/" in instLabel
overhead "Instrument : 2 uses left" 33
sysmsg "Instrument : 2 uses left" 33
elseif "(1/" in instLabel
overhead "Instrument : 1 use left" 33
sysmsg "Instrument : 1 use left" 33
endif
if followers > 0
say 'all guard me' 32
endif
if 1 = attackAfterBarding
attack currentTarget
endif
elseif 2 = foundTarget
if followers > 0
say 'all guard me' 32
endif
if 1 = attackAfterBarding
hotkey 'target closest grey monster'
attack lasttarget
endif
#look here for closest peaced target
#foreach creature in peacedCreatures
#endfor
###
endif
#********* SONG BUFF *********
if not findbuff "Song Of Peacemaking"
wait 650
skill 'peacemaking'
wait 200
if insysmsg "You must wait"
overhead "Peace buff skill cooldown" 11
else
waitfortarget 650
target backpack
endif
endif
sysmsg "Peace Finish!" 44