Its second time reviewers declined my upload, so i decided to share it with you to make it better and useful for cs2d coding, uploaded file adress : Jet Script.
Jet Script Code
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
-- initial # Start ---------------------------- if Jet == nil then Jet = {} end Jet.Scripts = {} Jet.Aargs = {} Jet.Counter = {} Jet.Cache = {} Jet.Ui = {} Jet.Ui.Paint = {} Jet.Ui.Shapes = {} Jet.Ui.Hats = {} -- initial # End ------------------------------ -- Customize # Start ---------------------------- Hooks_Identifier = '#' Hooks_Finisher = 'endhook' -- Customize # Start ---------------------------- -- PreFunctions # Start ---------------------- function initArray(m) local array={} for i=1, m do array[i]=0 end return array end function open_file(path) 	local open = io.open local file = open(path, "rb") -- r read mode and b binary mode if not file then return nil end local content = file:read "*a" -- *a or *all reads the whole file file:close() return content end function save_file(data,path) 	io.output(io.open(path,"w+")) 	local sv = io.write(data) 	io.close() 	return sv end function csplit(inputstr, sep) if sep == nil then sep = "%s" end local t={} ; i=1 for str in string.gmatch(inputstr, "([^"..sep.."]+)") do t[i] = str i = i + 1 end return t end function findnth(str, pat) local array = {} for i in string.gmatch(str, pat) do table.insert(array, i) end return array end function string.replace(text, old, new) local b,e = text:find(old,1,true) if b==nil then return text else return text:sub(1,b-1) .. new .. text:sub(e+1) end end function getParams(hook) -- You Can Customize This Part And Set Variables Name What You Want ! ret = nil if (hook == 'always') then ret = '' end if (hook == 'attack') then ret = 'id' end if (hook == 'attack2') then ret = 'id,mode' end if (hook == 'bombdefuse') then ret = 'id' end if (hook == 'bombexplode') then ret = 'id,x,y' end if (hook == 'bombplant') then ret = 'id,x,y' end if (hook == 'break') then ret = 'x,y,player' end if (hook == 'build') then ret = 'id,type,x,y,mode,objectid' end if (hook == 'buildattempt') then ret = 'id,type,x,y,mode' end if (hook == 'buy') then ret = 'id,weapon' end if (hook == 'clientdata') then ret = 'id,mode,data1,data2' end if (hook == 'collect') then ret = 'id,iid,type,ain,a,mode' end if (hook == 'die') then ret = 'victim,killer,weapon,x,y,killerobjectid' end if (hook == 'dominate') then ret = 'id,team,x,y' end if (hook == 'drop') then ret = 'id,iid,type,ain,a,mode,x,y' end if (hook == 'endround') then ret = 'mode' end if (hook == 'flagcapture') then ret = 'id,team,x,y' end if (hook == 'flagtake') then ret = 'id,team,x,y' end if (hook == 'flashlight') then ret = 'id,state' end if (hook == 'hit') then ret = 'id,source,weapon,hpdmg,apdmg,rawdmg,objectid' end if (hook == 'hitzone') then ret = 'imageid,playerid,objectid,weapon,impactx,impacty,damage' end if (hook == 'hostagerescue') then ret = 'id,x,y' end if (hook == 'join') then ret = 'id' end if (hook == 'kill') then ret = 'killer,victim,weapon,x,y,killerobjectid' end if (hook == 'leave') then ret = 'id,reason' end if (hook == 'log') then ret = 'text' end if (hook == 'mapchange') then ret = 'newmap' end if (hook == 'menu') then ret = 'id,title,button' end if (hook == 'minute') then ret = '' end if (hook == 'move') then ret = 'id,x,y,walk' end if (hook == 'movetile') then ret = 'id,x,y' end if (hook == 'ms100') then ret = '' end if (hook == 'name') then ret = 'id,oldname,newname,forced' end if (hook == 'objectdamage') then ret = 'id,damage,player' end if (hook == 'objectkill') then ret = 'id,player' end if (hook == 'objectupgrade') then ret = 'id,player,progress,total' end if (hook == 'parse') then ret = 'text' end if (hook == 'projectile') then ret = 'id,weapon,x,y' end if (hook == 'radio') then ret = 'id,message' end if (hook == 'rcon') then ret = 'cmds,id,ip,port' end if (hook == 'reload') then ret = 'id,mode' end if (hook == 'say') then ret = 'id,message' end if (hook == 'sayteam') then ret = 'id,message' end if (hook == 'second') then ret = '' end if (hook == 'select') then ret = 'id,type,mode' end if (hook == 'serveraction') then ret = 'id,action' end if (hook == 'shieldhit') then ret = 'id,source,weapon,attackdirection,attackerobjectid' end if (hook == 'shutdown') then ret = '' end if (hook == 'spawn') then ret = 'id' end if (hook == 'specswitch') then ret = 'id,target' end if (hook == 'spray') then ret = 'id' end if (hook == 'startround') then ret = 'mode' end if (hook == 'startround_prespawn') then ret = 'mode' end if (hook == 'suicide') then ret = '' end if (hook == 'team') then ret = 'id,team,look' end if (hook == 'trigger') then ret = 'trigger,source' end if (hook == 'triggerentity') then ret = 'x,y' end if (hook == 'use') then ret = 'id,event,data,x,y' end if (hook == 'usebutton') then ret = 'id,x,y' end if (hook == 'vipescape') then ret = 'id,x,y' end if (hook == 'vote') then ret = 'id,mode,param' end if (hook == 'walkover') then ret = 'id,iid,type,ain,a,mode' end return ret end -- PreFunctions # End ------------------------- -- Jet Scripting Function Start -------------- function Jread(jet_script) print("\169046204113[-] Powered By Jet Script") JetS = csplit(jet_script,Hooks_Identifier) for _,Hook in pairs(JetS) do if (csplit(Hook,'%s')[2] ~= nil) then local Hook_Script = string.match(Hook , "%w+%s+(.-)"..Hooks_Finisher) ------------------------------------------------------------------------------------ local Hook_Call = string.match(Hook , "(.*)%s") --| Ready Name And Arguments For Analyze + Hook_Call = string.gsub(Hook_Call, "%s+", " ") --| ------------------------------------------------------------------------------------ local Hook_Name = csplit(Hook_Call,' ')[1] if (Jet.Scripts[Hook_Name] == nil) then Jet.Scripts[Hook_Name] = '' end if (string.find(Hook_Call, "%[") ~= nil) then Hook_Args = string.match(Hook_Call , "%[(.*)%]") end ------------------------------------------------------------------------------------ local InStringVars = findnth(Hook_Script,'%$([a-zA-Z.]+)') --| Jet Variables + for _,InStringVar in pairs(InStringVars) do --| Hook_Script = Hook_Script:gsub("%$"..InStringVar, '"..'..InStringVar..'.."') --| end --| ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------ local Colors = findnth(Hook_Script,'-(%d%d%d%d%d%d%d%d%d)') --| Jet Color + for _,Color in pairs(Colors) do --| Hook_Script = Hook_Script:gsub("-"..Color, '\169'..Color) --| end --| ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------ local Menus = findnth(Hook_Script,'%(%((.-)%)%)') --| Jet Menu + for _,Menu in pairs(Menus) do --| Hook_Script = Hook_Script:replace("(("..Menu.."))", "menu("..Menu..")") --| end --| ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------ local Prints = findnth(Hook_Script,'>>(.-)<<') --| Jet Print + for _,Print in pairs(Prints) do --| Hook_Script = Hook_Script:replace(">>"..Print.."<", "print("..Print..")") --| end --| ------------------------------------------------------------------------------------ Hook_Script = Hook_Script:gsub("@%(", "Jparse(") if (Hook_Name ~= 'initial') then Func_Out = ' '..Hook_Script Jet.Scripts[Hook_Name] = Func_Out..' '..Jet.Scripts[Hook_Name] Jet.Aargs[Hook_Name] = Hook_Args else Jet.Scripts[Hook_Name] = Hook_Script..' '..Jet.Scripts[Hook_Name] end end end for Hook,Jet_Script in pairs(Jet.Scripts) do if (Hook ~= 'initial') then addhook(Hook,'On_'..Hook) end if (Jet_Script ~= '') then if (Hook ~='initial') then Jet_Script = 'function '..'On_'..Hook..'('..getParams(Hook)..')'..Jet_Script..' end' end func = loadstring(Jet_Script) print(func()) --print('\169255255255------------------------------------------') --print(Jet_Script) --print('\169255255255------------------------------------------') end end end function Jreset() ------------------------------------------------- Jet.Scripts = {} --| Reset Jet Script + ------------------------------------------------- end function Jreload(jet_file) ------------------------------------------------- Jreset() --| Jrun(jet_file) --| Reload Jet Script + ------------------------------------------------- end function Jrun(jet_file) Jet.Cache.LastPath = jet_file ------------------------------------------------- local JetS = open_file(jet_file) --| local Intact = JetS --| Read Hooks + ------------------------------------------------- Jread(JetS) -- Run Script end -- Jet Scripting Function End --------- -- Muti Parse Script Start ------------ function Jparse(...) local cmds = {...} for i, cmd in ipairs(cmds) do parse(cmd) end end -- Muti Parse Script End -------------- -- Jet Plugin Script Start ------------ function Plugin(...) local args = {...} local Plugin for i, arg in ipairs(args) do if (i == 1) then ------------------------------------------------------------------------------ Plugin = open_file('sys/lua/Jets/Plugins/'..arg..'.plg.lua') --| Read Plugin + ------------------------------------------------------------------------------ else local n = i - 1 Plugin = Plugin:replace("$"..n,arg) end end --print(Plugin) Jread(Plugin) end -- Jet Plugin Script End -------------- -- Ui Script Start -------------------- function Jet.Ui.Clear(name) ------------------------------------------------------------------------------ if (Jet.Ui.Shapes[name] ~= nil) then freeimage(Jet.Ui.Shapes[name][1]) end --| Reset if (Jet.Ui.Shapes[name] ~= nil) then freeimage(Jet.Ui.Shapes[name][2]) end --| ------------------------------------------------------------------------------ Jet.Ui.Shapes[name] = nil end function Jet.Ui.Paint.Rec(name,color,x,y,width,height,border,bcolor,op) Jet.Ui.Clear(name) -------------------------------- op = op or 1 --| Ui Set Defaults bcolor = bcolor or '0,0,0' --| border = border or 0 --| -------------------------------- local X_pos = {} local Y_pos = {} Jet.Ui.Shapes[name] = {} local Inner_Offset = border X_pos[1] = x + (width / 2) Y_pos[1] = y + (height / 2) X_pos[2] = x + (width / 2) Y_pos[2] = y + (height / 2) local Inner_Width = width - (2 * Inner_Offset) local Inner_Height = height - (2 * Inner_Offset) Jet.Ui.Shapes[name][1] = image("gfx/Jet.Ui/Shapes/Cell.bmp",X_pos[1],Y_pos[1],2) Jet.Ui.Shapes[name][2] = image("gfx/Jet.Ui/Shapes/Cell.bmp",X_pos[2],Y_pos[2],2) imagescale(Jet.Ui.Shapes[name][1],width,height) imagescale(Jet.Ui.Shapes[name][2],Inner_Width,Inner_Height) local Rgb = csplit(bcolor,',') imagecolor(Jet.Ui.Shapes[name][1],Rgb[1],Rgb[2],Rgb[3]) Rgb = csplit(color,',') imagecolor(Jet.Ui.Shapes[name][2],Rgb[1],Rgb[2],Rgb[3]) imagealpha(Jet.Ui.Shapes[name][1],op) imagealpha(Jet.Ui.Shapes[name][2],op) return Jet.Ui.Shapes[name] end function Jet.Ui.Paint.Cir(name,color,x,y,width,height,border,bcolor,op) Jet.Ui.Clear(name) -------------------------------- op = op or 1 --| Ui Set Defaults bcolor = bcolor or '0,0,0' --| border = border or 0 --| -------------------------------- local X_pos = {} local Y_pos = {} Jet.Ui.Shapes[name] = {} local Inner_Offset = border X_pos[1] = x + (width / 2) Y_pos[1] = y + (height / 2) X_pos[2] = x + (width / 2) Y_pos[2] = y + (height / 2) local Inner_Width = (width - 2 * Inner_Offset) / 300 local Inner_Height = (height - 2 * Inner_Offset) / 300 width = (width / 300) height = (height / 300) Jet.Ui.Shapes[name][1] = image("gfx/Jet.Ui/Shapes/Circ.png",X_pos[1],Y_pos[1],2) Jet.Ui.Shapes[name][2] = image("gfx/Jet.Ui/Shapes/Circ.png",X_pos[2],Y_pos[2],2) imagescale(Jet.Ui.Shapes[name][1],width,height) imagescale(Jet.Ui.Shapes[name][2],Inner_Width,Inner_Height) local Rgb = csplit(bcolor,',') imagecolor(Jet.Ui.Shapes[name][1],Rgb[1],Rgb[2],Rgb[3]) Rgb = csplit(color,',') imagecolor(Jet.Ui.Shapes[name][2],Rgb[1],Rgb[2],Rgb[3]) imagealpha(Jet.Ui.Shapes[name][1],op) imagealpha(Jet.Ui.Shapes[name][2],op) return Jet.Ui.Shapes[name] end --[[ function Jet.Ui.Progress(name,color1,color2,x,y,width,height,border) local X_pos = x + (width / 2) local Y_pos = y + (height / 2) Jet.Ui.Paint.Rec(name..'_I',color1,x,y,width,height) Jet.Ui.Paint.Rec(name..'_II',color2,x+1,y+1,width-2,height-2) end ]] -- Hat Script Start ------------------- function Jet.Ui.SetHat(id,name,ext) ext = ext or '.png' if (Jet.Ui.Hats[id] ~= nil) then freeimage(Jet.Ui.Hats[id]) end if (Jet.Ui.Hats[id] ~= nil) then Jet.Ui.Hats[id] = nil end Jet.Ui.Hats[id] = image("gfx/Jet.Ui/Stuff/Hats/"..name..ext,1,1,200+id) return Jet.Ui.Hats[id] end function Jet.Ui.RemoveHat(id) if (Jet.Ui.Hats[id] ~= nil) then freeimage(Jet.Ui.Hats[id]) end if (Jet.Ui.Hats[id] ~= nil) then Jet.Ui.Hats[id] = nil end end -- Hat Script End --------------------- --Jet.Ui.Paint.Rec('myshape','255,255,255',110,110,32,32,1,'0,255,0',1) --Jet.Ui.Paint.Cir('myshape','255,255,255',0,0,32,32,1,'255,0,0',1) --Jet.Ui.Paint.Rec('myshape','0,0,0',0,0,850,480,0,'0,0,0',0.5) -- Ui Script End ---------------------- --Jrun('sys/lua/Jets/classes.jet.lua') --Plugin('DayNight',0.8,0,0.001) --Plugin('AdminCmds','160368,120354') -- Lua by _3yrus - 2017 -- Version 1.0.0
please just tell your idea for making this better. if its needed i completely change the code.
think of it , easy hooks, plugins , switching code without restart , custom hooks(to do), it would be great. maybe this project is bigger than I can do alone, so i need you.
i just want cs2d to advance, nothing else, so help me with this.
thanks in advance
edited 12×, last 01.08.17 01:37:08 pm