11
11
import sys
12
12
import struct
13
13
14
- VERSION = (0 , 3 , 1 )
14
+ VERSION = (0 , 3 , 2 )
15
15
16
16
class File ():
17
17
"""
@@ -164,6 +164,16 @@ def patch_realpaths(f, value):
164
164
f .patch (0x2118e8 , b"\x00 " )
165
165
f .patch (0x1f48c0 , b"\x00 " )
166
166
167
+ def patch_ads (f , value ):
168
+ if (len (value ) != 5 ):
169
+ tkinter .messagebox .showerror ("Ads error" , "The mod ID is invalid." )
170
+ return
171
+
172
+ value = value .encode ('utf-8' )
173
+
174
+ f .patch (0x2129a0 , b"http://smashhitlab.000webhostapp.com/\x00 " )
175
+ f .patch (0x2129c8 , b"ads.php?id=" + value + b"&x=\x00 " )
176
+
167
177
def patch_package (f , value ):
168
178
### This was the THIRD ATTEMPT to make it work.
169
179
# It works by chaining it on after luaopen_base
@@ -197,6 +207,7 @@ def patch_roomlength(f, value):
197
207
"seconds" : patch_seconds ,
198
208
"realpaths_segments" : patch_realpaths_segments ,
199
209
"realpaths" : patch_realpaths ,
210
+ "ads" : patch_ads ,
200
211
"package" : patch_package ,
201
212
"vertical" : patch_vertical ,
202
213
"roomlength" : patch_roomlength ,
@@ -322,6 +333,8 @@ def gui(default_path = None):
322
333
fov_val = w .textbox (True )
323
334
seconds = w .checkbox ("Set the room time in seconds to (float):" )
324
335
seconds_val = w .textbox (True )
336
+ ads = w .checkbox ("Enable the Ad Service using mod ID (5 char string):" )
337
+ ads_val = w .textbox (True )
325
338
realpaths_segments = w .checkbox ("Use absolute paths for segments" )
326
339
realpaths = w .checkbox ("Use absolute paths for rooms and levels" )
327
340
package = w .checkbox ("Load package, io and os modules in scripts" )
@@ -348,6 +361,8 @@ def x():
348
361
"hit_val" : hit_val .get (),
349
362
"seconds" : seconds .get (),
350
363
"seconds_val" : seconds_val .get (),
364
+ "ads" : ads .get (),
365
+ "ads_val" : ads_val .get (),
351
366
"realpaths_segments" : realpaths_segments .get (),
352
367
"realpaths" : realpaths .get (),
353
368
"package" : package .get (),
0 commit comments