# Python Script for CTerm 3.2
# 以变量循环方式连续发文
# 分别设定循环次数、贴子标题、贴子正文，即可连续发文
# Nullspace, Batli. 在SMTH、BYHH上测试通过

import CTerm
import tools
import sys, string, random, glob, os

ID=long(sys.argv[0])
#print "sessionID is %s"%ID

for i in range(3):				#循环次数
	j=i+1
	title='%d 只青蛙 %d 张嘴'%(j,j)					#贴子标题
	content='%d 只眼睛 %d 条腿 \n \n'%(2*j,4*j)		#贴子正文
	SendString(ID, '\x10')
	dataEvents[ID].wait()
	SendString(ID, title)
	dataEvents[ID].wait()
	SendString(ID, '\n')
	dataEvents[ID].wait()
	SendString(ID, '\n')
	dataEvents[ID].wait()
	SendString(ID, content)
	SendString(ID, '\x17\n')
	dataEvents[ID].wait()
	
#	data=['\x10', title, '\n', '\n', content, '\x17']
#	for item in data:
#		SendString(ID, item)
#	SendString(ID,'\n')
#	WaitFor(ID, SST_LIST)
