setvar(%lastserver,52)
setvar(%idlecount,0)
@main:
setvarcurrentstat(%attack,0)

gotoifnum1abovenum2(@str,%attack,51)
gotoifnum1equalnum2(@att,%attack,51)
@att:
fightmode(2)
goto(@main2)
@str:
fightmode(1)
goto(@main2)

@main2:
gotoifcountininventoryequal(@kill1,0,373)
@main3:
//gotoiffighting(@wait)
setvarcurrentstat(%hp,3)
gotoifnum1belownum2(@eat,%hp,25)
gotoifnpcnear(@attack,502)
addvar(%idlecount,1)
gotoifnum1abovenum2(@hop,%idlecount,1)
wait(200)
goto(@main)

@wait:
gotoiffighting(@wait)
goto(@main)

@attack:
setvar(%idlecount,0)
setvarfatigue(%f)
displayrs(%f)
gotoifnum1abovenum2(@sleep,%f,99)
attacknearestnpc(502,true)
wait(100)
goto(@main)

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

@hop:
gotoifnum1equalnum2(@52,%lastserver,56)
gotoifnum1equalnum2(@54,%lastserver,52)
gotoifnum1equalnum2(@56,%lastserver,54)
goto(@main)

@51:
setvar(%idlecount,0)
setvar(%lastserver,51)
switchserver(51)
goto(@main)

@52:
setvar(%idlecount,0)
setvar(%lastserver,52)
switchserver(52)
goto(@main)

@53:
setvar(%idlecount,0)
setvar(%lastserver,53)
switchserver(53)
goto(@main)

@54:
setvar(%idlecount,0)
setvar(%lastserver,54)
switchserver(54)
goto(@main)

@55:
setvar(%idlecount,0)
setvar(%lastserver,55)
switchserver(55)
goto(@main)

@56:
setvar(%idlecount,0)
setvar(%lastserver,56)
switchserver(56)
goto(@main)

@eat:
wait(100)
gotoiffighting(@eat)
eatanything()
wait(2000)
goto(@main)

@kill1:
gotoifcountininventoryequal(@kill2,0,330)
goto(@main3)
@kill2:
gotoifcountininventoryequal(@kill3,0,333)
goto(@main3)
@kill3:
gotoifcountininventoryequal(@kill,0,335)
goto(@main3)

@kill:
logout()
stop()
