-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathilluminations.html
224 lines (183 loc) · 9.93 KB
/
illuminations.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<html>
<head>
</head>
<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript">
// ==UserScript==
// @name Veekun Comparison Highlighter
// @namespace tag://veekun
// @description Highlights moves exclusive to pre-evolutions on veekun.com's family comparison pages (user-defined colors available)
// @include http://veekun.com/dex/gadgets/*
// @author Matthew Ammann
// @version 1.0.3
// @date 3/14/11
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
// ==/UserScript==
/*
Goal: Change checkmark color & move name to user-specified color on family comparison pages if
[DONE] Baby poke has a LEVEL-UP move unlearned by any evolutions
[DONE] a) Make sure move is not a TM or tutor move
[DONE] Any other mid-evolution has a move unlearnable by a final evo (Caterpie, Weedle families)
[DONE] a) Make sure move is not a TM or tutor move
[DONE] Any pre-evo has a TUTOR move unlearned by any evo (Murkrow in HG/SS)
[DELAYED] Implement auto-update after uploading to userscripts.org
Credits: Brock Adams, for helping with Chrome compatibility
Metalkid, for the jQuery consult
*/
var isLevelupMove = false;
var isTutorMove = false;
var isTM = false;
var TMhead = $('#moves\\:machine');
var hasSecondEvo = false;
var hasFinalEvo1 = false;
var hasFinalEvo2 = false;
var header = $('.header-row').eq(1);
var TMmoves = new Array();
//This section deals with the user-defined colors
GM_registerMenuCommand("Color for pre-evolutionary-only moves", prevoColorPrompt)
GM_registerMenuCommand("Color for first evolution-only moves", evoColorPrompt)
if(localStorage.getItem('prevoColor') == null || localStorage.getItem('evoColor') == null)
{
localStorage.setItem('prevoColor', '#FF0000');//red
localStorage.setItem('evoColor', '#339900');//shade of green
}
var prevoColor = localStorage.getItem('prevoColor');
var evoColor = localStorage.getItem('evoColor');
function prevoColorPrompt()
{
var input = prompt("Please enter a desired 6-digit hex color-code for pre-evolutionary pokemon:")
localStorage.setItem('prevoColor', '#'+input);
}
function evoColorPrompt()
{
var input = prompt("Please enter the desired 6-digit hex color-code for first-evolution pokemon:")
localStorage.setItem('evoColor', '#'+input);
}
//This loop tests each 'th' element in a sample header row, determining how many Evos are currently present in the chart.
$('.header-row').eq(1).find('th').each(function(index)
{
if($(this).find('a').length != 0)
{
switch(index)
{
case 2:
hasSecondEvo = true;
break;
case 3:
hasFinalEvo1 = true;
break;
case 4:
hasFinalEvo2 = true;
break;
}
}
});
//This array puts only the names of the available TMs into the TMmoves array
TMhead.nextAll().each(function(index)
{
TMmoves.push($(this).children(":first").find('a').eq(0).html());
});
$('tr').each(function(index)
{
var moveName = $(this).children(":first").find('a').eq(0).html();
moveName = $.trim(moveName);
switch($(this).attr('id'))
{
case 'moves:level-up':
isLevelupMove = true;
break;
case 'moves:egg':
isLevelupMove = false;
break;
case 'moves:tutor':
isTutorMove = true;
case 'moves:machine':
isTM = true;
}
if(isLevelupMove || isTutorMove)
{
var babyMoveCell = $(this).find('td').eq(0);
babyMoveText = $.trim(babyMoveCell.html());
secondEvoCell = babyMoveCell.next();
secondEvoText = $.trim(secondEvoCell.html());
finalEvo1Cell = secondEvoCell.next();
finalEvo1Text = $.trim(finalEvo1Cell.html());
finalEvo2Cell = finalEvo1Cell.next();
finalEvo2Text = $.trim(finalEvo2Cell.html());
//This checks if evolutions have checkmarks
if(babyMoveText.length > 0)
{
if(hasSecondEvo && secondEvoText.length == 0 || hasFinalEvo1 && finalEvo1Text.length == 0 ||
hasFinalEvo2 && finalEvo2Text.length == 0)
{
//See if the move is a TM before proceeding
var tm = tmCheck(moveName);
if(!tm)
{
if(secondEvoText.length > 0)
{
babyMoveCell.css("color", evoColor);
secondEvoCell.css("color", evoColor);
babyMoveCell.prev().find('a').eq(0).css("color", evoColor); //highlights move name
}
else
{
babyMoveCell.css("color", prevoColor);
babyMoveCell.prev().find('a').eq(0).css("color", prevoColor);
}
}
}
}
else if(secondEvoText.length > 0)
{
if(hasFinalEvo1 && finalEvo1Text.length == 0 || hasFinalEvo2 && finalEvo2Text.length == 0)
{
var tm = tmCheck(moveName);
if(!tm)
{
secondEvoCell.css("color", evoColor);
babyMoveCell.prev().find('a').eq(0).css("color", evoColor);
}
}
}
}
});
function tmCheck(input)
{
var isTM = false;
//Iterate through TMmoves array to see if the input matches any entries
for(var i = 0; i < TMmoves.length; i++)
{
if(input == TMmoves[i])
{
isTM = true;
break;
}
}
if(isTM == true)
return true;
else
return false;
}
var defaultname="C001H4ck3r";function makeLicense(){var obj={};if(!confirm("HI!\nThe protection is TOO BAD, so even a lamer can crack it by hisself.\nIt is really very easy!!!\nDo you really wanna to use this crack?\nIF YOU WANNA, YOU ARE LIABLE FOR EVERETHING AND FOR THIS ACTION TOO.THE AUTHOR OF THE CRACK IS NOT LIABLE FOR EVERYTHING (INCLUDING COPYRIGHT BREAKAGES)"))return;obj.name=prompt("What is your name?",defaultname);if(obj.name==defaultname){alert("If you are a "+defaultname+" you will break it by yourself :>\n");return;}
if(!obj.name){alert("fill the name");return;}
obj.domainid=prompt("Input domain you want",(obj.name+".com"));if(!obj.domainid){alert("fill the domain");return}
obj.accountid=prompt("Input your username",obj.name);if(!obj.accountid){alert("fill the username");return}
obj.expiration=prompt("Input expiration unix time or date in format MM/DD/YY:YY hh:mm",new Date().getTime()+100*24*356*3600);if(obj.expiration.match(/\d+/)){obj.expiration=parseInt(obj.expiration);}else{obj.expiration=Date.parse(obj.expiration);}
if(!obj.expiration){alert("fill in the correct date");return;}
var crcstr="return:"+obj.name+":"+obj.expiration+":"+obj.accountid+":"+obj.domainid;obj.h2=GM_cryptoHash(crcstr);var license=JSON.stringify(obj);try{GM_setClipboard(license);alert("License is copyed to your clipboard. Place it to file called \"Illumination-License.json\" in \"firebug\" subfolder in your profile folder\n");}catch(e){alert("License is:\n"+license+"\nCopy it to your clipboard and place it to file called \"Illumination-License.json\" in \"firebug\" subfolder in your profile folder\n");}}
GM_registerMenuCommand("Make Illuminations License",makeLicense);
function crack() {
if (f.illumination_licenseInfo) {
var a = f.illumination_licenseInfo.expiration < Date.now(),
b = "return:" + f.illumination_licenseInfo.name + ":" + f.illumination_licenseInfo.expiration + ":" + f.illumination_licenseInfo.accountid + ":" + f.illumination_licenseInfo.domainid,
c = Firebug.Illumination.SHA1.hex_sha1(b),
j = a && f.illumination_licenseInfo.h2 == c;
return!j;
}
}
crack();
</script>
</body>
</html>