function kickbot_callback_loop( _index_me)
local i;
for i = 1, table.getn(kickbot_maplist) do
local tbl_p = NLG.GetMapPlayer(0,kickbot_maplist);
if(type(tbl_p) == "table")then
-- print("\nyes!table!\n"..table.getn(tbl_p).."\nbut"..NLG.GetMapPlayerNum(0,1000).."\n");
if(tbl_p == nil)then
print("table but nil!\n")
end
local j;
for j = 1, table.getn(tbl_p) do
local skipflag = false;
local class = Char.GetData(tbl_p[j], %对象_职业%);
local k;
for k = 1, table.getn(kickbot_class) do
if (class == kickbot_class[k]) then
skipflag = true;
end
end
--pk中不出现验证码
if(VaildChar(tbl_p[j]))then
local battleindexA = Char.GetBattleIndex(tbl_p[j]);
if(Battle.GetType(battleindexA) == %战斗_PVP%)then
skipflag = true;
end
end
if( skipflag == false)then
if(kickbot_codelist[tbl_p[j]]~=nil)then
if(os.time() - kickbot_timelist[tbl_p[j]] > kickbot_interval/3/1000 and kickbot_flaglist[tbl_p[j]] == 0)then
--NLG.TalkToCli(tbl_p[j],_index_me,"drop and " .. kickbot_flaglist[tbl_p[j]]);
NLG.DropPlayer(tbl_p[j]);
end
end
local code = math.ceil(math.random(0,9)) + math.ceil(math.random(0,9))*10 + math.ceil(math.random(0,9))*100 + math.ceil(math.random(0,9))*1000;
local message = "防挂机验证启动,请输入以下数字:"..code;
local message_2 = "[玩家公告]防挂机验证启动,请输入以下数字:"..code;
-- NLG.ShowWindowTalked( tbl_p[j], _index_me, %窗口_输入框%, %按钮_确定%,
-- KICKBOT_WINDOW_SEQUENCE_MAIN, message);
NLG.SystemMessage( tbl_p[j], message);
NLG.SystemMessage( tbl_p[j], message_2);
kickbot_codelist[tbl_p[j]] = code;
kickbot_flaglist[tbl_p[j]] = 0;
kickbot_timelist[tbl_p[j]] = os.time();
-- print("\ncode"..code.."\n");
end
end
end
end
for i = kickbot_dmaplist_l, kickbot_dmaplist_u do
local tbl_p = NLG.GetMapPlayer(1,kickbot_dmaplist_l + i - 1);
if(type(tbl_p) == "table")then
-- print("\nyes!table!\n"..table.getn(tbl_p).."\nbut"..NLG.GetMapPlayerNum(0,1000).."\n");
if(tbl_p == nil)then
print("table but nil!\n")
end
local j;
for j = 1, table.getn(tbl_p) do
local skipflag = false;
local class = Char.GetData(tbl_p[j], %对象_职业%);
local k;
for k = 1, table.getn(kickbot_class) do
if (class == kickbot_class[k]) then
skipflag = true;
end
end
--pk中不出现验证码
if(VaildChar(tbl_p[j]))then
local battleindexA = Char.GetBattleIndex(tbl_p[j]);
if(Battle.GetType(battleindexA) == %战斗_PVP%)then
skipflag = true;
end
end
if( skipflag == false)then
if(kickbot_codelist[tbl_p[j]]~=nil)then
if(os.time() - kickbot_timelist[tbl_p[j]] > kickbot_interval/3/1000 and kickbot_flaglist[tbl_p[j]] == 0)then
--NLG.TalkToCli(tbl_p[j],_index_me,"drop and " .. kickbot_flaglist[tbl_p[j]]);
NLG.DropPlayer(tbl_p[j]);
end
end
local code = math.ceil(math.random(0,9)) + math.ceil(math.random(0,9))*10 + math.ceil(math.random(0,9))*100 + math.ceil(math.random(0,9))*1000;
local message = "防挂机验证启动,请输入以下数字:"..code;
local message_2 = "[玩家公告]防挂机验证启动,请输入以下数字:"..code;
-- NLG.ShowWindowTalked( tbl_p[j], _index_me, %窗口_输入框%, %按钮_确定%,
-- KICKBOT_WINDOW_SEQUENCE_MAIN, message, math.random(0,9), %字体_大%);
NLG.SystemMessage( tbl_p[j], message);
NLG.SystemMessage( tbl_p[j], message_2);
kickbot_codelist[tbl_p[j]] = code;
kickbot_flaglist[tbl_p[j]] = 0;
kickbot_timelist[tbl_p[j]] = os.time();
-- print("\ncode"..code.."\n");
end
end
end
end
end
function kickbot_callback_talk(_index,_msg)
if(kickbot_flaglist[_index] == nil or kickbot_flaglist[_index] ~= 0 or kickbot_codelist[_index] == nil or kickbot_timelist[_index] == nil or kickbot_flaglist[_index] == -1)then
return;
end
if(kickbot_flaglist[_index] == 0)then
if( _msg == tostring(kickbot_codelist[_index]) )then
NLG.TalkToCli(_index,-1,"验证回答成功。", math.random(0,9), %字体_大%);
NLG.SystemMessage(_index,"[玩家公告]验证回答成功。");
kickbot_flaglist[_index] = 1;
else
if(os.time() - kickbot_timelist[_index] <= kickbot_interval/3/1000)then
--NLG.TalkToCli(_index,0,"not drop");
return;
else
NLG.DropPlayer(_index);
--NLG.TalkToCli(_index,0,"drop");
kickbot_flaglist[_index] = -1;
end
end
end
end
function kickbot_callback_window( _index_me, _index_tome, _sequence, _select, _data)
-- NLG.TalkToCli( _index_tome, _index_me, "kickbot_codelist[_index_tome]:"..kickbot_codelist[_index_tome].." data:".._data.." _select:".._select);
if( tostring(kickbot_codelist[_index_tome]) == _data)then
-- NLG.TalkToCli(_index_tome,_index_me,"okok");
kickbot_codelist[_index_tome] = nil;
else
-- NLG.TalkToCli(_index_tome,_index_me,"drop");
NLG.DropPlayer(_index_tome);
end
end