Board index DeFRaG How to DeFRaG

Useful Scripts

Users helping users.

Re: Useful Scripts

Postby cmc » Sep 13th, '16, 9:25 pm

nLxajA wrote:I have the same problem with nervous :D and have nearly the same solution:
Code: Select all
bind kp_pgup vstr zm_1

seta zm_1 "cg_nochatbeep 1;df_hud_scoreboard_showSpectators 0;cg_lagometer 0;cg_drawcrosshairNames 0;df_mp_nodrawradius 10000;df_drawCheckpointStats 0;df_drawCheckpointEvents 0;echo ^7zadrot mode ^1ON;r_gamma 0.5;wait 30;r_gamma 0.6;wait 30;r_gamma 0.7;wait 30;r_gamma 0.8;wait 30;r_gamma 0.9;wait 30;r_gamma 1;con_notifytime -1;bind kp_pgup vstr zm_2"


That's hilarious -- I think I'm going to steal your 'zadrot mode'. I actually do have another series of binds for nochatbeep and notifytime; but it makes sense to combine them. Thx xaja!
cmc
 
Posts: 13
Joined: Dec 11th, '13, 10:17 pm

Re: Useful Scripts

Postby RaneFire » May 20th, '18, 6:54 pm

Savepos and restore pos timer reporting script:

Hey fellow defraggers. I made this script earlier this year (2018) to save myself some time in finding new routes, the purpose of which is testing changes to routes so I can see if they yield a faster or slower time. I have already used it to discover how some times were made, including bardok-w3sp (it's nice when the theoretical time closely resembles the record on the site), but of course... performing the full route in one go is much harder, especially when I suck.

If you're familiar with defrag, you can figure out how this works. Otherwise you can download the attachment with the readme file on how to use it (demos are included that were used in the readme examples, just a standard ST1 run at constant 320ups in a time of 20:800).

Code: Select all
//=====================================
//
//   Savepos Timer Reporting Script
//
//      Written by RaneFire
//
//=====================================

// Released for the betterment of the Defrag community.
// There are 6 key binds in this file. Rebind them as necessary.

echo "^6Savepos script loaded"

//=====================================
// Stoprecord and respawn.cfg recording
//=====================================

bind PGDN "stoprecord; df_script_onRespawn 0; echo ^3df_script_onRespawn ^10"
bind PGUP "df_script_onRespawn 1; echo ^3df_script_onRespawn ^11"

seta varspawn "vstr vs1"
seta vs1 "stoprecord; wait; record temp/respawn"


// See respawn.cfg, which contains only "vstr varspawn"


//================
// Savepos Script
//================

bind h "vstr vbindpos"      // Cycle current saveposname (pos1, pos2, pos3)
bind MOUSE5 "vstr vsavepos"   // Save current position and save timer
bind v "vstr vrestore"      // Restore to saved position and save timer
bind END "vstr sayrep"      // Report all saved times in chat and DO SOME MATH

seta saveposname "pos1"      // Default
seta vbindpos "vstr bindpos2"   // Default
seta vsavepos "vstr savepos1"   // Default
seta vrestore "vstr restore1"   // Default

seta bindpos1 "set saveposname pos1; set vsavepos vstr savepos1; set vrestore vstr restore1; set vbindpos vstr bindpos2; echo ^2Savepos working set: ^1pos1"
seta bindpos2 "set saveposname pos2; set vsavepos vstr savepos2; set vrestore vstr restore2; set vbindpos vstr bindpos3; echo ^2Savepos working set: ^1pos2"
seta bindpos3 "set saveposname pos3; set vsavepos vstr savepos3; set vrestore vstr restore3; set vbindpos vstr bindpos1; echo ^2Savepos working set: ^1pos3"

seta savepos1 "VarJoin user_savtime1 <0> $chsinfo(200); wait 4; savepos"
seta savepos2 "VarJoin user_savtime2 <0> $chsinfo(200); wait 4; savepos"
seta savepos3 "VarJoin user_savtime3 <0> $chsinfo(200); wait 4; savepos"

seta restore1 "stoprecord; record temp/restore_pos1; wait 10; vstr pos1; VarJoin user_restime1 <0> $chsinfo(200); vstr echopos1"
seta restore2 "stoprecord; record temp/restore_pos2; wait 10; vstr pos2; VarJoin user_restime2 <0> $chsinfo(200); vstr echopos2"
seta restore3 "stoprecord; record temp/restore_pos3; wait 10; vstr pos3; VarJoin user_restime3 <0> $chsinfo(200); vstr echopos3"

// Echo pos on restore command
seta echopos1 "VarCommand echo ^1<^2pos1 Timers^1> ^5Save:^3 $user_savtime1 ^4- ^5Restore:^3 $user_restime1"
seta echopos2 "VarCommand echo ^1<^2pos2 Timers^1> ^5Save:^3 $user_savtime2 ^4- ^5Restore:^3 $user_restime2"
seta echopos3 "VarCommand echo ^1<^2pos3 Timers^1> ^5Save:^3 $user_savtime3 ^4- ^5Restore:^3 $user_restime3"

// Say pos on timer report command
seta saypos1 "VarCommand say ^1<^2pos1 Timers^1> ^5Save:^3 $user_savtime1 ^4- ^5Restore:^3 $user_restime1"
seta saypos2 "VarCommand say ^1<^2pos2 Timers^1> ^5Save:^3 $user_savtime2 ^4- ^5Restore:^3 $user_restime2"
seta saypos3 "VarCommand say ^1<^2pos3 Timers^1> ^5Save:^3 $user_savtime3 ^4- ^5Restore:^3 $user_restime3"

// Savepos end of run timers (bind END "vstr echorep" to change to the other one)
seta echorep "vstr echopos1; vstr echopos2; vstr echopos3; VarCommand echo ^1<^2Finish Time^1> ^5Stop:^3 $chsinfo(200); echo ^6--- Savepos Timers Report ---"
seta sayrep "vstr saypos1; vstr saypos2; vstr saypos3; VarCommand say ^1<^2Finish Time^1> ^5Stop:^3 $chsinfo(200); say ^6--- Savepos Timers Report ---"

You do not have the required permissions to view the files attached to this post.
User avatar
RaneFire
 
Posts: 14
Joined: Oct 6th, '10, 5:52 pm

con_filters

Postby Le another black niger » Nov 8th, '20, 10:10 am

Tweaked and supplemented by idfe messages.
Image
Code: Select all
seta con_filter 1

con_filter0 "(?!.*( entered the game\.$| spectators\.$| connected$| renamed to ))(^\.\.\.|^(\.\.\.[\w\s]*?)?W?GL_|^OpenAL\s|^loaded\s|^-{3,7}[\w\s\(\)]{8,}-{3,7}?$|^-{0,40}-$|^[\w\s]{0,18}?Devices?:|^Hostname: |^  ALC? Ext|^Loading (vm|dll)|^File \x22vm|VM file |^\w*? loaded in |^\d* \w*s \w*d|^Opening IP|^Winsock |^Sound init|^WaveIn on|^Wave File|^DirectSound|^Allocated |^=+ \w+ =+$|^RE_Shut|^Hunk_|^PIXELFORMAT: |^MODE: -?\d|^GAMMA: |^rendering pr|^texturemode: |^picmip: |^texture bits: |^multitexture: |^compiled vertex |^texenv add: |^compressed tex|^Forcing gl|^\d+\.?\d* (shader|code|MB s|seconds|files in)|^gamename: |^gamedate: |^\d teams with|^stitched |^CL_InitCGame: |^Com_TouchMemory: |^\d+ msec to draw|resolved to \d+\.\d+\.\d+\.\d+\:\d+$|^Gametype chang|^defrag\/.*\.pk3$|^defrag\/.*\.pk3 \(lo|^\*+$|^Initializing |^CPU: Intel|^Current sea|^handle \d+|^Shader[\w\s]+mage$|^Server: [\w-_]+$|^Resolving\s)"

con_filter1 "(?!.*( entered the game\.$| spectators\.$| connected$| renamed to ))(^ERROR: (?!CL_ParseGamestate: bad command byte$)|^WARNING: |^Warning: |^Not found: demos|^Trying to load|^\w+ skin load failure: |^Failed to load (skin|dll|model)|^trying (textures|models|icons|levelshots|medal_)|You might not be able to join the game$|^Go to the setti|^ignoring |^(\s)+(JOY|AUX|WORLD)|(?!.*:)^\*.*'\.\.\.$|^\*+'\.\.\.$|\d.*MB @\d.*\dKB\/s \(\d.*\.\d.+\) time left\: .*\:\d\d$|^dropping sound|^Fatal.*aas$|^Fatal: aas file |^trying to load|^SDL using driver|^Using \d|^Available modes: |^FinishSpawningItem: |^VM_LoadD(ll|LL)|^Couldn't (?!resolve host name$)|^couldn't (?!exec)|^Restored: |^Issuing Command: |^Demo file: demos|(?!.*:)^\][^\\])"

con_filter2 "^Sound memory manager started$|^No background file\.$|^Using WASAPI subsystem$|^[A-Z0-9]+ dma buffer$|^\s*\d+ (speed|submission_chunk|samplebits \(float\)|samples|channels)$|^Com_sprintf: Output length 4096 too short|^Com_sprintf: overflow of \d+ in \d+$|^[\d\.]+ MB in memory data$|^\d+$|^Not recording a demo\.$|^SetDeviceGammaRamp failed\.$|^HACK: using vertex lightmap approximation$|^Shutting down OpenGL subsystem$|^Shader .+ has a stage with no image$|$Missing \{ in info file$|^VM_Restart\(\)$|^AAS initialized\.$|^AAS shutdown\.$|^found \d+ level items$|^\d+ pk3 files read$|^Autorecord: couldn't record from the beginning, please restart your run\.$|^Not logging to disk\.$|^noclip OFF$|^noclip ON$"

con_filter3 "(^([^:]* has random >= wait)$)|(^Can't use keys or values with a ("|\\|\w+)$)|(^untargeted \w+ at \(.*\)$)|(^func_train at \(.*\) with an unfound target$)|(^func_train without a target at \(.*\)$)|(^path_corner with no targetname at \(.*\)$)|(^Train corner at \(.*\) without a target path_corner$)|(^Error: file entdata, line \d+: )|^Invalid target was specified in multimanager$|^G_PickTarget called with NULL targetname$|^G_PickTarget: target .* not found$|^\w+ doesn't have a spawn function$|^MAX_PACKET_USERCMDS$|^Com_QueueEvent: overflow$|^Delta frame too old$|^Delta parseEntitiesNum too old\.$|^Delta from invalid frame \(not supposed to happen!\)$|^NET_SendPacket: NO ERROR$|^Bsp crc: missing local record$|^Cvar: (dmflags 0)|(pmove_msec 8)|(g_speed 320)|(g_gravity 800)|(g_knockback 1000)|(timescale 1\.00)|(sv_cheats 0)|(sv_fps 125)|(com_maxfps 125)$"

// this is disabled, data feels useful
con_filter4 "^$|^\d\d:\d\d:\d\d\s*$|(?!.*( entered the game\.$| spectators\.$| connected$| renamed to ))(^Dumped console text to |^execing |^Stopped demo\.$|^recording to |^Wrote screenshots|^Attempting download: |^Writing to: |^Download complete, restarting filesystem\.$|^Server motd: |^Cvar: df_promode (0|1)$|^Cvar: g_synchronousClients (0|1)$|^Cvar: pmove_fixed (0|1)$|^Server: timescaling reported$|^Server: fraglimit changed to \d+$|^godmode ON$|^godmode OFF$)"

con_filter4 ""

con_filter5 ""
con_filter6 ""
con_filter7 ""
con_filter8 ""
con_filter9 ""
con_filter10 ""
con_filter11 ""
con_filter12 ""
con_filter13 ""
con_filter14 ""
con_filter15 ""
con_filter16 ""
con_filter17 ""
con_filter18 ""
con_filter19 ""

//   https://regex101.com/
You do not have the required permissions to view the files attached to this post.
Le another black niger
 
Posts: 392
Joined: May 17th, '11, 5:08 pm

Re: Useful Scripts

Postby -O-Zeppelin » Jan 29th, '21, 3:57 pm

Drawing on ideas from this thread, and some of my own, I've put together an all-in-one set of .cfg files with the aim of extending defrag functionality, suited for beginners and experienced players alike: ZCFG. Features include:

  • Retry action selector (kill, placeplayer, placeplayer+autorecord, &c.)
  • Keybinds for controlling/toggling various HUD elements (CHS data sets, CGaz, miniview, &c.)
  • Miniview tracking selector (off/self/multiplayer/ghost)
  • HUD "silent mode" (hides timer notifications, chat, ghosts, & players)
  • n-slot savepos selector, with a bind to write savepos data to $mapname.cfg for reuse between sessions
  • Ghost hotkey (creates a stationary ghost for use as a camera or target)
  • Timescale & camera controls for demo review
  • Freestyle auto-record
  • Server hotkeys

Files included:
  • zcfg-auth.cfg - username & password for mDd server log-in
  • zcfg-cvars.cfg - game client settings with competition Defrag rule set
  • zcfg-init.cfg - start-up parameters
  • zcfg-hud.cfg - HUD settings (see attached screenshots)
  • zcfg-main.cfg - vstrs & keybinds
  • zcfg-readme.txt - documentation

Note: The HUD border graphics & font are from LicktorR's graphics pack, and not included in ZCFG.
You do not have the required permissions to view the files attached to this post.
-O-Zeppelin
 
Posts: 3
Joined: Apr 21st, '20, 8:40 am

Previous

cron