Robot-機器人分享區

teach省事法

  • 發表者:doall
  • 前言:相信各位在teach的時候都按到很心酸!在此分享一個簡單的方法!
  • 說明:每格2.5秒會發出「teach (somebody) (skill name)」 指令,執行30次。結束後顯示Finish teaching字樣。
  • 內容:
#30 {teach (somebody) (skill name) ; #wait 2500};#show Finish teaching

八卦自動行走觸發

  • 撰寫者:doall
  • 適用zMUD 7.21
  • 觸發句:
        明顯出口有: (&exit).
  • 觸發撰寫內容:
#var temp 1
#wait 800
#var temp %random( %numwords( @exit))
#if (@temp = 0) {#var temp 1}
 #until ((%word( @exit, @temp) != "和") & (%word( @exit, @temp) != "out") & (@temp != 0)) {
  #var temp %random( %numwords( @exit))
  }
 %word( @exit, @temp)

  • 撰寫者:chanmew
  • //跟後邊的是注解,不是命令的一部份
        明顯出口有: (&exitlist).
#VAR exit {}
// 先把變數exit清空
#LOOP 10 {
//不知道是不是locale的問題,一用#UNTIL我就會當機加無限發指令....
        #IF (%word(@exitlist,%i)!="和") {
// 檢查@exitlist的前十個字,和字不列入出口
                #VAR temp {%word(@exitlist,%i)}
//把第n個字設為temp
                #IF %ends(@temp,",") {#VAR templen {%len(@temp)}
                        #ADD templen -1
                        #ADDI exit {%left(@temp,@templen)}} {#ADDI exit {@temp}}
//檢查是不是用,當結束,是就把字後邊的,砍掉,把字加入exit
                #DELI exit {}
//正常exit是不到十個字的,所以把多出來不存在的字砍了
}}
#IF (%numitems(@exit)>1) {
//如果只有一個出口,就走回頭路吧
#IF (@go="north") {#DELI exit {south}}
//把回頭路清除
#IF (@go="south") {#DELI exit {north}}
#IF (@go="east") {#DELI exit {west}}
#IF (@go="west") {#DELI exit {east}}
#IF (@go="out") {#DELI exit {enter}}
#IF (@go="enter") {#DELI exit {out}}
#IF (@go="northwest") {#DELI exit {southeast}}
#IF (@go="northeast") {#DELI exit {southwest}}
#IF (@go="southwest") {#DELI exit {northeast}}
#IF (@go="southeast") {#DELI exit {northwest}}
#IF (@go="up") {#DELI exit {down}}
#IF (@go="down") {#DELI exit {up}}
#IF (@go="northup") {#DELI exit {southdown}}
#IF (@go="southup") {#DELI exit {northdown}}
#IF (@go="eastup") {#DELI exit {westdown}}
#IF (@go="westup") {#DELI exit {eastdown}}
#IF (@go="northdown") {#DELI exit {southup}}
#IF (@go="southdown") {#DELI exit {northup}}
#IF (@go="eastdown") {#DELI exit {westup}}
#IF (@go="westdown") {#DELI exit {eastup}}
#VAR go {%item(@exit,%random(1,%numitems(@exit)))}
} {#VAR go {@exit}}
//把go設成隨機一個出口
#IF (@dorandommove!=1) {#AB 1}
//檢查要不要掛機,簡單來說就是掛機時設#VAR dorandommove 1
#IF @combat=1 {#VAR nocombat 0;#AB 1}
//檢查是不是戰鬥中,請配合你的robot設定
#WA 200;@go
// 行一步.....
#ADD nocombat {1}
#IF @nocombat>50 {#VAR dorandommove 0;/;n;work}
// 記錄有多少步沒遇到敵人,如果大於50步就回recall n掛work

開始自動走的#ALIAS
#ALIAS randommove {#VAR dorandommove 1;#VAR go enter;#VAR combat 0;p;#1 @go}

只要打randommove就會enter然後向前走……
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License