View difference between Paste ID: pQyXGnMs and a6NNjPKm
SHOW: | | - or go back to the newest paste.
1
alias inv {
2
  if (!%DLwritten) {
3
    if (!$findfile($mircdir,districtlist.txt,1)) {
4
      write districtlist.txt Acrylic Acres
5
      write districtlist.txt Avant Gardens
6
      write districtlist.txt Baroque Bluffs
7
      write districtlist.txt Bliss Bayou
8
      write districtlist.txt Brush Bay
9
      write districtlist.txt Colorful Canvas
10
      write districtlist.txt Eraser Oasis
11
      write districtlist.txt Graphite Gulch
12
      write districtlist.txt Paintbrush Field
13
      write districtlist.txt Pastel Plains
14
      write districtlist.txt Pianissimo Plateau
15
      write districtlist.txt Pigment Point
16
      write districtlist.txt Renaissance River
17
      write districtlist.txt Stencil Steppe
18
      write districtlist.txt Vibrant Valley
19
      write districtlist.txt Watercolor Woods
20
      set %DLwritten 1
21
    }
22
    else { set %DLwritten 1 }
23
  }
24
  if (!%MLwritten) {
25
    if (!$findfile($mircdir,invmessages.txt,1)) {
26
      write invmessages.txt Get out there and bust some baddies!
27
      set %MLwritten 1
28
    }
29
    else { set %MLwritten 1 }
30
  }
31
  var %invSellbots Cold Caller Telemarketer Name Dropper Glad Hander Two-Face The Mingler Mr. Hollywood
32
  var %invCashbots Short Change Penny Pincher Tightwad Bean Counter Number Cruncher Money Bags Loan Shark Robber Baron
33
  var %invLawbots Bottom Feeder Bloodsucker Double Talker Ambulance Chaser Back Stabber Spin Doctor Legal Eagle Big Wig
34
  var %invBossbots Flunky Pencil Pusher Yesman Micromanager Downsizer Head Hunter Corporate Raider The Big Cheese
35
  var %CurrentDistrictNumber 0
36
  jsonopen -ud inv https://www.toontownrewritten.com/api/invasions
37
  :ds
38
  if (%CurrentDistrictNumber <= $lines(districtlist.txt)) { var %CurrentDistrictNumber $calc(%CurrentDistrictNumber + 1) }
39
  else { goto ads }
40
  var %CurrentDistrict $read(districtlist.txt, %CurrentDistrictNumber)
41
  var %CurrentType $remove($json(inv, invasions, %CurrentDistrict, type),)
42
  var %CurrentProgress $json(inv, invasions, %CurrentDistrict, progress)
43
  if ( %CurrentType ) {
44
    var %CurrentProgress $remove($calc($replace(%CurrentProgress,/,-)),-)
45
    if ( Version 2.0 isin %CurrentType ) { 
46
      var %CurrentType $remove(%CurrentType,Version 2.0 $+ $chr(32))
47
      var %CurrentSpecial 2.0
48
    }
49
    elseif ( Skelecogs isin %CurrentType ) {
50
      var %CurrentType $remove(%CurrentType,$chr(32) $+ (Skelecogs))
51
      var %CurrentSpecial Skelecogs
52
    }
53
    if ( %CurrentType isin %invSellbots ) { var %CurrentColor 5 }
54
    elseif ( %CurrentType isin %invCashbots ) { var %CurrentColor 3 }
55
    elseif ( %CurrentType isin %invLawbots ) { var %CurrentColor 2 }
56
    elseif ( %CurrentType isin %invBossbots ) { var %CurrentColor 7 }
57
    if ( Mover*Shaker iswm %CurrentType ) { var %CurrentType2 Movers and Shakers | var %CurrentColor 5 }
58
    elseif ( %CurrentType == Flunky ) { var %CurrentType2 Flunkies }
59
    elseif ( %CurrentType == Yesman ) { var %CurrentType2 Yesmen }
60
    elseif ( %CurrentType == Money Bags ) { var %CurrentType2 %CurrentType }
61
    else { var %CurrentType2 %CurrentType $+ s }
62
    if ( !%InvSaidYet ) {
63
      var %InvSaidYet 1
64
      echo -at <HeadHunter> Here are the current invasions!
65
    }
66
    if ( %CurrentProgress == 1000000 ) {
67
      if ( !%CurrentSpecial ) { echo -at <HeadHunter> Watch out, there's a Mega Invasion! %CurrentColor $+ %CurrentType2 have taken over  $+ %CurrentDistrict $+ ! $read(invmessages.txt) }
68
      elseif ( %CurrentSpecial == Skelecogs ) { echo -at <HeadHunter> Watch out, there's a Mega Invasion!14 %CurrentType Skelecogs have taken over  $+ %CurrentDistrict $+ ! $read(invmessages.txt) }
69
      elseif ( %CurrentSpecial == 2.0 echo -at <HeadHunter> Watch out, there's a Mega Invasion! %CurrentColor %+ Version 2.0 %CurrentType2 have taken over  $+ %CurrentDistrict $+ ! $read(invmessages.txt) )
70
    }
71
    elseif ( %CurrentSpecial == Skelecogs ) { echo -at <HeadHunter> Looks like there are 14 $+ %CurrentType Skelecogs invading  $+ %CurrentDistrict $+ ! There are %CurrentProgress of them left! $read(invmessages.txt) }
72
    elseif ( %CurrentSpecial == 2.0 ) { echo -at <HeadHunter> Watch out, there are %CurrentColor $+ Version 2.0 %CurrentType2 invading  $+ %CurrentDistrict $+ ! There are %CurrentProgress of them left! $read(invmessages.txt) }
73
    else { echo -at <HeadHunter> Looks like there are %CurrentColor $+ %CurrentType2 invading  $+ %CurrentDistrict $+ ! There are %CurrentProgress of them left! $read(invmessages.txt) }
74
  }
75
  goto ds
76
  :ads
77
  if ( !%InvSaidYet ) {
78
    echo -at <HeadHunter> Looks like there are currently no invasions! Toontown is safe!
79
  }
80
}
81
;That's the end of my part of the script. Now begins Hawkee's JSON for mIRC script.
82
83
alias JSONVersion {
84
  if ($isid) {
85
    return $iif($1 != short,JSONForMirc v,v) $+ 0.2.4
86
  }
87
}
88
alias JSONError {
89
  if ($isid) {
90
    return %JSONError 
91
  }
92
}