Helpful C&C Scripts

firecape

This is the end...
is a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
This thread is basically for IRC scripts that make certain c&c tasks, such as html, a little bit easier.

Feel free to contribute your own as long as its not something flashy and actually useful!

This is one by me that will format any set into the proper html format. For example, if you enter

Code:
Jirachi @ Leftovers
Ability: Serene Grace
EVs: 252 HP / 40 Def / 216 SpD
Careful nature (+SpD, -SpA)
- Wish
- Iron Head
- Protect 
- Toxic / Body Slam / U-turn / Fire Punch
it will return:

HTML:
<p><img src="/download/sprites/bw/385.png" alt="Jirachi" /><br />
Jirachi @ Leftovers<br />
Ability: Serene Grace<br />
EVs: 252 HP / 40 Def / 216 SpD<br />
Careful nature (+SpD, -SpA)<br />
- Wish<br />
- Iron Head<br />
- Protect<br />
- Toxic / Body Slam / U-turn / Fire Punch</p>
correct sprite and all!

You can also just put a pokemon name into the main box, and it will return that Pokemon's htmled sprite link. This supports /dp/ and /bw/. Instructions are included in the actual script, but if you have any questions feel free to ask me on irc / post here. If you find any bugs post here as well, but posts containing "bugs" caused by improper usage will be deleted. Also, please note not all IRC clients support scripting. Mirc is probably the easiest one to use, so if you don't have it get it! Mac users are out of luck i'm afraid...

Here's the script:

Code:
; Copy this into remote and press F11 to activate
; You need this text file (Notepad works well) http://pastebin.com/vHexnaRW in your Mirc directory (enter //run $mircdir, then drag and drop), and title it pokemonsprites
; C/P a set with the first line in the format "pokemon @ item" and watch!
alias F11 {
  dialog -md html html
}
dialog html {
  title "Set to HTML script by firecape"
  size -1 -1 175 135
  option dbu
  text "Specify generation (bw/dp), will default to bw if left blank.", 4, 10 4 150 8, center
  edit "", 3, 24 18 125 10
  edit "", 1, 24 43 125 62, multi
  text "Paste Here", 2, 61 30 50 9, center
  button "Done", 6, 24 113 125 12, ok
}
on *:dialog:html:sclick:6: {
  var %sprite.pokemon $gettok($did(html,1),1,32)
  var %deoxysformes Deoxys-S Deoxys-N Deoxys-A
  var %sprite.weird Rotom-W Rotom-H Rotom-S Rotom-F Rotom-C Giratina-O Shaymin-S
  var %sprite.number $remove($read(pokemonsprites.txt, w,  * $+ %sprite.pokemon $+ *), $+ %sprite.pokemon $+ )
  var %sprite.number $round(%sprite.number)
  if (%sprite.number >= 387 && %sprite.pokemon !isin %deoxysformes && %sprite.pokemon !isin %sprite.weird) {
  inc %sprite.number 3 }
  if (%sprite.number >= 414 && %sprite.pokemon != Wormadam-G && %sprite.pokemon != Wormadam-S && %sprite.pokemon !isin %sprite.weird) {
  inc %sprite.number 2 }
  if (%sprite.number >= 494 && %sprite.pokemon != Wormadam-G && %sprite.pokemon != Wormadam-S && %sprite.pokemon !isin %sprite.weird) {
  inc %sprite.number 7 }
  if (%sprite.number >= 563) {
  inc %sprite.number 1 }
  if (%sprite.number >= 568 && %sprite.pokemon != darmanitan && %sprite.pokemon != darmanitan-d) {
  inc %sprite.number 1 }
  if (%sprite.pokemon == genosect) {
  inc %sprite.number 1 }
  var %linkhtml <p><img src=" $+ $+(/download/sprites/,$iif($did(html,3) == dp,dp/,bw/),%sprite.number,.png) $+ " alt=" $+ $upper($left(%sprite.pokemon,1)) $+ $right(%sprite.pokemon,$calc($len(%sprite.pokemon)-1)) $+ " /><br />
  echo -a %linkhtml
  var %b 1
  if ($gettok($did(html,1,2),1,32) $+ 1 == 1) { var %b 100 }
  while ($did(html,1,$calc(%b + 1)) != $null) {
    echo -a $did(html,1,%b) $+ <br />
  inc %b }
  echo -a $iif(%b == 100,$null,$did(html,1,%b) $+ </p>) 
}
Here's a script by Charmander to format sets for c&c straight from the PO export function:

Code:
alias F12 {
  dialog -md form form
}
dialog form {
  title "Pokemon Online to C&C Formatter by Charmander"
  size -1 -1 175 135
  option dbu
  edit "", 1, 24 43 125 62, multi
  text "Paste Here", 2, 61 30 50 9, center
  edit "", 3, 24 18 125 10
  text "Set Name", 4, 61 4 50 8, center
  button "Done", 5, 24 113 125 12, ok
}
on *:dialog:form:sclick:5: {
  set -l %a echo -a
  %a [SET]
  %a name: $iif($did(form,3) == $null,$gettok($did(form,1,1),$calc($findtok($did(form,1,1),@,32) + 1) $+ -,32),$did(form,3))
  set -l %b 1
  while (%b <= 4) {
    %a move %b $+ : $gettok($did(form,1,$calc(%b + 4)),2-,32)
    inc %b
  }
  %a item: $gettok($did(form,1,1),$calc($findtok($did(form,1,1),@,32) + 1) $+ -,32)
  %a ability: $gettok($did(form,1,2),2-,32)
  %a nature: $gettok($did(form,1,4),1,32)
  %a evs: $replacecs($gettok($did(form,1,3),2-,32),SAtk,SpA,SDef,SpD,Spd,Spe)
}
 
you know I have to contribute more to this so...

here's more on my PO to C&C script. I guess you can kind of call this a walk through
so let's say this is the set we want to use:

Mienfoo (M) @ Eviolite
Trait: Regenerator
EVs: 156 Atk / 196 Def / 156 Spd
Jolly Nature (+Spd, -SAtk)
- Hi Jump Kick
- Drain Punch
- U-turn
- Knock Off


we press f12 and open something that looks like this

and paste our set. Also, you have a choice to give it a name. If you do, it'll use that as the name (eg name: Sweeper). If you don't, it'll use the item name (this is useful for Choice item Pokemon, Life Orb sweepers, and others).
After we've done this, it'll look like this


Click "Done" and you're done! It will return

[SET]
name: Best Name Ever
move 1: Hi Jump Kick
move 2: Drain Punch
move 3: U-turn
move 4: Knock Off
item: Eviolite
ability: Regenerator
nature: Jolly
evs: 156 Atk / 196 Def / 156 Spe

Also, here is another script that formats stuff in C&C format. This is extremely simple, so I won't really give any instructions, but here is a screenshot


and here is the script
Code:
menu menubar,channel,query {
  Set Formatter by Charmander : dialog -md Set Set
}
dialog Set {
  title "Set Formatter by Charmander"
  size -1 -1 317 270
  edit "Set Name", 2, 10 46 300 20
  edit "Move 1", 1, 10 62 300 20
  edit "Move 2", 3, 10 78 300 20
  edit "Move 3", 4, 10 94 300 20
  edit "Move 4", 5, 10 110 300 20
  edit "Item", 6, 10 126 300 20
  edit "Ability", 7, 10 142 300 20
  edit "Nature", 8, 10 158 300 20
  edit "EVs", 9, 10 174 300 20
  edit "IVs", 10, 10 190 300 20
  text "[SET]", 11, 10 26 300 20, center
  button "Make My Set!", 12, 9 217 299 40, ok
  text "If you want to exclude IVs/Ability, leave them untouched.", 25, 12 6 290 17
}
on *:dialog:Set:sclick:12: {
  echo -a [SET]
  echo -a name: $did(Set,2)
  echo -a move 1: $did(Set,1)
  echo -a move 2: $did(Set,3)
  echo -a move 3: $did(Set,4)
  echo -a move 4: $did(Set,5)
  echo -a item: $did(Set,6)
  if ($did(Set,7) != Ability) {
    echo -a ability: $did(Set,7)
  }
  echo -a nature: $did(Set,8)
  echo -a evs: $did(Set,9)
  if ($did(Set,10) != IVs) {
    echo -a ivs: $did(Set,10)
  }
}
edit: also #scripting on irc for general help
 
  • Like
Reactions: BP

firecape

This is the end...
is a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
I made another one for easily htmling speed tiers. It has a limit to the amount of text you can enter at one, and you'll have to do the headers yourself, but it will html the entire body, including linking to the appropriate pokemon. Also please note its set to erase the previous file on each use, so c/p what you need, then enter the next part. Also, the rows must be in the format Speed / Name / Base / Nature / EVs / Boost for it to work (spacing and dashes included). All you have to do is enter it into remote, type "/htmltable", c/p the speed tier section into the dialog box, then click done, Here it is:

Code:
alias htmltable {
dialog -md table table }
dialog table {
  title "table to html by firecape"
  size -1 -1 275 335
  option dbu
  edit "", 1, 2.5 10 270 300, multi
  text "Paste Here", 2, 112 1 50 9, center
  button "Done", 5, 80 313 125 12, ok
}
on *:dialog:table:sclick:5: {
  var %line 1
  write -c htmltable.txt
  while ($did(table,1,%line) != $null) {
    var %column 1
    write htmltable.txt <tr> 
    while (%column < 7) {
      if (%column != 2) { write htmltable.txt <td> $+ $remove($gettok($did(table,1,%line),%column,47),$chr(32)) $+ </td> }
      else { 
        var %pokemonamount $numtok($gettok($did(table,1,%line),2,47),32)
        var %currentpokemon 1
        var %a <td>
        while (%pokemonamount >= %currentpokemon) {
          var %a %a $+ $remove($remove(<a href="/bw/pokemon/ $+ $gettok($gettok($did(table,1,%line),2,47),%currentpokemon,32),$chr(42)) $+ ">,$chr(44)) $+ $remove($remove($gettok($gettok($did(table,1,%line),2,47),%currentpokemon,32),$chr(42)),$chr(44)) $+ </a> 
        inc %currentpokemon }
        var %a $replace(%a,</a><a href,</a> $+ $chr(44) <a href)
        var %a %a $+ </td>
        write htmltable.txt %a
      }
    inc %column }
    write htmltable.txt </tr>
  inc %line }
  run htmltable.txt
}
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top