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

Previous

cron