gotoifcoordsin(@smith,113,505,119,498)

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

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

@leavebank:
walkwait(102,510)
@lb2:
objcmd1(102,509)
wait(1000)
walknowait(103,508)
wait(1000)
gotoifcoordsin(@gotosmith,102,507,104,509)
goto(@lb2)

@gotosmith:
walkwait(112,501)
@gs2:
opendoor(113,501,open)
wait(1000)
walknowait(114,501)
wait(1000)
gotoifcoordsin(@smith,113,505,119,498)
goto(@gs2)
goto(@smith)

@door:
walkwait(113,501)
@gd2:
opendoor(113,501,open)
wait(1000)
walknowait(111,502)
wait(1000)
gotoifcoordsin(@getbank,112,504,109,499)
goto(@gd2)

@getbank:
walkwait(103,509)
@gb2:
objcmd1(102,509)
wait(1000)
walknowait(103,511)
wait(1000)
gotoifcoordsin(@bank,98,510,106,515)
goto(@gb2)

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

@kill:
stopandlogout()
