YVDA

By HeatedHeart on Aug 02, 2009

Made this for use with upcoming xerochat3, im on the development team so i though this would be a handy thing to have for all those Duelists out there who want a cleaner online dueling experience.
This snippet took me a couple of days and is not done yet. a couple of things i want to add....

Win/loss manager
Dialog based deck editor
Socket system to post deck on forums

system is user friendly, even if you dont specify your directory's perfectly, the script will search for your decks and yvd.exe, but the more accurate you are with specifying them, the faster and more efficient the snippet is.

Enjoy
-HH


Image

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Yu-gi-oh Virtual Dueling Assisstant;;
;;Coded By HeatedHeart---------------;;
;;For Use With XeroChat3-------------;;
;;All Rights Reserved:XeroChat Team--;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:LOAD:{ 
  set %path $sdir(C:\,Select Yugioh Virtual Dueling Directory)
  Set %Dpath $sdir(C:\,Select Deck Directory) 
  dialog -vmd Connection Connection
}
on *:DIALOG:YVDA:close:*: {
  ;
}
on *:DIALOG:YVDA:init:*: {
  refresh
  if ($sock(socketYVDA1)) .sockclose socketYVDA1
  sockopen socketYVDA1 www.xerocreative.com 80
}
on *:SOCKOPEN:socketYVDA1: {
  sockwrite -nt $sockname GET / HTTP/1.1
  sockwrite -nt $sockname Host: www.xerocreative.com
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:socketYVDA1: {
  if ($sockerr) {
    echo -a Socket Error: $sockname $+ . Error code: $sockerr 
    halt
  }
  else {
    var %sockreader
    sockread %sockreader
    if (*Users using YVD right now:* iswm %sockreader ) {
      var %x $nohtml(%sockreader)
      did -a YVDA 6 %x
      sockclose socketYVDA1
    }
  }
}
menu * {
  .YVD Assisstant: {
    dialog -vmd YVDA YVDA
  }
}
;;Alias Set
alias nohtml { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x } alias -l htm { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x }
alias refresh {
  did -r $dname 2
  var %x $findfile(%Dpath,*.dek,0)
  var %temp.1 1
  While (%temp.1 <= %x) {
    var %filePath $findfile(%Dpath,*.dek,%temp.1)
    did -a $dname 2 $gettok(%filepath,$numtok(%filepath,92),92)
    inc %temp.1
  }
}
dialog YVDA {
  title "Yu-gi-oh Virtual Dueling Assisstant V2.0"
  size -1 -1 462 400
  option pixels notheme
  box "", 9, 367 32 92 90
  button "Run Yu-gi-oh Virtual Dueling", 1, 2 374 373 25
  list 2, 1 1 131 294
  edit "I am looking For A Duel :: Advanced :: Server Duel", 10, 2 351 374 20
  button "Duel Request", 11, 300 323 73 25
  button "Display Deck List", 4, 182 323 108 25
  button "Refresh", 13, 104 323 65 25
  button "Settings", 14, 1 323 94 25
  button "Delete Deck", 15, 2 295 94 25
  button "About", 3, 104 295 65 25
  button "Display Decks", 12, 182 294 107 25
  button "Display Info", 5, 300 293 73 25
  list 7, 188 36 180 266
  button "Message Active", 8, 371 50 80 25
  button "Echo", 16, 373 88 77 25
  text "", 6, 187 5 174 30
  text "Card Effect", 17, 382 22 61 14
}
dialog Settings {
  title "Settings"
  size -1 -1 239 76
  option pixels notheme
  button "Set YVD Folder", 1, 1 2 89 25
  button "Set Connection Type", 2, -2 28 114 25
  button "Set Deck Folder", 3, 0 53 128 25
  text "YVDA", 4, 213 0 33 17
}
dialog YVDAbout {
  title "YVDAbout"
  size -1 -1 274 86
  option pixels notheme
  text "YVDA Version 1.1 By HeatedHeart", 1, 1 3 228 17
  text "All Rights Reserved. XeroChat 3 Team", 2, 1 24 190 17
  text "For Script Updates And my Latest Snippets Please vist", 3, 1 49 273 17
  link "www.XeroChat3.Pastebin.com", 4, 2 70 157 17
}
dialog Connection {
  title "Connection Type"
  size -1 -1 200 63
  option pixels notheme
  button "Server Duel", 1, 68 37 65 25
  button "Direct duel ", 2, 1 37 65 25
  button "Hamachi", 3, 135 37 65 25
  text "Yu-gi-oh Virtual Duel Assisstant", 4, 21 1 165 17
}
on *:dialog:Settings:SCLICK:*: {
  if ($did == 3) { Set %Dpath $sdir(C:\,Select Decks Directory) }
  if ($did == 1) { set %path $sdir(C:\,Yu-gi-oh Virtual Dueling) }
  if ($did == 2) {
    dialog -vmd connection connection
  }
}
on *:dialog:Connection:SCLICK:*: {
  if ($did == 3) { 
    set %Connection Hamachi
    set %Cname $?"Your Hamachi Network Name?"
    dialog -x $dname
  }
  if ($did == 2) {
    set %Connection Direct
    set %CnameNone
    dialog -x $dname
  }
  if ($did == 1) {
    set %Connection Server
    set %Cname $?"YVD Server Nick"
    dialog -x $dname
  }
}
on *:dialog:YVDA:SCLICK:*: {
  if ($did == 16) {  
    set %temp.1 $findfile(%Path,yvd.set,1)  
    set %Temp.2 $gettok($did(7).seltext,3,124)
    if ($Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124) == Spell Card) { 
      echo -a $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),1,124)
      echo -a $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),6,124)
      halt
    }
    if ($Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124) == Trap Card) {
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),1,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),6,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),7,124)
    }
    Else {
      echo -a $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),1,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),6,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),7,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),8,124)
      echo -a  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),9,124)
    }
  }
  if ($did == 8) {  
    set %temp.1 $findfile(%Path,yvd.set,1)  
    set %Temp.2 $gettok($did(7).seltext,3,124)
    if ($Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124) == Spell Card) { 
      msg $active $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),1,124)
      msg $active $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),6,124)
      halt
    }
    if ($Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124) == Trap Card) {
      msg $active $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),1,124)
      msg $active $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),6,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),7,124)
      halt
    }
    Else {
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),1,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),4,124)
      msg $active   $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),6,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),7,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),8,124)
      msg $active  $Gettok($read(%temp.1,w, * $+ %temp.2 $+ *),9,124)
      halt
    }
  }
  if ($did == 1) { /run $findfile(%path,Yugioh Virtual Desktop 9.exe,1) }
  if ($did == 2) { 
    did -r $dname 7
    var %temp.1 1
    var %x $findfile(%Dpath,$did(2).seltext,0)
    While (%temp.1 < 100) {
      if ($read($qt(%Dpath $+ $did(2).seltext), %temp.1) != $null) {
        var %filePath $findfile(%Dpath,$did(2).seltext,%x)
        did -a $dname 7 $read($qt(%FilePath), %temp.1)
      }
      Else {
        halt
      }
      inc %temp.1
    }
  }
  if ($did == 3) { dialog -vmd YVDAbout YVDAbout  }
  if ($did == 25) { dialog -vmd DeckEditor DeckEditor }
  if ($did == 14) { dialog -vmd Settings Settings }
  if ($did == 11) { amsg $did(10) YVD Assisstant }
  if ($did == 13) { /refresh }
  if ($did == 15) {
    var %z $?!="Are you sure you want to delete this deck?"
    if (%z == $True) { 
      .remove $qt(%Dpath $+ $did(2).seltext) 
      refresh
    }
    else { 
      halt
    }
  }
  if ($did == 4) {
    var %temp.1 1
    While (%temp.1 < 100) {
      if ($read($qt(%Dpath $+ $did(2).seltext), %temp.1) != $null) {
        msg $active $read($qt(%Dpath $+ $did(2).seltext), %temp.1)
      }
      Else {
        halt
      }
      inc %temp.1
    }
  }
  if ($did == 5) { 
    if (%Connection == Hamachi) { msg $active Hamachi Name: %CName - Listening }
    if (%Connection == Direct) { msg $active Direct Duel - I Host: $ip - Listening }
    if (%Connection == Server) { 
      var %x $r(1,2)
      if (%x == 1) { msg $active Server Duel: %CName - You Host }
      if (%x == 2) { msg $active Server Duel: %Cname - I Host }
    }
  }
  if ($did == 12) {   
    var %x $findfile(%path,*.dek,0)
    var %temp.1 1
    While (%temp.1 <= %x) {
      var %filePath $findfile(%path,*.dek,%temp.1)
      msg $Active $gettok(%filepath,$numtok(%filepath,92),92)
      inc %temp.1
    }
  }
}

Comments

Sign in to comment.
PATX   -  Aug 13, 2009

5/5

http://txtb.in/3U5

tho to many it is useless, cos nobody has heard of yvd where i come from (freenode).

 Respond  
HeatedHeart   -  Aug 05, 2009

added a screenshot

 Respond  
Orichalcos   -  Aug 05, 2009

W00t
i like it, prolly one of the best around YVD ircs.

Nice mate

 Respond  
HeatedHeart   -  Aug 05, 2009

p.s - Sorry for the away system that was also posted inside this snipet, i removed it now.

 Respond  
HeatedHeart   -  Aug 05, 2009

there is a large number of irc users who use yvd. as yvd has an irc server "irc.xerocreative.com" this script does require yvd to use as it is useless without it. Im gona try to upload a SS at least of YVDA so you guys can atleast visually see the script in action.

 Respond  
FordLawnmower   -  Aug 04, 2009

I had to google YVD to see what it was. I found that there is a large community of people who play this game, but I'm not sure how many there are after you exclude non-IRC users.

 Respond  
TheImrac   -  Aug 04, 2009

z0m6 7h15 5uck e1p1c f41L...

In all seriousness I don't know what program you are talking about so I have no way to test, nor do I want to download and test. I am sure 99.9% of the populace will feel the same way, that's why there is no criticism.

Not saying its bad, its looks good when glancing through the code. Unfortunately scripts that are geared to a very specific audience is usually hard to judge. I am glad you took the time to make this and I hope it has improved your MSL skills.

 Respond  
HeatedHeart   -  Aug 03, 2009

oh btw, you need YVD to benefit from this script... kinda self explanatory as its called yvd assistant.. but w/e..

 Respond  
HeatedHeart   -  Aug 03, 2009

any comments at all? Criticism maybe? even "this failz lolololz" would be nice

 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.