alias Pokemon {
if ( $dialog(TeamEditor) ) dialog -x TeamEditor TeamEditor
dialog -md TeamEditor TeamEditor
}
dialog -l TeamEditor {
title "Pokémon Editor"
size -1 -1 600 300
button "Send", 100, 520 265 70 25, ok
text "Team", 500, 10 270 30 20
edit "", 501, 40 267 230 20
text "Slot", 502, 320 270 30 20
combo 503, 345 267 30 20, drop
text "Species", 9, 10 10 280 20, center
edit "", 10, 10 30 280 20
text "Item", 11, 300 10 280 20, center
edit "Leftovers", 12, 300 30 280 20
text "IVs", 13, 10 50 280 20, center
text "HP", 49, 10 55 45 15, center
edit "31", 14, 10 70 45 20
text "Atk", 50, 57 55 45 15, center
edit "31", 15, 57 70 45 20
text "Def", 51, 109 55 30 15, left
edit "31", 16, 104 70 45 20
text "SpA", 52, 160 55 30 15, right
edit "31", 17, 151 70 45 20
text "SpD", 53, 198 55 45 15, center
edit "31", 18, 198 70 45 20
text "Spe", 54, 245 55 45 15, center
edit "31", 19, 245 70 45 20
text "EVs", 20, 300 50 280 20, center
text "HP", 55, 300 55 45 15, center
edit "0", 21, 300 70 45 20
text "Atk", 56, 347 55 45 15, center
edit "0", 22, 347 70 45 20
text "Def", 57, 399 55 30 15, left
edit "0", 23, 394 70 45 20
text "SpA", 58, 450 55 30 15, right
edit "0", 24, 441 70 45 20
text "SpD", 59, 488 55 45 15, center
edit "0", 25, 488 70 45 20
text "Spe", 60, 535 55 45 15, center
edit "0", 26, 535 70 45 20
button "All 31", 29, 10 100 139 20, center
combo 30, 151 100 139 20, drop
text "Nature", 27, 10 125 280 20, center
combo 28, 10 145 280 20, drop
text "Ability", 199, 10 170 280 20, center
edit "", 200, 10 190 280 20
button "0", 31, 300 90 22 20
button "4", 32, 323 90 22 20
button "252", 33, 300 110 45 20
button "0", 34, 347 90 22 20
button "4", 35, 370 90 22 20
button "252", 36, 347 110 45 20
button "0", 37, 394 90 22 20
button "4", 38, 417 90 22 20
button "252", 39, 394 110 45 20
button "0", 40, 441 90 22 20
button "4", 41, 464 90 22 20
button "252", 42, 441 110 45 20
button "0", 43, 488 90 22 20
button "4", 44, 511 90 22 20
button "252", 45, 488 110 45 20
button "0", 46, 535 90 22 20
button "4", 47, 558 90 22 20
button "252", 48, 535 110 45 20
text "Moves", 299, 300 135 280 20, center
edit "", 300, 300 155 240 20
button "Clear", 400, 545 155 40 20
edit "", 301, 300 175 240 20
button "Clear", 401, 545 175 40 20
edit "", 302, 300 195 240 20
button "Clear", 402, 545 195 40 20
edit "", 303, 300 215 240 20
button "Clear", 403, 545 215 40 20
button "Clear All", 404, 505 235 80 20
button "Load a Pokémon", 504, 70 223 160 30
radio "Hypno", 101, 430 258 85 20, group
radio "DragonKnight", 102, 430 275 85 20,
}
dialog -l LoadPoke {
title "Load a Pokémon"
size -1 -1 300 150
text "Team", 1, 10 10 280 20, center
edit "", 2, 10 30 280 20
text "Slot", 3, 10 60 280 20, center
edit "", 4, 10 80 280 20
button "Load", 5, 30 115 240 30, ok
}
on *:DIALOG:TeamEditor:init:0:{
did -a TeamEditor 28 Adamant
did -a TeamEditor 28 Bashful
did -a TeamEditor 28 Bold
did -a TeamEditor 28 Brave
did -a TeamEditor 28 Calm
did -a TeamEditor 28 Careful
did -a TeamEditor 28 Docile
did -a TeamEditor 28 Gentle
did -a TeamEditor 28 Hardy
did -a TeamEditor 28 Hasty
did -a TeamEditor 28 Impish
did -a TeamEditor 28 Jolly
did -a TeamEditor 28 Lax
did -a TeamEditor 28 Lonely
did -a TeamEditor 28 Mild
did -a TeamEditor 28 Modest
did -a TeamEditor 28 Naive
did -a TeamEditor 28 Naughty
did -a TeamEditor 28 Quiet
did -a TeamEditor 28 Quirky
did -a TeamEditor 28 Rash
did -a TeamEditor 28 Relaxed
did -a TeamEditor 28 Sassy
did -a TeamEditor 28 Serious
did -a TeamEditor 28 Timid
did -a TeamEditor 30 Hidden Power Fighting
did -a TeamEditor 30 Hidden Power Flying
did -a TeamEditor 30 Hidden Power Poison
did -a TeamEditor 30 Hidden Power Ground
did -a TeamEditor 30 Hidden Power Rock
did -a TeamEditor 30 Hidden Power Bug
did -a TeamEditor 30 Hidden Power Ghost
did -a TeamEditor 30 Hidden Power Steel
did -a TeamEditor 30 Hidden Power Fire
did -a TeamEditor 30 Hidden Power Water
did -a TeamEditor 30 Hidden Power Grass
did -a TeamEditor 30 Hidden Power Electric
did -a TeamEditor 30 Hidden Power Psychic
did -a TeamEditor 30 Hidden Power Ice
did -a TeamEditor 30 Hidden Power Dragon
did -a TeamEditor 30 Hidden Power Dark
did -a TeamEditor 503 1
did -a TeamEditor 503 2
did -a TeamEditor 503 3
did -a TeamEditor 503 4
did -a TeamEditor 503 5
did -a TeamEditor 503 6
did -c TeamEditor 28 1
did -c TeamEditor 30 16
did -c TeamEditor 503 1
did -c TeamEditor 101
did -f TeamEditor 10
}
on *:DIALOG:TeamEditor:SCLICK:29:{
did -o TeamEditor 14 1 31
did -o TeamEditor 15 1 31
did -o TeamEditor 16 1 31
did -o TeamEditor 17 1 31
did -o TeamEditor 18 1 31
did -o TeamEditor 19 1 31
did -c TeamEditor 30 16
}
on *:DIALOG:TeamEditor:EDIT:14,15,16,17,18,19:{
if ( $did(14) == $null ) did -o TeamEditor 14 1 0
if ( $did(15) == $null ) did -o TeamEditor 15 1 0
if ( $did(16) == $null ) did -o TeamEditor 16 1 0
if ( $did(17) == $null ) did -o TeamEditor 17 1 0
if ( $did(18) == $null ) did -o TeamEditor 18 1 0
if ( $did(19) == $null ) did -o TeamEditor 19 1 0
did -c TeamEditor 30 $int($calc( ( ( ( $iif($calc( $did(14) % 2 ) == 1,1,0) + ( 2 * $iif($calc( $did(15) % 2 ) == 1,1,0) ) + $&
( 4 * $iif($calc( $did(16) % 2 ) == 1,1,0) ) + ( 8 * $iif($calc( $did(19) % 2 ) == 1,1,0) ) + $&
( 16 * $iif($calc( $did(17) % 2 ) == 1,1,0) ) + ( 32 * $iif($calc( $did(18) % 2 ) == 1,1,0) ) ) * 15 ) / 63 ) + 1 ))
}
on *:DIALOG:TeamEditor:SCLICK:31:did -o TeamEditor 21 1 0
on *:DIALOG:TeamEditor:SCLICK:32:did -o TeamEditor 21 1 4
on *:DIALOG:TeamEditor:SCLICK:33:did -o TeamEditor 21 1 252
on *:DIALOG:TeamEditor:SCLICK:34:did -o TeamEditor 22 1 0
on *:DIALOG:TeamEditor:SCLICK:35:did -o TeamEditor 22 1 4
on *:DIALOG:TeamEditor:SCLICK:36:did -o TeamEditor 22 1 252
on *:DIALOG:TeamEditor:SCLICK:37:did -o TeamEditor 23 1 0
on *:DIALOG:TeamEditor:SCLICK:38:did -o TeamEditor 23 1 4
on *:DIALOG:TeamEditor:SCLICK:39:did -o TeamEditor 23 1 252
on *:DIALOG:TeamEditor:SCLICK:40:did -o TeamEditor 24 1 0
on *:DIALOG:TeamEditor:SCLICK:41:did -o TeamEditor 24 1 4
on *:DIALOG:TeamEditor:SCLICK:42:did -o TeamEditor 24 1 252
on *:DIALOG:TeamEditor:SCLICK:43:did -o TeamEditor 25 1 0
on *:DIALOG:TeamEditor:SCLICK:44:did -o TeamEditor 25 1 4
on *:DIALOG:TeamEditor:SCLICK:45:did -o TeamEditor 25 1 252
on *:DIALOG:TeamEditor:SCLICK:46:did -o TeamEditor 26 1 0
on *:DIALOG:TeamEditor:SCLICK:47:did -o TeamEditor 26 1 4
on *:DIALOG:TeamEditor:SCLICK:48:did -o TeamEditor 26 1 252
on *:DIALOG:TeamEditor:SCLICK:400:{
did -r TeamEditor 300
did -f TeamEditor 300
}
on *:DIALOG:TeamEditor:SCLICK:401:{
did -r TeamEditor 301
did -f TeamEditor 301
}
on *:DIALOG:TeamEditor:SCLICK:402:{
did -r TeamEditor 302
did -f TeamEditor 302
}
on *:DIALOG:TeamEditor:SCLICK:403:{
did -r TeamEditor 303
did -f TeamEditor 303
}
on *:DIALOG:TeamEditor:SCLICK:404:{
did -r TeamEditor 300
did -r TeamEditor 301
did -r TeamEditor 302
did -r TeamEditor 303
did -f TeamEditor 300
}
on *:DIALOG:TeamEditor:SCLICK:30:{
did -o TeamEditor 14 1 $gettok($getIVs($gettok($did(30),3,32)),1,32)
did -o TeamEditor 15 1 $gettok($getIVs($gettok($did(30),3,32)),2,32)
did -o TeamEditor 16 1 $gettok($getIVs($gettok($did(30),3,32)),3,32)
did -o TeamEditor 17 1 $gettok($getIVs($gettok($did(30),3,32)),4,32)
did -o TeamEditor 18 1 $gettok($getIVs($gettok($did(30),3,32)),5,32)
did -o TeamEditor 19 1 $gettok($getIVs($gettok($did(30),3,32)),6,32)
}
alias -l getIVs {
if ( $1 == Fighting ) return 31 31 30 30 30 30
if ( $1 == Flying ) return 31 31 31 30 30 30
if ( $1 == Poison ) return 31 31 30 30 30 31
if ( $1 == Ground ) return 31 31 31 30 30 31
if ( $1 == Rock ) return 31 31 30 31 30 30
if ( $1 == Bug ) return 31 30 30 31 30 31
if ( $1 == Ghost ) return 31 30 31 31 30 31
if ( $1 == Steel ) return 31 31 31 31 30 31
if ( $1 == Fire ) return 31 30 31 30 31 30
if ( $1 == Water ) return 31 30 30 30 31 31
if ( $1 == Grass ) return 31 30 31 30 31 31
if ( $1 == Electric ) return 31 31 31 30 31 31
if ( $1 == Psychic ) return 31 30 31 31 31 30
if ( $1 == Ice ) return 31 30 30 31 31 31
if ( $1 == Dragon ) return 31 30 31 31 31 31
if ( $1 == Dark ) return 31 31 31 31 31 31
}
alias -l getNature {
if ( $1 == Adamant ) return 1
if ( $1 == Bashful ) return 2
if ( $1 == Bold ) return 3
if ( $1 == Brave ) return 4
if ( $1 == Calm ) return 5
if ( $1 == Careful ) return 6
if ( $1 == Docile ) return 7
if ( $1 == Gentle ) return 8
if ( $1 == Hardy ) return 9
if ( $1 == Hasty ) return 10
if ( $1 == Impish ) return 11
if ( $1 == Jolly ) return 12
if ( $1 == Lax ) return 13
if ( $1 == Lonely ) return 14
if ( $1 == Mild ) return 15
if ( $1 == Modest ) return 16
if ( $1 == Naive ) return 17
if ( $1 == Naughty ) return 18
if ( $1 == Quiet ) return 19
if ( $1 == Quirky ) return 20
if ( $1 == Rash ) return 21
if ( $1 == Relaxed ) return 22
if ( $1 == Sassy ) return 23
if ( $1 == Serious ) return 24
if ( $1 == Timid ) return 25
}
alias -l getMoveSlot {
if ( $1 == 1 ) return 300
if ( $1 == 2 ) return 301
if ( $1 == 3 ) return 302
if ( $1 == 4 ) return 303
}
on *:DIALOG:TeamEditor:SCLICK:504:{
if ( $dialog(LoadPoke) ) dialog -x LoadPoke LoadPoke
dialog -md LoadPoke LoadPoke
}
on *:DIALOG:TeamEditor:SCLICK:100:{
var %host = $iif($did(101).state,$did(101),$did(102))
var %team = $did(501)
var %slot = $did(503)
mesg %host MyTeam %team Pokémon %slot $did(10)
mesg %host MyTeam %team Item %slot $did(12)
mesg %host MyTeam %team Nature %slot $did(28)
mesg %host MyTeam %team Ability %slot $did(200)
mesg %host MyTeam %team IVs %slot $did(14) $did(15) $did(16) $did(17) $did(18) $did(19)
mesg %host MyTeam %team EVs %slot $did(21) $did(22) $did(23) $did(24) $did(25) $did(26)
mesg %host MyTeam %team Moves %slot $+($did(300),$chr(44),$chr(32),$did(301),$chr(44),$chr(32),$did(302),$chr(44),$chr(32),$did(303))
echo -ac info * Pokémon data sent to %host $+ .
}
on *:DIALOG:LoadPoke:SCLICK:5:{
did -o TeamEditor 501 1 $did(LoadPoke,2)
did -c TeamEditor 503 $did(LoadPoke,4)
set %host $iif($did(TeamEditor,101).state,$did(TeamEditor,101),$did(TeamEditor,102))
set %loadpokemon 1
.msg %host MyTeam $did(LoadPoke,2) View $did(LoadPoke,4)
}
on $*:NOTICE:*:?:{
if ( ( %loadpokemon ) && ( $nick == %host ) ) {
if ( $chr(64) isin $1- ) {
did -o TeamEditor 10 1 $3
did -o TeamEditor 12 1 $5-
}
if ( $chr(44) isin $1- ) {
did -o TeamEditor 200 1 $gettok($1-,1,44)
did -c TeamEditor 28 $getNature($right($gettok($1-,2,44),-1))
}
if ( $chr(47) isin $1- ) {
did -o TeamEditor 14 1 $1
did -o TeamEditor 15 1 $2
did -o TeamEditor 16 1 $3
did -o TeamEditor 17 1 $4
did -o TeamEditor 18 1 $5
did -o TeamEditor 19 1 $6
did -c TeamEditor 30 $int($calc( ( ( ( $iif($calc( $did(TeamEditor,14) % 2 ) == 1,1,0) + ( 2 * $iif($calc( $did(TeamEditor,15) % 2 ) == 1,1,0) ) + $&
( 4 * $iif($calc( $did(TeamEditor,16) % 2 ) == 1,1,0) ) + ( 8 * $iif($calc( $did(TeamEditor,19) % 2 ) == 1,1,0) ) + $&
( 16 * $iif($calc( $did(TeamEditor,17) % 2 ) == 1,1,0) ) + ( 32 * $iif($calc( $did(TeamEditor,18) % 2 ) == 1,1,0) ) ) * 15 ) / 63 ) + 1 ))
did -o TeamEditor 21 1 $8
did -o TeamEditor 22 1 $9
did -o TeamEditor 23 1 $10
did -o TeamEditor 24 1 $11
did -o TeamEditor 25 1 $12
did -o TeamEditor 26 1 $13
}
if ( $chr(126) isin $1- ) {
if ( %movenum == $null ) set %movenum 0
inc %movenum 1
did -o TeamEditor $getMoveSlot(%movenum) 1 $2-
if ( %movenum == 4 ) {
unset %host
unset %movenum
unset %loadpokemon
}
}
}
}
alias -l mesg {
if ( %timeramount == $null ) set %timeramount 0
.timerkilltimer off
.timerkilltimer 1 $calc( ( 5 * %timeramount ) + 1 ) unset %timeramount
.timer 1 $calc( 5 * %timeramount ) .msg $1 $$2-
inc %timeramount 1
}