Public feed #603147

JtRacer

public text v1 · immutable
Raw Edit
·published 2007-07-04 15:47 UTC
rendered paste body
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                                                    ;;;
;;; DmScript tool by J.T, for use in #DmScript only.   ;;;
;;;                                                    ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

menu * {
  DmScript Tool:/dialog -m DScript DScript
}

dialog -l DScript {
  title "DmScript Tool by J.T"
  size -1 -1 250 175
  option dbu
  tab "Game", 1, -1 2 252 173
  list 15, 8 72 235 54, tab 1 size hsbar vsbar
  box "Recent Messages", 16, 5 64 241 65, tab 1
  button "DarkBow", 17, 117 142 34 10, tab 1
  button "GAxe", 18, 9 156 34 10, tab 1
  button "Flick", 19, 9 142 34 10, tab 1
  button "Dds", 20, 81 142 34 10, tab 1
  button "Lash", 21, 45 142 34 10, tab 1
  button "Barrage", 22, 153 142 34 10, tab 1
  button "Guthans", 23, 45 156 34 10, tab 1
  button "Xbow", 24, 81 156 34 10, tab 1
  button "Eat", 25, 117 156 34 10, tab 1
  button "Pass", 26, 153 156 34 10, tab 1
  box "Commands", 27, 6 130 184 40, tab 1
  button "Play!", 29, 195 142 24 12, tab 1
  box "Start/Stop", 30, 192 134 54 23, tab 1
  box "Player 1", 34, 9 19 90 44, tab 1
  box "Player 2", 35, 102 19 90 44, tab 1
  text "", 36, 13 28 44 8, tab 1
  text "", 37, 106 28 44 8, tab 1
  text "", 38, 74 32 15 21, tab 1
  text "", 40, 13 40 36 8, tab 1
  box "My Status", 45, 195 19 49 44, tab 1
  text "Sharks:", 46, 200 38 21 8, tab 1
  text "Specs:", 44, 200 28 21 8, tab 1
  text "", 42, 224 28 18 8, tab 1
  text "", 43, 224 38 18 8, tab 1
  text "", 39, 168 32 15 21, tab 1
  text "", 41, 106 40 36 8, tab 1
  button "Stop", 47, 219 142 24 12, tab 1
  tab "Other Controls", 2
  box "Login", 3, 5 22 85 50, tab 2
  text "Username:", 4, 9 32 31 8, tab 2
  text "Password:", 5, 9 42 28 8, tab 2
  edit "", 6, 39 32 48 10, result tab 2
  edit "", 7, 39 42 48 10, result tab 2 pass
  check "Save login info", 8, 9 56 50 10, tab 2
  edit "DmScript Tool v1.1 by J.T. Bugs? Memo JtRacer! :)", 9, 98 32 144 10, tab 2 read
  button "Log in", 10, 5 76 37 12, tab 2
  button "Log out", 11, 53 76 37 12, tab 2
  button "Get Stats!", 14, 204 96 37 10, tab 2
  list 12, 98 58 144 22, tab 2 size
  box "Current Bot", 31, 5 93 85 37, tab 2
  edit "", 32, 10 103 74 10, tab 2
  button "Save Botname", 33, 25 115 42 10, tab 2
  box "Info", 48, 94 22 154 26, tab 2
  box "Stats", 13, 94 49 154 81, tab 2
  combo 49, 142 84 46 36, tab 2 size drop
  text "Get Stats for the", 50, 98 84 43 8, tab 2
  edit "", 51, 190 84 52 10, tab 2
  button "Close Dialog", 28, 192 159 54 10, ok cancel
}

on *:text:*:#DmScript:{
  if ($nick != %dmbot) || (!$dialog(DScript)) { halt }
  tokenize 32 $regsubex($strip($4-),/\((SA|A|M|T5)\)/,$null)
  if (*initiated a deathmatch* iswm $1-) && ($regex($1-,/(\((Stats|Not).*\)) has/gi)) {
    set %dm.p1 $1
    did -o DScript 36 1 $1
    tokenize 32 DeathMatch initiated by $1 $+ , $regml(1)
  }
  if (*DM has been stopped* iswm $1-) {
    did -r DScript 36-43
    tokenize 32 The current DeathMatch has been stopped.
  }
  if (*has won* iswm $1-) {
    did -r DScript 36-43
    unset %dm.p1
    unset %dm.p2
  }
  if (*has accepted* iswm $1-) && ($regex($1-,/(\((Stats|Not).*\)) has/gi)) {
    did -o DScript 37 1 $1
    did -o DScript 40-41 1 99 Hp
    tokenize 32 DeathMatch accepted by $1 $+ , $regml(1)
    set %dm.p2 $1
    if $istok($me,$remove($1-,'s),32) {
      did -o DScript 42 1 100%
      did -o DScript 43 1 10
    }
  }
  if (*hp*left* iswm $1-) {
    did -o DScript $iif($1 == %dm.p1,40,41) 1 $remove($gettok($1-,-3,32),[,])
  }
  if ($1 == %dm.p1) {
    did -o DScript 39 1 On Turn
    did -r DScript 38
  }
  if ($1 == %dm.p2) {
    did -o DScript 38 1 On Turn
    did -r DScript 39
  }
  if (*first*attack* iswm $1-) { did -o DScript $iif($remove($gettok($1-,-1,32),.) == %dm.p1,38,39) 1 On Turn }
  did -i DScript 15 1 $1-
}

on ^*:notice:*:*: {
  tokenize 32 $strip($1-)
  if ($nick == %dmbot) && ($dialog(DScript)) {
    if (*You*have*spec* iswm $1-) {
      did -o DScript 42 1 $3
      haltdef
    }
    if (*You*have*shark* iswm $1-) {
      did -o DScript 43 1 $3
      haltdef
    }
    if (*Win*Stats*for*Exp* iswm $1-) && ($7 == $me $+ :) {
      tokenize 32 $8-
      did -i DScript 12 1 $gettok($1-,9-,32) 
      did -i DScript 12 1 $gettok($1-,1-8,32)
      did -i DScript 12 1 $me $+ :
      haltdef
    }
    if ($1 === GetStats) {
      if ($2 == Err) { did -o DScript 9 1 Error: $3- | haltdef }
      if ($2 === Get1) {
        did -i DScript 12 1 Stats for $3
        did -i DScript 12 2 Wins: $5 Loses: $6
        did -i DScript 12 3 Exp: $4 - Level: $7
        did -o DScript 9 1 Stats retrieved successfully!
        haltdef
      }
      if ($2 === Get2) {
        did -i DScript 12 1 Stats for $3 (Logged in as $4 $+ )
        did -i DScript 12 2 Wins: $6 Loses: $7
        did -i DScript 12 3 Exp: $5 - Level: $8
        did -o DScript 9 1 Stats retrieved successfully!
        haltdef
      }
      if ($2 === Get3) {
        tokenize 32 $replace($1-,nocolor,N/A,noprefix,N/A)
        did -i DScript 12 1 Team Stats for $3 - Leader: $7
        did -i DScript 12 2 Guild Points: $4 - Team Color: $5 - Team Prefix: $6
        did -i DScript 12 3 Members: $iif($8,$replace($8-,$chr(32),$+($chr(44),$chr(32))),N/A)
        did -o DScript 9 1 Stats retrieved successfully!
        haltdef
      }
    }
  }
}

on *:dialog:DScript:init:0: {
  if ($active != #DmScript) { echo -at Dialog can only be opened on #DmScript. | dialog -c DScript | halt }
  if (!%dmbot) { set %dmbot $$?="Please enter the current DeathMatch bot in use." }
  if (%dm.us) { did -o DScript 6 1 $v1 }
  if (%dm.pw) { did -o DScript 7 1 $v1 }
  if (%dm.us) did -c DScript 8
  did -o DScript 32 1 %dmbot
  didtok DScript 49 44 DmScript User,IRC Nickname,Team
  did -c DScript 49 $iif(%dm.us,1,2)
  did -o DScript 51 1 $iif(%dm.us,$v1,$me)
}
on *:dialog:DScript:close:0: {
  unset %dm.p1
  unset %dm.p2
}
on *:dialog:DScript:sclick:8: {
  if ($did(DScript,8).state == 1) {
    if !$did(DScript,6) || !$did(DScript,7) {
      did -o DScript 9 1 Please input a $iif($did(DScript,6),Password,Username)
      halt
    }
    set %dm.us $did(DScript,6)
    set %dm.pw $did(DScript,7)
  }
  else { unset %dm.us %dm.pw }
}
on *:dialog:DScript:sclick:8: { msg #DmScript !Wins }
on *:dialog:DScript:sclick:47: { msg #DmScript !StopDm }
on *:dialog:DScript:sclick:17-26: {
  msg #DmScript ! $+ $did($did)
}
on *:dialog:DScript:sclick:29: msg #DmScript !Dm

on *:dialog:DScript:sclick:14: {
  if (!$did(DScript,51)) {
    did -o DScript 9 1 Please input the $did(DScript,49).seltext you wish to get stats of.
    halt
  }
  msg %dmbot GetStats $did(DScript,49).sel $did(DScript,51)
  did -o DScript 9 1 Getting stats, please wait...
}

on *:dialog:DScript:sclick:10: {
  if !$did(DScript,6) || !$did(DScript,7) {
    did -o DScript 9 1 Please input a $iif($did(DScript,6),Password,Username)
    halt
  }
  msg %dmbot login $did(DScript,6) $did(DScript,7)
}

on *:dialog:DScript:sclick:11: { msg %dmbot logout }
on *:dialog:DScript:sclick:33: {
  if (!$did(DScript,32)) {
    did -o DScript 9 1 Please input a bot name to save
    halt
  }
  set %dmbot $did(DScript,32)
  did -o DScript 9 1 DeathMatch bot successfully set as $did(DScript,32) $+ !
}