dim @sum,@times,@tmp,@msg
msg 背包请空出10个格子
input @sum,请输入需要吃的豆子个数
let @sum,+,0
if @sum,=,0,完毕
let @times,=,@sum
let @times,/,10
let @times,int,@times
let @tmp,=,@times
let @tmp,*,10
let @sum,-,@tmp
log 1
say 出发，吃豆子去咯~
set 自动堆叠,1
set 快速战斗,1
set 自动逃跑,1
delay 1000
w 89,51,G
delay 100 
walkpos 84,51
delay 100  
walkpos 79,51
delay 100  
walkpos 75,51
delay 100  
walkpos 74,48
delay 100  
walkpos 74,43
delay 100  
walkpos 74,40
delay 100  
walkpos 71,40
delay 100  
walkpos 71,37
delay 100  
walkpos 71,35
delay 100  
walkpos 73,34
delay 100  
walkpos 75,34
delay 100  
waitmap 100,30
delay 1000 

walkpos 79,609
delay 100  
walkpos 78,605
delay 100  
walkpos 77,602
delay 100  
walkpos 78,602
delay 100  
walkpos 77,601
delay 100  
walkpos 76,597
delay 100  
walkpos 75,593
delay 100  
walkpos 74,589
delay 100  
walkpos 72,586
delay 100  
waitmap 2030,30
delay 1000 
walkpos 62,60 
walkpos 62,58 
W 62,58, C
delay 100    
say 买
waitdlg 通行证贩卖员,1,64,62
delay 500
buy 家族商店通行证,1
w 62,58,G
delay 100  
walkpos 57,58
delay 100
walkpos 54,58
delay 100   
walkpos 52,58
delay 100  
walkpos 47,58
delay 100
walkpos 47,59
delay 100
walkpos 46,59
delay 100
walkpos 45,59
delay 100    
walkpos 44,59
delay 100  
walkpos 43,60
delay 100  
walkpos 43,61
delay 100  
walkpos 43,62
delay 100  
walkpos 44,62
delay 100  
W 44,62,东
say hi
waitdlg 我是,1,41,44
button 确定 
delay 500
walkpos 1,7 
walkpos 1,8 
delay 100 
walkpos 1,9 
walkpos 2,9
delay 100  
walkpos 3,9 
walkpos 4,9

label 买豆子
delay 500
if @times,=,0,买剩余 
walkpos 5,9 
W 5,9, C   
say 买
waitdlg 贩卖服务员,1,3,-4
buy 聪明的豆子3,10
waititem ?,聪明的豆子3
delay 500
useitem 聪明的豆子3
delay 20
ifitem ?,=,聪明的豆子3,-2
let @times,-,1
goto 买豆子

label 买剩余
delay 500
if @sum,=,0,完毕
walkpos 5,9 
W 5,9, C  
say 买
waitdlg 贩卖服务员,1,3,-3
buy 聪明的豆子3,@sum
waititem ?,聪明的豆子3
delay 500
useitem 聪明的豆子3
delay 20
ifitem ?,=,聪明的豆子3,-2

label 完毕
set 自动逃跑,0
msg 吃豆子完毕！谢谢使用！
end