• Print

Author Topic: ULXv2 Cleaner  (Read 18447 times)

0 Members and 1 Guest are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
ULXv2 Cleaner
« on: September 02, 2006, 12:34:37 pm »
This is the same as my other cleaning script, but converted to work with ULX v2.

--Original Thread--

Since no others worked for me, I made this. It cleans the server really.
Say 'ulx clean' or !clean to delete everything in the server
Say a keyword after 'ulx clean' to clean just that thing.

'ulx clean' ragdolls will remove all ragdolls

If you forget a type, just say !clean help and it will show you ingame.

Keywords:

NPCs
Ragdolls
Effects
Props
Balloons
Thrusters
Ropes
Emitters
Flares
Flames
Dynamite
Vehicles
Sparks
Wheels
Decals
Welds
Ballsockets
Sliders
Lamps
Magnets
Help - Shows the help + types

Version 2:
Now removes:
Wheels
Decals
Welds
Ballsockets
Sliders
Lamps
Magnets

Version 3:
Converted to ULX v2
Removes cannisters

http://ulyssesmod.net/gd/cleaner2.html
« Last Edit: December 18, 2006, 07:01:33 pm by Golden-Death »


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULXv2 Cleaner
« Reply #1 on: September 02, 2006, 06:30:48 pm »
Hey GD. Great!
The concommand help in the script, and the text you posted on how to use, both say the underscore/line "_" is needed.
Would it not be "ulx clean blah" now?
I'll test if I get a chance.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: ULXv2 Cleaner
« Reply #2 on: September 02, 2006, 06:38:55 pm »
Whoops, sorry yeah theres a space.


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULXv2 Cleaner
« Reply #3 on: September 02, 2006, 06:54:07 pm »
I make the suggestion that in a future version it default to showing the help instead of defaulting to 'all' when nothing else is typed after "ulx clean". :)
 I only made the mistake once, but had other admins new to the command do the same, remove all items when expecting the help to show.
 
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: ULXv2 Cleaner
« Reply #4 on: September 02, 2006, 06:56:05 pm »
Code: Lua
  1.  
  2. --Original script and conversion to ULX v2 by Golden-Death--
  3.  
  4. assert( _file.Exists( "lua/ULib/init.lua" ), "ULX Cleaner needs ULib to run!" )
  5. _OpenScript( "ULib/init.lua" )
  6. assert( ULib.VERSION >= 1, "ULX Cleaner requires ULib version 1 or higher to run!" )
  7.  
  8. function cc_ulxClean( userid, args, argv, argc )
  9. adminnamer = _PlayerInfo(userid, "name")
  10. if argv[1] == "all" then
  11. _ServerCommand("ent_remove_all prop_physics\n")
  12. _ServerCommand("ent_remove_all physics_balloon\n")
  13. _ServerCommand("ent_remove_all physics_thruster\n")
  14. _ServerCommand("ent_remove_all prop_placement\n")
  15. _ServerCommand("ent_remove_all prop_ragdoll\n")
  16. _ServerCommand("ent_remove_all hl2mp_ragdoll\n")
  17. _ServerCommand("ent_remove_all func_physbox\n")
  18. _ServerCommand("ent_remove_all keyframe_rope\n")
  19. _ServerCommand("ent_remove_all prop_emitter\n")
  20. _ServerCommand("ent_remove_all env_flare\n")
  21. _ServerCommand("ent_remove_all entityflame\n")
  22. _ServerCommand("ent_remove_all prop_timedexplosion\n")
  23. _ServerCommand("ent_remove_all prop_vehicle_airboat\n")
  24. _ServerCommand("ent_remove_all prop_vehicle_jeep\n")
  25. _ServerCommand("ent_remove_all prop_vehicle_prisoner_pod\n")
  26. _ServerCommand("ent_remove_all env_spark\n")
  27. _ServerCommand("ent_remove_all prop_wheel\n")
  28. _ServerCommand("r_cleardecals\n")
  29. _ServerCommand("ent_remove_all phys_constraint\n")
  30. _ServerCommand("ent_remove_all phys_ballsocket\n")
  31. _ServerCommand("ent_remove_all phys_slideconstraint\n")
  32. _ServerCommand("ent_remove_all prop_flashlight\n")
  33. _ServerCommand("ent_remove_all phys_magnet\n")
  34. _ServerCommand("ent_remove_all phys_lengthconstraint\n")
  35. _ServerCommand("ent_remove_all npc_combine\n")
  36. _ServerCommand("ent_remove_all npc_combine_p\n")
  37. _ServerCommand("ent_remove_all npc_combine_e\n")
  38. _ServerCommand("ent_remove_all npc_metropolice\n")             
  39. _ServerCommand("ent_remove_all npc_monk\n")
  40. _ServerCommand("ent_remove_all npc_alyx\n")
  41. _ServerCommand("ent_remove_all npc_barney\n")
  42. _ServerCommand("ent_remove_all npc_citizen\n")
  43. _ServerCommand("ent_remove_all npc_citizen_refugee\n")                 
  44. _ServerCommand("ent_remove_all npc_citizen_rebel\n")                   
  45. _ServerCommand("ent_remove_all npc_vortigaunt\n")              
  46. _ServerCommand("ent_remove_all npc_dog_play\n")
  47. _ServerCommand("ent_remove_all npc_antlion\n")
  48. _ServerCommand("ent_remove_all npc_antlionguard\n")                    
  49. _ServerCommand("ent_remove_all npc_poisonzombie\n")                    
  50. _ServerCommand("ent_remove_all npc_fastzombie\n")              
  51. _ServerCommand("ent_remove_all npc_zombie\n")
  52. _ServerCommand("ent_remove_all npc_zombie_torso\n")                    
  53. _ServerCommand("ent_remove_all npc_headcrab\n")
  54. _ServerCommand("ent_remove_all npc_headcrab_black\n")                  
  55. _ServerCommand("ent_remove_all npc_headcrab_fast\n")                   
  56. _ServerCommand("ent_remove_all npc_headcrab_poison\n")                 
  57. _ServerCommand("ent_remove_all npc_manhack\n")
  58. _ServerCommand("ent_remove_all npc_cscanner\n")
  59. _ServerCommand("ent_remove_all npc_sscanner\n")
  60. _ServerCommand("ent_remove_all npc_turret_floor\n")                    
  61. _ServerCommand("ent_remove_all npc_crow\n")
  62. _ServerCommand("ent_remove_all npc_pigeon\n")
  63. _ServerCommand("ent_remove_all npc_seagull\n")
  64. _ServerCommand("ent_remove_all npc_rollermine\n")              
  65. _ServerCommand("ent_remove_all npc_barnacle\n")
  66. _ServerCommand("ent_remove_all npc_breen\n")
  67. _ServerCommand("ent_remove_all npc_combinedropship\n")                 
  68. _ServerCommand("ent_remove_all npc_combinegunship\n")                  
  69. _ServerCommand("ent_remove_all npc_eli\n")
  70. _ServerCommand("ent_remove_all npc_gman\n")    
  71. _ServerCommand("ent_remove_all npc_helicopter\n")              
  72. _ServerCommand("ent_remove_all npc_kleiner\n")
  73. _ServerCommand("ent_remove_all npc_mossman\n")
  74. _ServerCommand("ent_remove_all npc_stalker\n")
  75. _ServerCommand("ent_remove_all npc_strider\n")
  76. _ServerCommand("ent_remove_all npc_vortigaunt\n")      
  77. _ServerCommand("ent_remove_all npc_dog\n")
  78. _ServerCommand("ent_remove_all npc_thumper\n")         
  79. _ServerCommand("ent_remove_all npc_grenade_frag\n")    
  80. _ServerCommand("ent_remove_all npc_satchel\n")
  81. _ServerCommand("ent_remove_all npc_thumper\n")
  82. _ServerCommand("ent_remove_all npc_tripmine\n")
  83. _ServerCommand("ent_remove_all npc_hopper\n")
  84. _ServerCommand("ent_remove_all npc_sniper\n")
  85. _ServerCommand("ent_remove_all npc_ichthyosaur\n")             
  86. _ServerCommand("ent_remove_all npc_combine_camera\n")          
  87. _ServerCommand("ent_remove_all physics_cannister\n")
  88. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Everything removed")
  89. return
  90. end
  91.  
  92. if argv[1] == "npcs" then
  93. _ServerCommand("ent_remove_all npc_combine\n")
  94. _ServerCommand("ent_remove_all npc_combine_p\n")
  95. _ServerCommand("ent_remove_all npc_combine_e\n")
  96. _ServerCommand("ent_remove_all npc_metropolice\n")             
  97. _ServerCommand("ent_remove_all npc_monk\n")
  98. _ServerCommand("ent_remove_all npc_alyx\n")
  99. _ServerCommand("ent_remove_all npc_barney\n")
  100. _ServerCommand("ent_remove_all npc_citizen\n")
  101. _ServerCommand("ent_remove_all npc_citizen_refugee\n")                 
  102. _ServerCommand("ent_remove_all npc_citizen_rebel\n")                   
  103. _ServerCommand("ent_remove_all npc_vortigaunt\n")              
  104. _ServerCommand("ent_remove_all npc_dog_play\n")
  105. _ServerCommand("ent_remove_all npc_antlion\n")
  106. _ServerCommand("ent_remove_all npc_antlionguard\n")                    
  107. _ServerCommand("ent_remove_all npc_poisonzombie\n")                    
  108. _ServerCommand("ent_remove_all npc_fastzombie\n")              
  109. _ServerCommand("ent_remove_all npc_zombie\n")
  110. _ServerCommand("ent_remove_all npc_zombie_torso\n")                    
  111. _ServerCommand("ent_remove_all npc_headcrab\n")
  112. _ServerCommand("ent_remove_all npc_headcrab_black\n")                  
  113. _ServerCommand("ent_remove_all npc_headcrab_fast\n")                   
  114. _ServerCommand("ent_remove_all npc_headcrab_poison\n")                 
  115. _ServerCommand("ent_remove_all npc_manhack\n")
  116. _ServerCommand("ent_remove_all npc_cscanner\n")
  117. _ServerCommand("ent_remove_all npc_sscanner\n")
  118. _ServerCommand("ent_remove_all npc_turret_floor\n")                    
  119. _ServerCommand("ent_remove_all npc_crow\n")
  120. _ServerCommand("ent_remove_all npc_pigeon\n")
  121. _ServerCommand("ent_remove_all npc_seagull\n")
  122. _ServerCommand("ent_remove_all npc_rollermine\n")              
  123. _ServerCommand("ent_remove_all npc_barnacle\n")
  124. _ServerCommand("ent_remove_all npc_breen\n")
  125. _ServerCommand("ent_remove_all npc_combinedropship\n")                 
  126. _ServerCommand("ent_remove_all npc_combinegunship\n")                  
  127. _ServerCommand("ent_remove_all npc_eli\n")
  128. _ServerCommand("ent_remove_all npc_gman\n")    
  129. _ServerCommand("ent_remove_all npc_helicopter\n")              
  130. _ServerCommand("ent_remove_all npc_kleiner\n")
  131. _ServerCommand("ent_remove_all npc_mossman\n")
  132. _ServerCommand("ent_remove_all npc_stalker\n")
  133. _ServerCommand("ent_remove_all npc_strider\n")
  134. _ServerCommand("ent_remove_all npc_vortigaunt\n")      
  135. _ServerCommand("ent_remove_all npc_dog\n")
  136. _ServerCommand("ent_remove_all npc_thumper\n")         
  137. _ServerCommand("ent_remove_all npc_grenade_frag\n")    
  138. _ServerCommand("ent_remove_all npc_satchel\n")
  139. _ServerCommand("ent_remove_all npc_thumper\n")
  140. _ServerCommand("ent_remove_all npc_tripmine\n")
  141. _ServerCommand("ent_remove_all npc_hopper\n")
  142. _ServerCommand("ent_remove_all npc_sniper\n")
  143. _ServerCommand("ent_remove_all npc_ichthyosaur\n")             
  144. _ServerCommand("ent_remove_all npc_combine_camera\n")  
  145. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - NPCs removed")    
  146. return
  147. end
  148.  
  149. if argv[1] == "ragdolls" then
  150. _ServerCommand("ent_remove_all prop_ragdoll\n")
  151. _ServerCommand("ent_remove_all hl2mp_ragdoll\n")
  152. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Ragdolls removed")
  153. return
  154. end
  155.  
  156. if argv[1] == "effects" then
  157. _ServerCommand("ent_remove_all prop_placement\n")
  158. _ServerCommand("ent_remove_all physics_cannister\n")
  159. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Effects removed")
  160. return
  161. end
  162.  
  163. if argv[1] == "props" then
  164. _ServerCommand("ent_remove_all prop_physics\n")
  165. _ServerCommand("ent_remove_all func_physbox\n")
  166. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Props removed")
  167. return
  168. end
  169.  
  170. if argv[1] == "balloons" then
  171. _ServerCommand("ent_remove_all physics_balloon\n")
  172. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Balloons removed")
  173. return
  174. end
  175.  
  176. if argv[1] == "thrusters" then
  177. _ServerCommand("ent_remove_all physics_thruster\n")
  178. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Thrusters removed")
  179. return
  180. end
  181.  
  182. if argv[1] == "ropes" then
  183. _ServerCommand("ent_remove_all keyframe_rope\n")
  184. _ServerCommand("ent_remove_all phys_lengthconstraint\n")
  185. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Ropes removed")
  186. return
  187. end
  188.  
  189. if argv[1] == "emitters" then
  190. _ServerCommand("ent_remove_all prop_emitter\n")
  191. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Emitters removed")
  192. return
  193. end
  194.  
  195. if argv[1] == "flares" then
  196. _ServerCommand("ent_remove_all env_flare\n")
  197. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Flares removed")
  198. return
  199. end
  200.  
  201. if argv[1] == "flames" then
  202. _ServerCommand("ent_remove_all entityflame\n")
  203. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Flames removed")
  204. return
  205. end
  206.  
  207. if argv[1] == "dynamite" then
  208. _ServerCommand("ent_remove_all prop_timedexplosion\n")
  209. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Dynamite removed")
  210. return
  211. end
  212.  
  213. if argv[1] == "vehicles" then
  214. _ServerCommand("ent_remove_all prop_vehicle_airboat\n")
  215. _ServerCommand("ent_remove_all prop_vehicle_jeep\n")
  216. _ServerCommand("ent_remove_all prop_vehicle_prisoner_pod\n")
  217. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Vehicles removed")
  218. return
  219. end
  220.  
  221. if argv[1] == "sparks" then
  222. _ServerCommand("ent_remove_all env_spark\n")
  223. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Sparks removed")
  224. return
  225. end
  226.  
  227. if argv[1] == "wheels" then
  228. _ServerCommand("ent_remove_all prop_wheel\n")
  229. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Wheels removed")
  230. return
  231. end
  232.  
  233. if argv[1] == "decals" then
  234. _ServerCommand("r_cleardecals\n")
  235. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Decals removed")
  236. return
  237. end
  238.  
  239. if argv[1] == "welds" then
  240. _ServerCommand("ent_remove_all phys_constraint\n")
  241. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Welds removed")
  242. return
  243. end
  244.  
  245. if argv[1] == "ballsockets" then
  246. _ServerCommand("ent_remove_all phys_ballsocket\n")
  247. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Ballsockets removed")
  248. return
  249. end
  250.  
  251. if argv[1] == "sliders" then
  252. _ServerCommand("ent_remove_all phys_slideconstraint\n")
  253. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Sliders removed")
  254. return
  255. end
  256.  
  257. if argv[1] == "lamps" then
  258. _ServerCommand("ent_remove_all prop_flashlight\n")
  259. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Lamps removed")
  260. return
  261. end
  262.  
  263. if argv[1] == "magnets" then
  264. _ServerCommand("ent_remove_all phys_magnet\n")
  265. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Magnets removed")
  266. return
  267. end
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276. if argv[1] == "nill" then
  277. _PrintMessage(userid, HUD_PRINTTALK, "[Golden Remover] See console")
  278. _PrintMessage(userid, HUD_PRINTCONSOLE, "--------------\n")
  279. _PrintMessage(userid, HUD_PRINTCONSOLE, "Golden-Death's Multi-Purpose Remover\nYou may use these keywords after 'ulx clean' to remove that type of item\n")
  280.  
  281. _PrintMessage(userid, HUD_PRINTCONSOLE, "Type 'all' after 'ulx clean' to get rid of everything\nNPCs\nRagdolls\n")
  282. _PrintMessage(userid, HUD_PRINTCONSOLE, "Effects\nProps\nBalloons\nThrusters\nRopes\nEmitters\nFlares\nFlames\nDynamite\nVehicles\nSparks\n")
  283. _PrintMessage(userid, HUD_PRINTCONSOLE, "Wheels\nDecals\nWelds\nBallsockets\nSliders\nLamps\nMagnets\n------")
  284.  
  285. return
  286. end
  287.  
  288. _PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] Sorry, "..argv[1].." is not a valid type. Say !clean help for a list of types")
  289. return
  290. end
  291.  
  292.  
  293.  
  294. ULib.CONCOMMAND( "clean", cc_ulxClean, "Cleans up the server. ulx clean (type). Say !clean help for more info)", ACCESS_BAN, "!clean" )
  295.  
  296.  


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULXv2 Cleaner
« Reply #5 on: September 03, 2006, 07:28:16 am »
To simplify things for you, ULib has a removeAllEnts command. (This is what I'll be using for ULX v2.1's cleaners)
Experiencing God's grace one day at a time.

Offline andrejkw

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
Re: ULXv2 Cleaner
« Reply #6 on: September 04, 2006, 08:37:29 am »
Uhm, also...


ULib.CONCOMMAND( "clean", cc_ulxClean, "Cleans up the server. ulx clean (type). Say !clean help for more info)", ACCESS_BAN, "!clean" )

According to the documentation ULib.CONCOMMAND doesn't have that many parameters?  :P

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: ULXv2 Cleaner
« Reply #7 on: September 06, 2006, 08:49:42 pm »
As you can see from ULX here:
ulx.CONCOMMAND( "slap", ulx.cc_slap, "<user(s)> [<damage>] [<power>] - Slaps target(s) with given damage and power", ACCESS_SLAY, "!slap" )

It has (console cmd, function, description, access, say command)



Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULXv2 Cleaner
« Reply #8 on: September 06, 2006, 09:22:23 pm »
Bah, I need to add that to ULib... it just seems so limitting. (IE, where do I put the help it generates?)
Experiencing God's grace one day at a time.

Offline Brett900

  • Newbie
  • *
  • Posts: 44
  • Karma: -2
Re: ULXv2 Cleaner
« Reply #9 on: September 13, 2006, 09:09:17 am »
Were do you put the Ulx_Cleaner.lua File because i would love to have this on my server.  8)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULXv2 Cleaner
« Reply #10 on: September 13, 2006, 06:57:17 pm »
lua/init
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Brett900

  • Newbie
  • *
  • Posts: 44
  • Karma: -2
Re: ULXv2 Cleaner
« Reply #11 on: September 22, 2006, 10:05:55 pm »
Okay,thanks i will do that  ;D

  • Print