超级菜鸟求救合并问题,很着急,请高手们进来小帮助下小菜吧!
我是很菜的,我想把下面的两段代码合并为一段,我没学过什么电脑语言,所以请高手们不要说这语法错误,哪语句错误,我只希望你们能够给我修改下,发出合并后的代码,再次感谢!!第一段代码如下:
cid = Session("cid")
set rs=server.createobject("adodb.recordset")
sql="select top 15 * from [charac0] where c_id='"&cid&"'"
rs.open sql,conn,1,1
att = split(rs("m_body"),"\_1SKILL=")
tem1 = att(0)
btt = split(att(1),"\_1PK=")
tem2 = btt(1)
money = rs("c_sheaderc")
career = CInt(rs("c_sheaderb"))
if career=0 then
petact = "4294967166;4294967166;4294967166"
elseif career=1 then
petact = "1065353214;1065353214;1065353214"
elseif career=2 then
petact = "4290723710;4290723710;4290723710"
elseif career=3 then
petact = "131070;131070;131070"
end if
cast = 0
if money-cast<0 then
MSG("您的等级数据错误!")
exit sub
end if
niao = rs("c_headerc")
cast1 = 0
if niao-cast1<0 then
MSG("您的金钱数据错误!")
exit sub
end if
lev=lev+int(adlev)
money = money>cast
niao = niao-cast1
rlev = rlev
att = tem1&"\_1SKILL="&petact&"\_1PK="&tem2
rs.close
conn.execute("insert into bak select * from charac0 where c_id='"&cid&"'")
conn.execute("update charac0 set m_body='"&att&"', c_headerc='"&niao&"' where c_id='"&cid&"'")
call MSG("您的技能学全了")
exit sub
end sub
sub login()
第二段代码如下:
cid = Session("cid")
set rs=server.createobject("adodb.recordset")
sql="select top 15 * from [charac0] where c_id='"&cid&"'"
rs.open sql,conn,1,1
att = split(rs("m_body"),"\_1INVEN=")
tem1 = att(0)
middle = split(att(1),"\_1PETINV=")
tem3 = middle(0)
btt = split(middle(1),"\_1SKILLEX=")
tem2 = btt(0)
ctt = split(btt(1),"\_1SKLSLTEX=")
tem4 = ctt(1)
money = rs("c_sheaderc")
yuwan = split(rs("m_body"),"9682;32;")
heihe = split(rs("m_body"),"9913;32;")
cast = 0
if money-cast<0 then
MSG("您的等级数据错误!")
exit sub
end if
niao = rs("c_headerc")
cast1 = 0
cast2 = 0
if petact = "4294967295;0;0" then
cast1 = 100000000
cast2 =0
elseif petact = "4294967295;4294967295;0" then
cast1 = 200000000
cast2 = 0
else
cast1 = 300000000
cast2=0
end if
if niao-cast1<0 or ubound(yuwan)-cast2<0 or ubound(heihe)-cast2<0 then
MSG("您的金钱或升级物品数量不足!")
exit sub
end if
lev=lev+int(adlev)
money = money>cast
niao = niao-cast1
rlev = rlev
att =tem1&"\_1INVEN="&tem3&"\_1PETINV="&tem2&"\_1SKILLEX="&petact&"\_1SKLSLTEX="&tem4
rs.close
sql = "update charac0 set m_body='"&att&"', c_headerc='"&niao&"' where c_id='"&cid&"'"
conn.execute("insert into bak select * from charac0 where c_id='"&cid&"'")
conn.execute(sql)
call MSG("新技能学习成功!")
exit sub
end sub
sub login()
非常感谢!!!!希望愿帮菜鸟的朋友出现!!!