幫忙簡單修改腳本
這個是在腳本區找到的圖片驗證腳本,目前登入後可以順利執行我想把設定成殺怪低機率觸發
- script 驗證 -1,{
OnPCLoginEvent:
query_sql "select count(*) from `pic`",.@count;
query_sql "select * from `pic` limit "+rand(.@count)+", 1",.@id,.@red$,.@blue$,.@yellow$,.@green$,.@name$;
setarray .@color$,"^ff0000■^000000","^0000ff■^000000","^b8860b■^000000","^008000■^000000";
setarray .@result$,.@red$,.@blue$,.@yellow$,.@green$;
set .@id,rand(4);
atcommand "@option 2 0 2";
mes "請輸入 [ "+.@color$[.@id]+" ] 驗證碼 ^ff0000(均為大寫字母)^000000";
mes "^006600驗證碼位於游戲窗口的右下方^000000";
cutin .@name$,2;
next;
input .@yz$;
cutin .@name$,255;
if (.@yz$ == .@result$[.@id]){
mes "驗證通過";
atcommand "@option 0 0 0";
close2;
end;
}
mes "驗證失敗";
atcommand "@kick "+strcharinfo(0);
end;
} 本帖最後由 1588 於 2015-1-25 11:39 PM 編輯
- script 驗證 -1,{
OnNPCKillEvent:
set Kill_Mob,Kill_Mob+1;
if(Kill_Mob>=$Mob_Need && rand(100) < $Random){
query_sql "select count(*) from `pic`",.@count;
query_sql "select * from `pic` limit "+rand(.@count)+", 1",.@id,.@red$,.@blue$,.@yellow$,.@green$,.@name$;
setarray .@color$,"^ff0000■^000000","^0000ff■^000000","^b8860b■^000000","^008000■^000000";
setarray .@result$,.@red$,.@blue$,.@yellow$,.@green$;
set .@id,rand(4);
atcommand "@option 2 0 2";
mes "請輸入 [ "+.@color$[.@id]+" ] 驗證碼 ^ff0000(均為大寫字母)^000000";
mes "^006600驗證碼位於游戲窗口的右下方^000000";
cutin .@name$,2;
next;
input .@yz$;
cutin .@name$,255;
if (.@yz$ == .@result$[.@id]){
mes "驗證通過";
atcommand "@option 0 0 0";
set Kill_Mob,0;
close2;
end;
}
mes "驗證失敗";
atcommand "@kick "+strcharinfo(0);
}
end;
OnInit:
set $Mob_Need,99; //設定級殺幾隻怪物後需要驗證
set $Random,50; //設定機率
end;
} 本帖最後由 pig671080 於 2015-1-25 11:45 PM 編輯
1588 發表於 2015-1-25 09:37 PM static/image/common/back.gif
測試看看吧
可以了,謝謝1588大大!
頁:
[1]