-- 脚本名称:(示例)天天爱消除全自动刷分
-- 脚本描述:演示带界面的脚本，无实际功能
----------------------------------------------------

function createAddPointsWindow()
	--新窗口
	createWindow("my_window_1")
	createTextViewEx("my_window_1","UI_11","本机IMEI：")
	createEditTextEx("my_window_1","UI_IMEI",getIMEI())
	
	newLine("my_window_1")
	createTextViewEx("my_window_1","UI_11","充值卡号：")
	createEditTextEx("my_window_1","UI_card","FLKJ234234234")
	newLine("my_window_1")
	createButtonEx("my_window_1","UI_add_points","确定","addPoints")
end

function addPoints()
	UI_card = getText("my_window_1","UI_card")
	if UI_card == "FLKJ234234234" then
		toast("充值成功")
		closeWindow("my_window_1")
	else
		toast("卡号不正确，充值失败")
	end
end

function createUI()
	showLoopSetting(false)
	createTextView("UI_tv","账号:")
	createEditText("UI_qq","411324287",EDIT_TYPE_NUMBER,MATCH_PARENT,WRAP_CONTENT)
	newLine()
	
	createTextView("UI_tv","密码:")
	createEditText("UI_pwd","123456789",EDIT_TYPE_PASSWORD,MATCH_PARENT,WRAP_CONTENT)
	newLine()
	
	createCheckBox("UI_autoStartApp","自动启动",true)
	createCheckBox("UI_autoStart","自动开始",true)
	newLine()
	
	createCheckBox("UI_autoLogin","自动登录",false)
	createCheckBox("UI_autoPlay","自动消除",true)
	newLine()
	
	createTextView("UI_tv","模式选择:")
	newLine()
	
	createRadioBox("UI_type","经典模式",false)
	newLine()
	createRadioBox("UI_type","闪电模式",true)
	
	newLine()
	createButton("UI_btn","脚本充值","createAddPointsWindow")
	
end

function main()

	local str = string.format("QQ:%s\n密码：%s",UI_qq,UI_pwd);
	if UI_autoStartApp then
		str = string.format("%s\n自动启动游戏",str);
	end
	if UI_autoStart then
		str = string.format("%s\n自动开始游戏",str);
	end
	if UI_autoLogin then
		str = string.format("%s\n自动登录",str);
	end
	if UI_autoPlay then
		str = string.format("%s\n自动消除",str);
	end
	str = string.format("%s\n%s",str,UI_type);
	toast(str)
	
end

if getScriptElfVersion() < 200 then
   main()
end