gotoifcoordsin(@smith,583,761,583,761)
gotoifcoordsin(@smith,582,761,582,761)
gotoifcoordsin(@smith,582,762,582,762)
gotoifcoordsin(@smith,583,762,583,762)
gotoifcoordsin(@smith,581,762,581,762)
gotoifcoordsin(@smith,581,762,581,763)
gotoifcoordsin(@smith,582,763,582,763)
gotoifcoordsin(@smith,583,763,583,763)
gotoifcoordsin(@smith,582,764,582,764)
gotoifcoordsin(@smith,584,762,584,762)

@bank:
repeatnextcommanduntilquestmenu(4000)
talktonearestnpc(95)
answer(0)
waitforbank(8000)
@smitheditem:
deposit(8,5)
deposit(8,1)
wait(50)
gotoifininventory(@smitheditem,8)
setvar(%i,0)
@bars:
addvar(%i,1)
debugrs(%i)
gotoifnum1abovenum2(@kill,%i,300)
withdraw(170,1)
wait(30)
gotoifbagfull(@pick)
goto(@bars)

@smith:
repeatnextcommanduntilquestmenu(800)
useitemwithobject(583,764,170)
@smith2:
waitforquestmenu(2000)
answer(1)
waitforquestmenu(2000)
answer(2)
waitforquestmenu(2000)
answer(1)
wait(500)
@smith3:
useitemwithobject(583,764,170)
waitforquestmenu(2000)
setvarfatigue(%f)
gotoifnum1abovenum2(@sleep,%f,95)
gotoifcountininventorygreater(@smith2,4,170)
goto(@door)

@pick:
closedoor(581,761)
wait(500)
gotoifcoordsin(@smith,583,761,583,761)
gotoifcoordsin(@smith,582,761,582,761)
gotoifcoordsin(@smith,582,762,582,762)
gotoifcoordsin(@smith,583,762,583,762)
gotoifcoordsin(@smith,581,762,581,762)
gotoifcoordsin(@smith,581,762,581,763)
gotoifcoordsin(@smith,582,763,582,763)
gotoifcoordsin(@smith,583,763,583,763)
gotoifcoordsin(@smith,582,764,582,764)
gotoifcoordsin(@smith,584,762,584,762)
goto(@pick)

@door:
opendoor(581,761,open)
wait(500)
gotoifcoordsin(@bank,581,761,579,759)
goto(@bank)

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

@kill:
stopandlogout()