Deck Keeper 2.0

By Vengeance on Sep 25, 2007

(Major Update)
what it does is pretty obvious
a place to store/view stats on a deck

to use it as always paste into your remotes section

Screen Shot
Image

Features
Menu
File
.Load (from file)
.Save (to dir)
Help ( shows some common info)
Announce
.Record's announces your win/loss + percentage's
.Deck Info Show amount of card + various info
.deck list scroll's your deck in a room/query

format of file to load has to be

//monsters
//spells
//traps

alias refresh.decklist {
  %x = 1
  did -r $dname 1
  while %x <= $ini(decks.ini,0) {
    did -a $dname 1 $ini(decks.ini,%x)
    inc %x
  }
  unset %x
}
alias Refresh {
  did -ra $dname 25 $readini(decks.ini,$did(1).text,monstertotal)
  did -ra $dname 27 $readini(decks.ini,$did(1).text,spelltotal)
  did -ra $dname 26 $readini(decks.ini,$did(1).text,traptotal)
  did -ra $dname 5 $readini(decks.ini,$did(1).text,wins)
  did -ra $dname 7 $readini(decks.ini,$did(1).text,loss)
  did -ra $dname 9 $percent($readini(decks.ini,$did(1).text,wins),$readini(decks.ini,$did(1).text,loss))
  did -ra $dname 11 $percent($readini(decks.ini,$did(1).text,loss),$readini(decks.ini,$did(1).text,wins))
  did -r $dname 15
  did -r $dname 17
  did -r $dname 19
  did -ra $dname 3 $did(1)
  set %x 1
  var %deck $did(1).text 
  while ( %x <= $readini(decks.ini,%deck,monstertotal) ) {
    did -a $dname 15 $readini(decks.ini,$did(1).text,monster $+ %x)
    if ($gettok($readini(decks.ini,$did(1).text,monster $+ %x),1,124) isalnum ) { inc %monstertotal $gettok($readini(decks.ini,$did(1).text,monster $+ %x),1,124) }
    inc %x  
  }
  set %x 1
  while ( %x <= $readini(decks.ini,%deck,spelltotal) ) {
    did -a $dname 17 $readini(decks.ini,$did(1).text,spell $+ %x)
    if ($gettok($readini(decks.ini,$did(1).text,spell $+ %x),1,124) isalnum) { inc %spelltotal $gettok($readini(decks.ini,$did(1).text,spell $+ %x),1,124) }
    inc %x
  }
  set %x 1
  while ( %x <= $readini(decks.ini,%deck,Traptotal) ) {
    did -a $dname 19 $readini(decks.ini,$did(1).text,trap $+ %x)
    if ($gettok($readini(decks.ini,$did(1).text,trap $+ %x),1,124) isalnum ) { inc %traptotal $gettok($readini(decks.ini,$did(1).text,trap $+ %x),1,124) }
    inc %x
  }
  unset %x
  did -ra $dname 32 %monstertotal
  did -ra $dname 34 %spelltotal
  did -ra $dname 36 %traptotal
  did -ra $dname 38 $calc(%monstertotal + %spelltotal + %traptotal)
  unset %monstertotal
  unset %spelltotal
  unset %traptotal
}

alias percent {
  %x = $left($calc($1 / ($1 + $2) * 100),2)
  return %x $+ %
}
dialog keeper {
  title "Deck Keeper v1.0"
  size -1 -1 445 337
  option pixels notheme
  combo 1, 89 37 110 70, drop
  text "Deck Name", 2, 9 39 74 17
  edit "", 3, 89 62 110 20
  button "Rename", 4, 102 92 65 20
  edit "", 5, 278 38 50 20
  text "Win's", 6, 237 39 35 17
  edit "", 7, 278 63 50 20
  text "loss's", 8, 237 64 35 17
  edit "", 9, 368 37 50 20
  text "%", 10, 337 38 13 17
  edit "", 11, 369 62 50 20
  text "%", 12, 337 63 15 17
  button "Make Changes", 13, 306 94 83 19
  text "Deck Keeper: By Battousai", 14, 9 7 133 17
  list 15, 10 217 136 128
  text "Diffrent Monster's =", 16, 11 188 100 17
  list 17, 157 217 136 128
  text "Diffrent Spell's =", 18, 157 188 106 17
  list 19, 302 216 136 128
  text "Diffrent Trap's =", 20, 303 187 104 17
  button "Refresh", 24, 301 8 83 19
  text "0", 25, 117 188 24 17
  text "0", 26, 411 187 24 17
  text "0", 27, 267 188 24 17
  text "Total Monster's =", 31, 11 167 100 17
  text "0", 32, 117 167 24 17
  text "Total Spell's =", 33, 157 167 106 17
  text "0", 34, 267 167 24 17
  text "Total Trap's =", 35, 303 166 104 17
  text "0", 36, 411 166 24 17
  text "Total Card's =", 37, 156 148 100 17
  text "0", 38, 267 148 24 17
  box "Deck Info", 39, 4 129 438 83
  menu "File", 21
  item "Save", 28, 21
  item "Load", 29, 21
  menu "About", 22
  item "Help", 23, 22
  menu "Announce", 40
  item "Record's", 41, 40
  item "Deck Info", 42, 40
  item "Deck List", 30, 40
}

menu *,channel {
  Deck Keeper:dialog -m keeper keeper
}

on *:dialog:keeper:init:*: {
  refresh.decklist
}

on *:dialog:keeper:sclick:24: {
  refresh
  refresh.decklist
}

on *:dialog:keeper:sclick:13: {
  writeini -n decks.ini $did(1) wins $did(5)
  writeini -n decks.ini $did(1) loss $did(7)
  did -ra $dname 9 $percent($readini(decks.ini,$did(1).text,wins),$readini(decks.ini,$did(1).text,loss))
  did -ra $dname 11 $percent($readini(decks.ini,$did(1).text,loss),$readini(decks.ini,$did(1).text,wins))

}

on *:dialog:keeper:sclick:4: {
  var %test $read(decks.ini, w, * $+ $did(1).text $+ *) | set %line $readn
  write -l $+ $readn decks.ini $chr(91) $+ $did(3) $+ $chr(93)
  %x = 1
  did -r $dname 1
  while %x <= $ini(decks.ini,0) {
    did -a $dname 1 $ini(decks.ini,%x)
    inc %x
  }
}
on *:dialog:keeper:menu:29: {
  set %deckloc $sfile(C:\Program Files\YVD\DECKS,Select Deck,Convert)
  if (!%deckloc) { halt }
  else {
    set %deck $replace($remove($gettok(%deckloc,$numtok(%deckloc,92),92),$right(%deckloc,4)),$chr(32),_)
    var %tempvar1 $read(%deckloc, w, *//monsters*) | set %dekmonsters $calc($readn +1)
    var %tempvar2 $read(%deckloc, w, *//spells*) | set %dekspells $calc($readn -1)
    var %tempvar3 $read(%deckloc, w, *//traps*) | set %dektraps $calc($readn -1)
    while ( %dekmonsters <= %dekspells ) {
      inc %x
      writeini decks.ini %deck Monster $+ %x $read(%deckloc,%dekmonsters)
      inc %dekmonsters
    }
    writeini decks.ini %deck monstertotal %x
    unset %x
    inc %dekspells 2 
    while ( %dekspells <= %dektraps ) {
      inc %x
      writeini decks.ini %deck Spell $+ %x $read(%deckloc,%dekspells)
      inc %dekspells
    }
    writeini decks.ini %deck spelltotal %x
    set %x 1
    inc %dektraps 2 
    while ( %dektraps <= $lines(%deckloc)) {
      if (//fusion isin $read(%deckloc,%dektraps)) { 
        halt 
      }
      else {
        writeini decks.ini %deck Trap $+ %x $read(%deckloc,%dektraps)
        inc %dektraps
        inc %x
      }
      writeini decks.ini %deck Traptotal %x 
    }
  }
}

on *:dialog:keeper:menu:28: {
  set %decksav $sfile(C:\Program Files\YVD\DECKS\ *.txt,title,ok)
  if (!%decksav) { halt }
  else {  
    set %x 1
    set %card 1
    write -l $+ %card $qt(%decksav) //Monsters
    inc %card 1
    while  (%card <= $readini(decks.ini,$did(1),monstertotal)) {
      write -l $+ %card $qt(%decksav) $readini(decks.ini,$did(1).text,Monster $+ %x)
      inc %x
      inc %card 1
    }
    write -l $+ %card $qt(%decksav) //Spells
    inc %card
    set %x 1
    while  (%x <= $readini(decks.ini,$did(1),spelltotal)) {
      write -l $+ %card $qt(%decksav) $readini(decks.ini,$did(1).text,spell $+ %x)
      inc %x
      inc %card 1
    }
    write -l $+ %card $qt(%decksav) //Traps
    inc %card
    set %x 1
    while  (%x <= $readini(decks.ini,$did(1),traptotal)) {
      write -l $+ %card $qt(%decksav) $readini(decks.ini,$did(1).text,trap $+ %x)
      inc %x
      inc %card 1
    }
  }
}
on *:dialog:keeper:menu:41: {
  describe $active My Record for: $qt($did(1)) Deck Is $chr(124) Win's $did(5) $chr(124) Win-Percentage $did(9) $chr(124) $+ $chr(124) Loss's $did(7) $chr(124) Loss-Percentage $did(11)
}
on *:dialog:keeper:menu:42: {
  describe $active My $qt($did(1)) Deck Stat's Are as follow's $chr(124) Card Total- $+ $did(38) $chr(124) Monster Info $did(32) $+ -Monster's $did(25) $+ -Distinct Monster's $chr(124) Spell Info $did(34) $+ -Spell's $did(27) $+ -Distinct Spell's $chr(124) Trap Info $did(36) $+ -Trap's $did(26) $+ -Distinct Trap's $chr(124)
}
on *:dialog:keeper:menu:23: {
  dialog -m help help
}
dialog help {
  title "Help"
  size -1 -1 216 220
  option pixels notheme
  tab "About", 1, 2 7 214 179
  tab "Deck Load", 5
  tab "Contact", 9
  text "For a deck to load properly you need to set your deck up correctly", 6, 18 50 177 30, tab 5
  text "Format: (//Monsters //spells //Traps) ", 7, 18 86 177 17, tab 5
  text "This is the only way I found to load the card's to diffrent list box's", 8, 18 113 178 32, tab 5
  text "This was made for a few reasons. Mainly Becuse most other deck keeper's (if you can find them just show win's loss's and what fun is that?", 2, 10 45 195 53, tab 1
  text "With This you can keep track of card's in your deck win/loss percentage renaming the deck", 3, 10 105 195 59, tab 1
  button "Close", 4, 72 191 65 25, cancel
  text "Email: XChaosDragon666X@gmail.com", 10, 10 41 196 17, tab 9
  text "AIM: Drag00nSlayer", 11, 10 65 107 17, tab 9
}

dialog List {
  title "Deck Advertiser"
  size -1 -1 183 322
  option pixels notheme
  list 1, 9 84 164 166
  button "Stop", 2, 59 287 65 25
  button "Send", 3, 59 253 65 25
  text "Deck List", 4, 41 13 100 17, center
  text "Total Lines     = ", 5, 33 38 76 17
  text "00", 6, 118 38 22 17, center
  text "Lines Left      = ", 7, 34 60 76 17
  text "00", 8, 118 60 22 17, center
}

on *:dialog:keeper:menu:30: {
  dialog -m List List
  set %totalcards $did(38) 
}
on *:dialog:List:init:*: {
  var %x 1
  while ( %x <= $readini(decks.ini,%deck,monstertotal) ) {
    did -a $dname 1 $readini(decks.ini,%deck,monster $+ %x)
    inc %x 
    inc %r 
  }
  var %x 1
  while ( %x <= $readini(decks.ini,%deck,spelltotal) ) {
    did -a $dname 1 $readini(decks.ini,%deck,spell $+ %x)
    inc %x
    inc %r 
  }
  var %x 1
  while ( %x <= $readini(decks.ini,%deck,Traptotal) ) {
    did -a $dname 1 $readini(decks.ini,%deck,trap $+ %x)
    inc %x
    inc %r 
  }
  dec %r
  set %c %r
  did -a $dname 6 %c
  did -a $dname 8 %c
}
on *:dialog:list:sclick:3: {
  set %c $did(6)
  var %x 1
  var %r 1
  while ( %x <= $readini(decks.ini,%deck,monstertotal) ) {
    .timerspam $+ %r 1 %r Describe %active $readini(decks.ini,%deck,monster $+ %x)
    inc %x 
    inc %r  
  }
  var %x 1
  while ( %x <= $readini(decks.ini,%deck,spelltotal) ) {
    .timerspam $+ %r 1 %r Describe %active $readini(decks.ini,%deck,spell $+ %x)
    inc %x
    inc %r
  }
  var %x 1
  while ( %x <= $readini(decks.ini,%deck,Traptotal) ) {
    .timerspam $+ %r 1 %r Describe %active $readini(decks.ini,%deck,trap $+ %x)
    inc %x
    inc %r
  }
}
on *:dialog:list:sclick:2: {
  .timer* off
}
on *:dialog:List:close:*: {
  unset %r
  unset %c
}

Comments

Sign in to comment.
Korvin   -  Nov 09, 2007

this is kindof nerdish, but good job

 Respond  
Viper01   -  Nov 09, 2007

wow, i had thought of doing something like this but im a n003 at dialogue :P. If i had about 3 more years of dialogue and other training, i probably couldve made something like this. overall i give it a 9/10 :)

 Respond  
Vengeance   -  Sep 25, 2007

Save Problem fixed

thanks for the $qt() suggestion on the forums XDaemon

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.