Home Search  Register
* * * * *
It is currently 24 Dec 2009, 19:27

All times are UTC + 7 hours



Welcome
Welcome to findfriend.freeforums.org | เว็บศูนย์รวมของเถื่อน.

คุณคือผู้ที่กำลังดูบอร์ดที่ยังไม่ได้ลงทะเบียนกับบอร์ดของเราในตอนนี้, ซึ่งให้การเข้าถึงที่จำกัดกับคุณ และเข้าถึงความสามารถอื่นๆของเราจะไม่เต็มที่. โดยการเข้าร่วมสมัครสมาชิกกับชุมชนที่ฟรีของเรา, คุณจะมีสิทธิการเข้าถึงสู่การโพสต์หัวข้อกระทู้ต่างๆ, ติดต่อกับสมาชิกอื่นๆโดยใช้กล่องข้อความส่วนตัว (PM), โต้ตอบเพื่อการสำรวจความนิยม, ส่งสิ่งที่บรรจุ, และเข้าถึงความสามารถพิเศษอื่นๆอีกมากมาย. การลงทะเบียนเร็วง่ายดาย, และอย่างสมบูรณ์แบบ ฟรี!, ฉะนั้นหากต้องการสิทธิการใช้งานที่มากกว่านี้กรุณาสมัครสมาชกกับเราก่อนนะครับผม คลิกเพื่อสมัครสมาชิก!


Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: sample to advances input command line
PostPosted: 30 Oct 2009, 16:19 
Offline
ผู้ดูแลระบบ
User avatar

Joined: 07 Aug 2007, 10:50
Posts: 646
Location: in front of the future.
Highscores: 9
Code:
;input custom command line
alias -l _pref {
  if $1 == @ return op,o
  if $1 == % return halfop,h
  if $1 == + return voice,v
}
alias -l _chan return $remove(#,$chr(35))
on *:INPUT:*:{
  if ($left($1,1) != /) {
    if ($istok(mode.m.โหมด.ตั้งโหมด,$1,46) && $2) {
      if ($active ischan) {
        if ($me isop # || $me ishop #) {
          if (f !isin $2 && $2 != list) { mode # $2 $iif((l isin $2 || k isin $2) && ($3 isnum),$3) }
          elseif ($2 == list) .say Mode sets of $remove(#,$chr(35)) channel $+($iif($len($chan(#).mode > 1),are,is),:) $chan(#).mode
          else mode # $2 $3
          halt
        }
        else echo $_rc -a ** You are not # operator!
      }
      else echo $_rc -a ** Cannot use this command line in this window. It's only used in channel window.
    }
    if ($istok(join.j.go.ไป.เข้า.เข้าห้อง.ไปห้อง.จรลี,$1,46) && $2) { me -> J๏!ning to -> $+([,$2,]) | join $+($chr(35),$remove($2,$chr(35))) | halt }
    if ($istok(part.p.ออก.ออกห้อง.หนีจาก,$1,46)) {
      if (!$2) { me $logo(Parting frOm : $remove(#,$chr(35))) | part # bye | halt }
      elseif ($istok(all.หมด,$2,46)) {
        if (!$3) { var %c = 1, %t = $chan(0) | while (%c <= %t) { .describe $chan(%c) Parting frOm : $remove($chan(%c),$chr(35)) | part $chan(%c) bye | inc %c } }
        else {
          if ($3 == -e) { var %c = 1, %t = $chan(0) | while (%c <= %t) { var %chan = $chan(%c) | if ($active ischan && $active != %chan) { .describe %chan Parting frOm : $remove($chan(%c),$chr(35)) | .part %chan bye } | inc %c } }
          else echo -a Invalid $+(,$3,) command line it's must be: -e only.
        }
      }
      else { var %chan = $iif($chr(35) !isin $left($2,1),$+($chr(35),$2),$2) | if ($me ison %chan) { .describe %chan Parting frOm : $remove(%chan,$chr(35)) | .part %chan } | else echo -a You are not on %chan }
      halt
    }
    if ($istok(close.exit.xbf.ปิด,$1,46)) {
      if (!$2-) { .ame Close script | .timer 1 1 exit -n | halt }
      else {
        if ($query(0) == 0) { ame Closing Script ( $+(,$2-,) )) | .timer 1 1 exit -n | halt }
        else { qme Closing Script ( $+(,$2-,) ) | ame Closing Script ( $+(,$2-,) ) | .timer 1 1 exit -n }
      }
      halt
    }
    if ($istok(up.ขึ้น,$1,46) && $2) { if ($istok(@.%.+,$2,46)) { if ($me isreg $chan || $me isvoice $chan) { cs $gettok($_pref($2),1,44) # $me } | else cs op # $me } | else halt }
    if ($istok(down.ลง,$1,46) && $2) { if ($istok(@.%.+,$2,46)) { if ($me isop $chan || $me ishop $chan) { mode # $+(-,$gettok($_pref($2),2,44)) $me } | elseif ($me isvoice $chan) cs devoice # $me } | else halt }
    if ($istok(n.nick.ชื่อ.แปลงร่างเป็น,$1,46) && $2) { me ChAnge -> $me -> $+([,$2,]) | nick $2 | halt }
    if ($istok(c.clear.ล้าง.ลบ,$1,46)) {
      if (!$2) {
        if ($active ischan) { me Clearing window $remove(#,$chr(35)) | clear # }
        elseif ($window($active).type == query) { me Clearing query window | clear }
        else clear
      }
      elseif ($istok(all.ทั้งหมด.หมด,$2,46)) { ame Clean all channel window | clearall -n }
      else { var %chan = $iif($chr(35) !isin $left($2,1),$+($chr(35),$2),$2) | if ($me ison %chan) { .describe %chan Clearing window $remove($2,$chr(35)) | clear %chan } | else echo -a You are not on %chan }
      halt
    }
    if ($istok(w.whois.scan.แอบดู.หา,$1,46) && $2) { me sCan!ng.. $+([,$2,]) | whois $2 }
    if ($istok(ban.+b.แบน,$1,46) && $2) {
      if ($active ischan) {
        if ($me isop # || $me ishop #) {
          if ($2 != -l && $2 != -r) {
            var %i = 1, %ii = $ibl(#,0)
            if ($ibl(#,0) != 0) { goto begin } | else { .raw MODE # +b $2 | .say $logo(Added $2 into $_chan banlist) | halt }
            :begin | while (%i <= %ii) { var %iii = $ibl(#,%i), %i4 = $remove($gettok(%iii,1,42),!) | if ($2 != %i4) { .raw MODE # +b $2 } | else { halt } | inc %i } | halt
          }
          elseif ($2 == -r) {
            if ($ibl(#,0) != 0) {
              if ($3) {
                if ($chr(44) isin $3) { var %i = 1, %i2 = $3, %todel | while (%i <= $numtok(%i2,44)) { %todel = %todel $ibl(#,$gettok(%i2,%i,44)) | inc %i } | mode # - $+ $str(b,$numtok(%todel,32)) %todel }
                else {
                  if ($3 isnum) {
                    if ($3 <= $ibl(#,0)) { mode # -b $ibl(#,$3) }
                    else echo 4 -a ** Ban ID: $3 is over a $_chan banlist. The ban ID number must between $iif($ibl(#,0) == 1,1,$+(1-,$ibl(#,0),))
                  }
                  else echo 4 -a ** $+(,$3,) must be use a number format only and number is id. example: ban -r 1. See ban -l command to list ban id
                }
              }
              else echo 4 -a ** You must specify $1 $2 <Ban ID> example: $1 $2 1 to see a banlist ID use ban -l command.
            }
            else echo 4 -a Ban id $3 was not found
          }
          elseif ($2 == -l) {
            var %i = 1, %ii = $ibl(#,0)
            if ($ibl(#,0) != 0) {
              while (%i <= %ii) {
                if ($gettok($ibl(#,%i).by,1,33)) {
                  echo 2 -a Ban id5 %i =4 $ibl(#,%i) 13(12แบนโดย3 $remove($ifmatch,$chr(9),$chr(40),$chr(41)) 12เมื่อ $replace($gettok($duration($calc($ctime - $ibl(#,%i).ctime)),1-,32),wks,สัปดาห์,wk,สัปดาห์,hrs,ชั่วโมง,hr,ชั่วโมง,mins,นาที,min,นาที,secs,วินาที,sec,วินาที) 12ที่แล้ว13)
                }
                inc %i
              }
              .say $_chan banlist $iif($ibl(#,0) > 1,are,is) $ibl(#,0) $iif($ibl(#,0) > 1,masks,mask)
            }
            else .say No banmask found in $_chan
          }
        }
        else echo 4 -a ** You are not $_chan operator. You can not use this command line.
      }
    }
    if ($istok(k.kick.เตะ.ซัด,$1,46) && $2) {
      if ($me isop # || $me ishop #) {
        if ($2 ison #) { .raw -q KICK # $2 Kickz $iif($3-,$3-,Get out!!) } | else echo -a $+([,$2,]) is not on #
      }
      else echo -a You are not # operator
    }
    if ($istok(kb.kickban.เตะแบน.ซัดดัม,$1,46) && $2) {
      if ($me isop # || $me ishop #) {
        if ($2 == -s) {
          if ($3) && ($4 && $4 isnum 1-9) && ($5 && $5 isnum) { if ($3 ison #) { .ban -u $+ $5 # $address($3,$4) | .raw -q kick # $3 Kickz $iif($6-,$6-,Get out!!) } | else echo 12 $3 is not on # }
          else echo 12 Use this syntax:4 $1 -s <Nick> <Ban level (1-9)> <Ban time (in second)> [Reason to kick] 12eg.3 $1 -s nick 1 60 ไปไกลๆ ชิ่วๆ (หากไม่ใส่เหตุผลจะใส่คำว่า Get out!! แทน)
        }
        else { if ($2 ison #) { .raw MODE # +b $2 $+ !*@* | .raw -q KICK # $2 Kickz $iif($3-,$3-,Get out!!) } | else echo 4 $2 12is not on4 # }
      }
      else echo -a You are not # operator. You can not kicked $2
      halt
    }
    if ($istok(root.รูด,$1,46) && $2) {
      if ($istok(@.%.+,$2,46)) {
        if ($3 && $4) && ($3 ison #) && ($4 isnum 1-30) {
          var %i = 1, %ii = $4, %r
          if ($4 >= 20) { var %warn = $input(หากคุณใส่ค่าเกิน 20 คุณอาจจะฟลัดเองได้ คุณต้องการทำต่อใช่หรือไม่?,ayw,Warning!) | if (%warn == $true) { goto root } | else halt } | else { goto root }
          :root
          while (%i <= %ii) {
            %r = $gettok($_pref($2),2,44)
            if (%r == o) { var %rr = $str($+(+,%r,-,%r),6) | .raw MODE # %rr $str($+($3,$chr(32)),$count(%rr,o)) }
            if (%r == h) { var %rr = $str($+(+,%r,-,%r),6) | .raw MODE # %rr $str($+($3,$chr(32)),$count(%rr,h)) }
            if (%r == v) { var %rr = $str($+(+,%r,-,%r),6) | .raw MODE # %rr $str($+($3,$chr(32)),$count(%rr,v)) }
            inc %i
          }
        }
        else echo 4 -a Usage: $1 $2 <Nick> <number 1-30>
      }
    }
    if ($istok(invite.inv.ดึง.ลาก.ฉุด,$1,46) && $2) { .raw -q INVITE $2 # | .say $1 $+([,$2,]) | halt }
    if ($istok(block.blk.ign.ig.ignore.เพิกเฉย.บล็อค,$1,46)) {
      if (- !isin $2) { ignore $2 $network | .say Added $+([,$2,]) in to Blocked list | halt }
      else {
        if ($left($2,1) == -) {
          if (p isin $2 || c isin $2 || n isin $2 || t isin $2 || d isin $2 || i isin $2 || k isin $2) && ($3) {
            if (!$ignore($+($3,!*@*))) { .ignore $2 $3 $network | .say Added $+([,$3,]) in to Blocked list | halt }
            else { .ignore $2 $3 $network | .say Updated $+([,$3,]) block type in Blocked list | halt }
          }
          if ($2 == -r) && ($3) { var %ignore = $iif($chr(42) !isin $3,$+($3,!*@*),$3) | if (%ignore == $ignore(%ignore)) { .ignore -r %ignore | .say Removed $+([,$3,]) from Blocked list } | else { .say $+([,$3,]) is not in Blocked list } }
        }
        else if ($2 == -l) {
          var %i = 1, %ii = $ignore(0)
          while (%i <= %ii) {
            var %ignore = $ignore(%i), %type = $replace($ignore(%i).type,private,บล็อคข้อความในซิบ,channel,บล็อคข้อความหน้าห้องแชท,notice,บล็อคข้อความจากโนทิส,ctcp,บล็อคการส่ง CTCP,dcc,บล็อคการขอส่งไฟล์หรือข้อมูล,invite,บล็อคจากการเชิญเข้าห้อง,codes,บล็อคจากข้อความสีสัน)
            echo 4 -a Ignore ID: $+(%i,.03) $ignore(%i) 13รูปแบบ12 %type
            inc %i
          }
        }
        else {
          echo 5 -a Invalid command line $+(,$2,,$chr(44)) please used: ignore <-[p|c|n|t|d|i|k]/r/l> <Nick/mask>
          echo 5 -a When -p = privatemsg, c = channelmsg, n = notice, t = CTCP, d = DCC, i = invite, k = control code, r = remove ignore, l = list total ignore
          echo 5 -a Example: ignore -p dog for add dog into ignore lis, or ignore -r dog for removed dog from ignore list, or ignore -l for list ignorelist.
        }
      }
    }
    ; เพิ่มเติมคำสั่งต่อตรงนี้เลย : Add command line above here.
    ;Example: if ($1 == ...) { say จุดจุดจุด | halt }
  }
}



*** หมายเหตุ : การใส่คำสั่งให้ถูกต้องตามรูปแบบนั้น ควรทำตามนี้ if (คำในบรรทัดที่เราพิมพ์ == คำที่เราพิมพ์){ ... คำสั่งที่จะสั่งให้โปรแกรมสคริปทำงาน ... (สามารถแยกคำสั่งในส่วนสเตจเม้นท์นี้โดยใช้เครื่องหมาย | ) เช่น say hello | me hello | halt เป็นต้น }
และตัวดำเนินการ ในวงเล็บคำสั่งนั้น ไม่ควรใส่เครื่องหมาย = ตัวเดียว ให้ใส่ 2 ตัว ==

เช่น if ($1 == hi) { say สวัสดีค๊าบทุกคน | halt } เป็นต้น

มีอะไรที่ไม่เข้าใจ ส่วนไหน หรือจะเสนอแนะ ก็เชิญได้เลยนะครับผม ยินดีรับฝัง ครับ อิอิ


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 7 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: