mud_sanc 板


LINE

这篇应该会一直编到星期日。现况是对 javascript 的程式撰写算熟了, 对 asp 的部份原本忘光了,但最近在公司写了两支网页档边复习,有想 起六七成左右,mud coding .. 我忘光的部份是纯程式的部份,物件设定 、物件函数则大多还记得。 以下的东西不一定对,之後有发现错的话会修正。 mud javascript asp ---------------------------------------------------------------------------- mixed tmps=({}); var tmps=[]; dim xxx = Array(给初始大小) tmps+=({"xxx"}); tmps.push("xxx"); ? mapping tmps; var tmps={}; set tmps = Server.CreateObject └全域宣告的话需另外做 ("Scripting.Dictionary") 初始化 偷懒的话用 Session 暂存也可以 以js取得绝对路径档名 files=Server.MapPath(files) tmp=read_file(files); fso=New ActiveXObject set fso = Server.CreateObject write_file(files,tmp); ("Scripting.File ("Scripting.FileSystem SystemObject"); Object") fs=fso.OpenTextFile set fs = fso.OpenTextFile (files,1); (files,1) tmp=fs.ReadAll(); tmp = fs.ReadAll fs.close fs.close fs=fso.OpenTextFile set fs = fso.OpenTextFile (files,8); (files,8) fs.write(tmp); fs.write(tmp) tt=keys(tmps); tt=Object.keys(tmps); tt = tmps.Keys j=sizeof(tt); j=tt.length; j = tt.Count str=""; str=""; str = "" for(i=0;i<j;i++) for(i=0;i<j;i++) for i = 0 to j-1? if(i%2==1) if(i%2==1) if i mod 2 = 1 then str+=tmps[tt[i]]; str+=tmps[tt[i]]; str = str & tmps(tt(i)) end if next write(str); document.write(str); response.write str tmps=explode(str,"\n"); tmps=str.split("\n"); tmps = split(str,vbcrlf) str=implode(tmps,"\n"); str=tmps.join("\n"); str = join(tmps,vbcrlf) replace_string(str, str.replace(/a/g,"b"); str = replace(str,"a","b") "a","b"); substr 也可以 if(strsrch(str,"xxx")) if(str.indexOf("xxx")) if InStr(str,"xxx") > 0 then { { return ; return ; response.end } } end if void xxx() function xxx() sub xxx function xxx {} {} end sub end function 忘记怎麽传值了 ss=str[1..3]; ss=str.substr(1,2); ss = mid(str,1,2) 大概,每次都记不住 s=strlen(str); s=str.length; s = len(ss) s=atoi(str); s=parseInt(str); s = CInt(str) str=identify(x); str=JSON.stringify(x); ? sscanf(str,"%s %s", str.scanf(str,"%s %s", ? 忘了是否有这东西 s1,s2); s1,s2); ??嗯,不确定 我都偷懒用 split xxx=sort_array(xxx, xxx.sort(function(a,b) 我好像都偷懒用气泡排序法 (: sort_xxx :)); { ... }); 或是用阵列先把键值的顺序定好 mapping x=([ "1":"xx", "2":"xx", ]); mixed x=({"1","2"}); inherit ROOM; void create() { ::create(); seteuid(getuid(this_object())); set("light",1); set("short","一间房间"); set("long",@LONG 这是一间房间,贴着一张告示(note)。 LONG ); set("exits",([ "north":__DIR__"002", "south":__DIR__"003", ])); set("exits/east",__DIR__"004"); set("item_desc/note",@LONG 这是一张A4大小的告示。 LONG ); set("objects",([SM"dove":3,])); set_npcs(({"... 呃忘记怎麽设定了..})); reset(); } void init() { add_action("drink_xxx","drink"); add_action("jump_xxx","jump"); } int drink_xxx(string str) { if(!str || str=="") return notify_fail("你要喝什麽?\n"); if(str!="water") return notify_fail("drink: 这里没有 "+str+" 这个东西可以喝喔!\n"); return notify_fail("drink: 你喝了一口水,感觉舒服多了。\n"); } int jump_xxx(string str) { object ppl=this_player(); write(HIW"你纵身一跃,跳到了另一个房间!\n"NOR); ppl->move_player(__DIR__"005","SNEAK"); tell_room(environment(ppl),ppl->query("short")+"突然出现在这个地方!!\n"); return 1; } mixed usr=users(); foreach(ppl in usr) if(ppl && interactive(ppl)) tell_object(ppl,"再一分钟就要关机了,请赶快 quit!\n"); tmps=keys((mapping)ppl->query("skill")); str=""; foreach(sk in tmps) str+=sprintf("%-36s : %-d\n",skill_name(sk)+"("+capitalize(sk)+")", ppl->query("skill/"+sk)); ^^^^^^^^^^这里忘了 lower_case 倒是还记得 r=random(100); switch(r) { case 1: ...; break; case 2: case 3: ,,,; break; default: ...; break; } if(a && b && c) if(a || b || c) if((a && b) || (c && d)) while(i++<50) { } for(i=0;i<100;i++) { if(xxx) continue; else if(ooo) break; } simul_efun 跟 efun 有些也忘光了都要回想一下 simul_efun 的部份 string files,str,tmp; int a,b,x,i,j; mixed tmps=({}),objs; object me,ppl,obj; files=file_name(this_object()); files=base_name(this_object()); me=this_player(); if(!wizardp(me)) return notify_fail("你不是巫师喔!\n"); varargs mixed questing(string kind,string names,string quest_num,mixed vars) tell_object(me,"test.\n"); tell_room(environment(me),"test",({me})); write("test.\n"); say("test.\n"); shout("test.\n"); show(me,ppl,"$N对$O击出一记肘击!"); int save_room() { save_object(base_name(this_object())); return 1; } int restore_room() { restore_object(base_name(this_object())+".o"); return 1; } if(sscanf(str,"%s %s",s1,s2)==2) { ... } tmps=sort_array(tmps,(: sort_tmps :)); int sort_tmps(string s1,string s2) { int a1=atoi(s1),a2=atoi(s2); return strcmp(s1,s2); a1>a2 ? return 1 : a1<a2 ? return -1 : return 0; } int t=time(); string times=ctime(t); ppl->shut("$N对$O使出一记肘击",5000,1000,"dam",tar); ppl->shut2("$N对$O使出一记肘击",5000,1000,"dam",tar); 常用的 efun,虚拟物品系统,家族系统,天空城农场系统, 大乐透系统,投票系统,... 这些忘光了,但这些系统大部份 的主程式不需要再动,只需要动设定值,或是动脚本即可。 到星期六早上为止,自觉大概想起六成左右。 --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.33.66.104 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/mud_sanc/M.1608905926.A.EB1.html
1F:→ laechan : 看起来不用到星期日应该星期六就可以想起怎麽coding 12/25 22:26
※ 编辑: laechan (114.33.66.104 台湾), 12/26/2020 09:14:52
2F:→ laechan : 再复习一次 12/29 08:56
3F:→ ablegod : 小宝 佩服你坚持了20年 12/31 00:23
4F:推 iluy : 01/07 21:35







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:BabyMother站内搜寻

TOP