TC官方合作论坛
标题:
调试不行,懂得进来看看,刚下载个脚本不能用,错误信.....
[打印本页]
作者:
328556289
时间:
2014-2-20 03:12
标题:
调试不行,懂得进来看看,刚下载个脚本不能用,错误信.....
>错误: 行号:2 错误信息:'int sgn'中出现不是命名规范中的字符,只能出现字母,数字和下划线
作者:
蓝色侠客
时间:
2014-2-20 10:59
代码贴不全,上哪知道
作者:
蓝色侠客
时间:
2014-2-20 10:59
去掉中间空格试试
作者:
星.月
时间:
2014-2-20 11:57
把int 去掉试试
作者:
328556289
时间:
2014-2-21 04:04
>错误: 行号:2 错误信息:'int sgn'中出现不是命名规范中的字符,只能出现字母,数字和下划线
namespace count
function int sgn(int a)//返回+1/-1函数
int b
if(a>0)
b=1
else
if(a==0)
b=0
else
if(a<0)
b=-1
endif
endif
endif
return b
endfunction
function int abs(int a)//绝对值函数
int b
if(a>0)
b=a
else
b=-a
endif
return b
endfunction
function int query(string a)//查找图片函数
int xyqx,xyqy,simx,simy,zsj,xsj,dsj,end
zsj=0
while(zsj<50)
xsj=system.gettickcount()
color.findpic(xyqx,xyqy,xyqx+640,xyqy+480,a,#101010,1.0,0,simx,simy)
if(simx>0)
end=1
break
endif
dsj=system.gettickcount()
zsj=zsj+dsj-xsj
endwhile
if(simx>0)
else
end=0
endif
return end
endfunction
function int[] querycool(string a)//查找图片返回坐标函数
int xyqx,xyqy,simx,simy,zsj,xsj,dsj,end
int[] xy=int[2]
zsj=0
while(zsj<400)
xsj=system.gettickcount()
color.findpic(xyqx,xyqy,xyqx+670,xyqy+500,a,#101010,1.0,0,simx,simy)
if(simx>0)
xy[0]=simx
xy[1]=simy
break
endif
dsj=system.gettickcount()
zsj=zsj+dsj-xsj
endwhile
if(xy[0]>0)
else
end=0
endif
return xy
endfunction
endnamespace
欢迎光临 TC官方合作论坛 (http://bbs.52tc.co/)
Powered by Discuz! X3.1