如果把验证码换成这个如何?纯净的mud
// judge.c#include <login.h>
#include <ansi.h>
inherit NPC;
string *output = ({
" B"+
" B"+
" B"+
" B"+
" B"+
" B"+
" B"+
" B"+
" B"+
" B",
"B"+
"B"+
"B"+
"B"+
"B"+
"B"+
"B"+
"B"+
"B"+
"B"
});
string *c_num= ({
" ;' B"+
" , ''';;'''' , B"+
",;';;';;';;';;'B"+
";' ,, ;; ,, ;' B"+
" ,;',';,, B"+
",,'',,,;;,,;';'B"+
" ;' B"+
" ',,;' B"+
" ';' B"+
" B",
" B"+
" B"+
" B"+
" B"+
" B"+
",,,,,,,,,,,;,B"+
" B"+
" B"+
" B"+
" B",
" B"+
" B"+
" B"+
",,,,,,,,,;,B"+
" B"+
" , B"+
"'''''''''''''''B"+
" B"+
" B"+
" B",
" , B"+
"'''''''''''B"+
" B"+
",,,,,,,,,;,B"+
" B"+
" , B"+
"'''''''''''''''B"+
" B"+
" B"+
" B",
", , B"+
";;'';;'';;'';;'B"+
";;;;;;;; B"+
";;;;;;;; B"+
";; ;; ;;,,;; B"+
";;,' ''';; B"+
";;'''''''''';; B"+
"' 'B"+
" B"+
" B",
" ,,,,,,,,,,,;, B"+
" ;; B"+
" ;; , B"+
" '''';;'';;' B"+
" ;;;; B"+
" ;; ;; B"+
" ;; ;;, B"+
"'''''''''''''''B"+
" B"+
" B",
" ',, B"+
" ';; B"+
",,,,,,,;,,,,,;,B"+
" ,, B"+
" ;;';, B"+
" ,;' ;, B"+
",;' ;;B"+
" ,' ;' B"+
" B"+
" B",
" , B"+
" ;; B"+
" ;; , B"+
" ,,;;,,'''''B"+
"'''';; B"+
" ;; , B"+
" ;;,,,,,;,B"+
" ''''''' B"+
" B"+
" B",
" , ;, B"+
" ;;;; B"+
" ;;;; B"+
" ;;;; B"+
" ,;' ;; B"+
",;' ';, B"+
" ,;' ';;, B"+
",' ';'B"+
" B"+
" B",
" ;, B"+
" ;; , B"+
" '''';;'';;' B"+
" ;;;; B"+
" ,;';; B"+
" ,;' ;; B"+
",;' ;;; B"+
",'' ';;;;'B"+
" B"+
" B",
" ;, B"+
" ;; B"+
" ;; B"+
"'''''';;'''''' B"+
" ;; B"+
" ;; B"+
" ;; B"+
" ;' B"+
" B"+
" B"
});
string *c_digit = ({
" ;' B"+
" , ''';;'''' , B"+
",;';;';;';;';;'B"+
";' ,, ;; ,, ;' B"+
" ,;',';,, B"+
",,'',,,;;,,;';'B"+
" ;' B"+
" ',,;' B"+
" ';' B"+
" B",
" ;, B"+
" ;; B"+
" ;; B"+
"'''''';;'''''' B"+
" ;; B"+
" ;; B"+
" ;; B"+
" ;' B"+
" B"+
" B",
",,,,,,,,,,,,,;,B"+
" ,;' B"+
" ;,;,,,,,;,B"+
" ;; ;; B"+
" ;;,,,,,;; B"+
" ;; ;; B"+
" ;; ;; B"+
" ;'''''';' B"+
" B"+
" B",
" ,;,B"+
" ,,,,;;''''' B"+
" ;; B"+
",,,,,,;;,,,,,;,B"+
" ;; B"+
" ;; B"+
" ;; B"+
" ;' B"+
" B"+
" B"
});
int in_ask, answer;
string my_number(int num);
string addcolor(string input);
void create()
{
set_name("审判官", ({ "judge" }) );
set("short", "专门对付机器人的" HIY "审判官"NOR "(judge)" );
set("long",
"这是一位审查玩家是否是机器人的审判官,你必须答对(answer)他三个问题才能\n"
"脱离他的掌握。\n");
set("gender", "男性");
set("age", 40);
set("str", 100);
set("int", 100);
set("cor", 100);
set("combat_exp", 9000000);
set("score", 0);
set_temp("apply/attack", 200);
set_temp("apply/damage", 500);
setup();
in_ask = 0;
}
void init()
{
::init();
if( !query_heart_beat(this_object()) ) set_heart_beat(1);
"/cmds/std/look"->look_room(this_player(),environment(this_object()));
if(!wizardp(this_player()))
add_action("do_nothing", "");
add_action("do_answer", "answer");
}
int do_nothing()
{
return 1;
}
void chat()
{
int a, b, c;
string oper;
if( in_ask || random(20) > 10 ) return;
delete_temp("wrong");
a = random(100000000);
b = random(100) + 1;
switch(random(1)) {
case 0:
answer = a;
// oper = chinese_number(a) + "加上" + chinese_number(b)+ "等於多少?";
oper = my_number(answer);
break;
case 1:
answer = a - b;
oper = chinese_number(a) + "减去" + chinese_number(b)+ "等於多少?";
break;
case 2:
if( a * b < 200 ) {
answer = a * b;
oper = chinese_number(a) + "乘上" + chinese_number(b)+ "等於多少?";
} else {
answer = (a * b) % 10;
oper = chinese_number(a) + "乘上" + chinese_number(b)+ ",个位数等於多少?";
}
break;
case 3:
answer = a % b;
oper = chinese_number(a) + "除以" + chinese_number(b)+ "馀於多少?";
break;
case 4:
oper = chinese_number(a) + "和" + chinese_number(b)+ "的最大公因数是多少?";
if( b < a ) { c = b; b = a; a = c; }
while( a > 1 && b%a > 1 ) {
c = a;
a = b%a;
b = c;
}
answer = b%a == 1 ? 1 : a;
break;
}
message_vision(oper,this_object());
command("say 以上中文数字是多少?请在二十秒内作答(answer)。");
in_ask = 1;
call_out("say_answer", 40);
}
void say_answer()
{
command("say 这麽简单都不会?答案等於:" + sprintf("%d",answer) + "。");
in_ask = 0;
}
int do_answer(string arg)
{
string s;
int ans;
if( !in_ask ) return notify_fail("你必须等下一题。\n");
if( !arg ) return notify_fail("请你回答一个数字。\n");
message_vision( CYN "$N答道:" + arg + "\n"NOR, this_player());
if( sscanf(arg, "%d", ans)==1 ) {
if( ans==answer ) {
this_player()->add_temp("robot_check", 1);
command("say 答对了!");
command("pat " + this_player()->query("id") );
in_ask = 1;
if( this_player()->query_temp("robot_check") >= 3 ) {
command("say 很好,你看起来不像机器人,你可以走了。\n");
if( stringp(s = this_player()->query_temp("old_startroom")) )
this_player()->set("startroom", s);
this_player()->delete_temp("robot_check");
if( stringp(s = this_player()->query_temp("last_location")) )
this_player()->move(s);
else
this_player()->move(START_ROOM);
}
} else {
command("say 错!");
add_temp("wrong/" + this_player()->query("id"), 1);
if( query_temp("wrong/" + this_player()->query("id")) > 3 ) {
command("say " + this_player()->name() + "你再给我乱猜啊,去死吧。\n");
this_player()->receive_damage("kee", 100, this_object());
this_player()->die();
}
}
}
return 1;
}
string my_number(int num)
{
string outstring;
int out;
int orinum;
string *out8,*out7,*out6,*out5,*out4,*out3,*out2,*out1;
orinum = num;
switch(random(10)) {
case 0: outstring = RED"\n"; break;
case 1: outstring = HIR"\n"; break;
case 2: outstring = GRN"\n"; break;
case 3: outstring = HIG"\n"; break;
case 4: outstring = YEL"\n"; break;
case 5: outstring = HIY"\n"; break;
case 6: outstring = BLU"\n"; break;
case 7: outstring = HIB"\n"; break;
case 8: outstring = HIM"\n"; break;
case 9: outstring = HIC"\n"; break;
}
if(num>99999999) num =99999999;
if(num >= 10000000)
{
out = num/10000000;
out8 = explode(c_num,"B");
num = num%10000000;
}
else
if(orinum > num)
out8 = explode(c_num,"B");
else
out8 = explode(output,"B");
if(num >= 1000000)
{
out = num/1000000;
out7 = explode(c_num,"B");
num = num%1000000;
}
else
if(orinum > num)
out7 = explode(c_num,"B");
else
out7 = explode(output,"B");
if(num >= 100000)
{
out = num/100000;
out6= explode(c_num,"B");
num = num%100000;
}
else
if(orinum > num)
out6 = explode(c_num,"B");
else
out6 = explode(output,"B");
if(num >= 10000)
{
out = num/10000;
out5 = explode(c_num,"B");
num = num%10000;
}
else
if(orinum > num)
out5 = explode(c_num,"B");
else
out5 = explode(output,"B");
if(num >= 1000)
{
out = num/1000;
out4 = explode(c_num,"B");
num = num%1000;
}
else
if(orinum > num)
out4 = explode(c_num,"B");
else
out4 = explode(output,"B");
if(num >= 100)
{
out = num/100;
out3 = explode(c_num,"B");
num = num%100;
}
else
if(orinum > num)
out3 = explode(c_num,"B");
else
out3 = explode(output,"B");
if(num >= 10)
{
out = num/10;
out2 = explode(c_num,"B");
num = num%10;
}
else
if(orinum > num)
out2 = explode(c_num,"B");
else
out2 = explode(output,"B");
out1 = explode(c_num,"B");
for(out=0;out<sizeof(out8);out++)
outstring += addcolor(out8)+""+addcolor(out7)+""+
addcolor(out6)+""+addcolor(out5)+"\n";
outstring += "\n";
for(out=0;out<sizeof(out4);out++)
outstring += addcolor(out4)+""+addcolor(out3)+""+
addcolor(out2)+""+addcolor(out1)+"\n";
return outstring+NOR;
}
string addcolor(string outstring)
{
switch(random(10)) {
case 0: outstring += RED; break;
case 1: outstring += HIR; break;
case 2: outstring += GRN; break;
case 3: outstring += HIG; break;
case 4: outstring += YEL; break;
case 5: outstring += HIY; break;
case 6: outstring += BLU; break;
case 7: outstring += HIB; break;
case 8: outstring += HIM; break;
case 9: outstring += HIC; break;
}
return outstring;
} 貌似是西游记里的?早被破了吧? 数学计算肯定不行 实在不行可以改成微积分,每次打开ie太麻烦了... 只要是机器可以算的东西,越复杂就越是考玩家而不是考机器人
话说回来,现在还有什么是服务器端算得出来而客户端算不出来的呢?除了图形验证码这种隐藏了具体生成参数的。如果图形验证码没有隐藏相关参数,那也早就被攻破了 可以用ddid提供的插件放在zmud或者mush里,就不用打开ie直接显示在zmud或mush里了
等把这两个打个包放主页上提供下载 原帖由 icer 于 2009-11-14 07:10 PM 发表 http://www.pkuxkx.net/forum/images/common/back.gif
可以用ddid提供的插件放在zmud或者mush里,就不用打开ie直接显示在zmud或mush里了
等把这两个打个包放主页上提供下载
55555 ddid的那个,对mush 4.18不支持。。。。
我代表汉化用户对此提出抗议 现在貌似图像识别技术也出现了........
大家群策群力,想想有没有更简洁更有效的方法
回复 1# 的帖子
看着怎么头晕呀FAINT ttk_13 ttk_13 ttk_13 哈哈,在现有的框架下,我写的那个版本是比较省事也比较快的了,如果非要4.18支持,用文件操作的方法也是可行的,之前“新手抄经口令”就是用的文件操作的方法,小刀可以参考。不过个人感觉,文件操作还是比较麻烦,关键是生成的图片文件在程序完成之后就没有用了。
但,其实,刚刚找到一种打破现有框架的方法,还在研究中……
哈哈哈~
[ 本帖最后由 ddid 于 2009-11-14 07:39 PM 编辑 ]
页:
[1]
2