setvar(%middle,0)
setvar(%icount,0)
@main:
wait(10)
gotoiffighting(@main)
gotoifnpcnearbyname(@attack,wizard)
wait(50)
addvar(%icount,1)
gotoifnum1equalnum2(@ladders,%icount,3)
goto(@main)

@attack:
fightmode(1)
setvarfatigue(%f)
gotoifnum1equalnum2(@sleep,%f,100)
attacknearestbyname(wizard,true)
wait(600)
goto(@main)

@ladders:
setvar(%icount,0)
gotoifcoordsin(@down,219,1633,210,1642)
gotoifcoordsin(@up,208,684,228,705)

@down:
objcmd1(218,1636)
wait(300)
gotoifcoordsin(@down,219,1633,210,1642)
goto(@main)

@up:
objcmd1(218,692)
wait(300)
gotoifcoordsin(@up,208,684,228,705)
goto(@main)

@sleep:
wait(2000)
useitembyid(1263)
wait(2000)
waitforwakeup(28000)
gotoifsleeping(@sleep)
goto(@main)
