diff --git a/config/defaults.cfg b/config/defaults.cfg index 7549760f..c52e84cc 100644 --- a/config/defaults.cfg +++ b/config/defaults.cfg @@ -19,7 +19,6 @@ setfont default // Choose your font ofc_gamma_list = "" loop ogl (listlen $defaultmaps) [ add2list ofc_gamma_list $gamma ] -tmpClientData = "" askquit = 1 gfxqualityalias = 3 // Default GFX is medium. soundqualityalias = 3 // Default sound is best. @@ -35,5 +34,4 @@ survNumBots = 12 survBotsToAdd = 1 timeBetChkPts = 60000 timeUntilTele = 120000 -survMaxBots = 32 -tmpSurvData = "" \ No newline at end of file +survMaxBots = 32 \ No newline at end of file diff --git a/config/docs.cfg b/config/docs.cfg index 110d9d2e..4fc7b2d2 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -226,7 +226,7 @@ docargument [E] [body of code to execute if editing or in coop-edit mode]; docargument [C] [body of code to execute if connected to a server]; docargument [B] [body of code to execute if in a bot mode]; docargument [O] [body of code to execute if none of the other arguments have been met]; -docremark [This command requires 6 arguments, no more no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing".]; +docremark [This command requires 6 arguments, no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing".]; docident [browsefiledesc] [Toggles getting descriptive text from CGZ or DMO files in menudirlist.]; docargument [B] [] [min 0/max 1/default 1]; docident [changeteam] [Swaps your player to the enemy team.]; diff --git a/config/on_quit.cfg b/config/on_quit.cfg index 1d790e84..085090d9 100644 --- a/config/on_quit.cfg +++ b/config/on_quit.cfg @@ -1,27 +1,6 @@ // Adds a list of aliases to be deleted (cleared from saved.cfg) on every quit. // Do not modify. (unless you really know what you're doing) -// Restores aliases that were stored in saved.cfg as a list - for increased efficiency -saveClientData = "curname LANG askquit flystyle nickhighlight soundqualityalias dyngamma __gibsgore gfxqualityalias poniesmodeon old_editbinds" - -if (! (checkalias afterinit)) [ afterinit = "" ] -if (! (strstr $afterinit tmpClientData)) [ - add2alias afterinit [ - if (checkalias tmpClientData) [ - if (= (listlen $tmpClientData) (listlen $saveClientData)) [ - loop lcd (listlen $tmpClientData) [ - (at $saveClientData $lcd) = (at $tmpClientData $lcd) - ] - ] - ] - ] -] -// Stores the data as a list -addOnQuit [ - tmpClientData = "" - loop scd (listlen $saveClientData) [ add2list tmpClientData (getalias (at $saveClientData $scd)) ] -] - addListOnQuit = [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQuit (concat "delalias" (at $alias_list $al)) ] ] on_quit_aliases = [ @@ -61,4 +40,4 @@ on_quit_aliases = [ on_quit_aliases ] -addListOnQuit $saveClientData; addListOnQuit $on_quit_aliases; addOnQuit [ delalias alias_list ] \ No newline at end of file +addListOnQuit $on_quit_aliases; addOnQuit [ delalias alias_list ] \ No newline at end of file diff --git a/config/scripts.cfg b/config/scripts.cfg index b1466059..94574335 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -8,9 +8,7 @@ // However, the current yaw of the player will define the rotation/yaw when // using the command! editent = [ - if (strcmp (getenttype) "mapmodel") [ - saycommand "/entset" (getenttype) (getentattr 1) (getentattr 2) (getentattr 3) - ] [ + if (strcmp (getenttype) "mapmodel") [ saycommand "/entset" (getenttype) (getentattr 1) (getentattr 2) (getentattr 3) ] [ if (> (findlist "light sound clip plclip" (getenttype)) -1) [ saycommand "/entset" (getenttype) (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) ] [ @@ -22,14 +20,9 @@ editent = [ // "convertclips" command: // This command automatically changes the a "clip" to a "plclip" entity or vice-versa. convertclips = [ - if (strcmp (getenttype) "clip") [ - entset plclip (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) - ] [ - if (strcmp (getenttype) "plclip") [ - entset clip (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) - ] [ - echo No changes made. This entity isn't a clip or a plclip. - echo Try using the /closestenttype command to find a specific entity. + if (strcmp (getenttype) "clip") [ entset plclip (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) ] [ + if (strcmp (getenttype) "plclip") [ entset clip (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) ] [ + echo No changes made. This entity isn't a clip or a plclip.; echo Try using the /closestenttype command to find a specific entity. ] ] ] @@ -38,31 +31,19 @@ convertclips = [ // This command controls gib Speed/Number/TTL all in one variable. gibsgore = [ if (= $arg1 4) [ // Unrealistic - gib 1 - gibspeed 40 - gibnum 100 - gibttl 2500 // Turn TTL down to minimise lag... + gib 1; gibspeed 40; gibnum 100; gibttl 2500 // Turn TTL down to minimise lag... __gibsgore = 4 ] [ if (= $arg1 3) [ // Messy - gib 1 - gibspeed 15 - gibnum 65 - gibttl 10000 + gib 1; gibspeed 15; gibnum 65; gibttl 10000 __gibsgore = 3 ] [ if (= $arg1 2) [ // Good - gib 1 - gibspeed 30 - gibnum 75 - gibttl 5000 + gib 1; gibspeed 30; gibnum 75; gibttl 5000 __gibsgore = 2 ] [ if (= $arg1 1) [ // Normal - gib 1 - gibspeed 30 - gibnum 6 - gibttl 5000 + gib 1; gibspeed 30; gibnum 6; gibttl 5000 __gibsgore = 1 ] [ if (= $arg1 0) [ // Off @@ -87,13 +68,9 @@ run = [ exec (concatword config/ $arg1 .cfg) ] mapcomplete = [complete $arg1 "packages/maps/official packages/maps" cgz] mapcommands = "map tdm coop dm lms ts ctf pf lss osok tosok htf vip tktf ktf sendmap" loop i (listlen $mapcommands) [ mapcomplete (at $mapcommands $i) ] - complete demo "demos" dmo - -entcomplete = [listcomplete $arg1 "light playerstart pistol ammobox grenades health armour akimbo mapmodel ladder ctf-flag sound clip plclip helmet"] -entcomplete newent -entcomplete clearents -entcomplete closestenttype +entcomplete = [ listcomplete $arg1 "light playerstart pistol ammobox grenades health armour akimbo mapmodel ladder ctf-flag sound clip plclip helmet" ] +entcomplete newent; entcomplete clearents; entcomplete closestenttype // TODO:FIXME change all occurrence of SPECT(ator) to GHOST listcomplete team "CLA RVSF CLA-SPECT RVSF-SPECT SPECTATOR" @@ -118,10 +95,8 @@ gamemodedesc 15 [Keep the Flag: Get the flag and keep it. You score one point ev // "resetbinds" command. resetbinds = [ exec config/resetbinds.cfg; echo (c 3)All binds have been reset to default values! ] - // "changeteam" command. changeteam = [ if (< (curteam) 4) [ team (at "RVSF CLA RVSF-SPECT CLA-SPECT" (curteam)) ] ] - // "spectate" command spectate = [ suicide; sleep 500 [ team SPECTATOR ] ] @@ -165,10 +140,10 @@ altaction = [ (concatword altaction_ (curweapon)) ] quicknadethrow_old = [ if (> (magcontent 8) 0) [ - if (!= (curweapon) 7) [grenades] + if (!= (curweapon) 7) [ grenades ] attack ] - onrelease [ sleep 1 [ if (= (curweapon) 7) [weapon (prevweapon)] ] ] + onrelease [ sleep 1 [ if (= (curweapon) 7) [ weapon (prevweapon) ] ] ] ] loop i 10 [ (concatword altaction_ $i) = quicknadethrow ] // Quick nade throw is default @@ -180,21 +155,14 @@ oldsens = $sensitivity zoom = [ if (= $arg1 1) [ - if (=f $sensitivity (scopesens)) [] [ + if (! (=f $sensitivity (scopesens))) [ oldsens = $sensitivity // avoid error if using 0.001 as sensitivity newsens = (scopesens) - if (> (*f 1 1000) $newsens) [ - if (< 1000 $newsens) [ - sensitivity (scopesens) - ] [] - ] [] + if (> (*f 1 1000) $newsens) [ if (< 1000 $newsens) [ sensitivity (scopesens) ] ] setscope 1 ] - ] [ - sensitivity $oldsens - setscope 0 - ] + ] [ sensitivity $oldsens; setscope 0 ] ] delta_game_0 = [ if (= $arg1 1) [ shiftweapon 1 ] [ shiftweapon -1 ] ] @@ -273,7 +241,6 @@ addOnQuit = [ add2alias onQuit $arg1 ] // add2list - Quickly append an element to a list without add2alias'es ";" add2list = [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (getalias $arg1) $arg2) ] ] - // rrnd - Returns a ranged random integer. rrnd = [ + (rnd (- $arg2 $arg1)) $arg1 ] @@ -314,11 +281,7 @@ pasteent = [ genhex = [ tmp_hex = "0x" loop ghl 6 [ - if (rnd 2) [ - tmp_hex = (concatword $tmp_hex (rnd 10)) - ] [ - tmp_hex = (concatword $tmp_hex (at [ A B C D E F ] (rnd 6))) - ] + if (rnd 2) [ tmp_hex = (concatword $tmp_hex (rnd 10)) ] [ tmp_hex = (concatword $tmp_hex (at [ A B C D E F ] (rnd 6))) ] ] echo (c 3)Trying hexadecimal color: (c 5) $tmp_hex result $tmp_hex @@ -337,8 +300,7 @@ genwc = [ // gencl - Randomly generates a valid coloured light. gencl = [ if $editing [ - tmp_numargs = $numargs - tmp_cl = "" + tmp_numargs = $numargs; tmp_cl = "" loop gcl 3 [ add2list tmp_cl (rrnd 1 256) ] if $tmp_numargs [ if (|| (! (= $selx 0)) (! (= $sely 0))) [ @@ -356,7 +318,7 @@ gencl = [ // megabind - Binds a key to many different actions depending on the current game state. megabind = [ - if (= $numargs 6) [ + if (> $numargs 5) [ bind $arg1 (format "if (watchingdemo) [ %1 ] [ if (|| $editing (= $gamemode 1)) [ %2 ] [ if $connected [ %3 ] [ if (curmodeattr bot) [ %4 ] [ %5 ] ] ] ]" $arg2 $arg3 $arg4 $arg5 $arg6) ] ] @@ -374,7 +336,6 @@ getscrext = [ // getmodeacr - Returns the proper current mode's acronym. gamemodes_list = [ TDM COOP DM SURV TSURV CTF PF BTDM BDM LSS OSOK TOSOK BOSOK HTF TKTF KTF ] - getmodeacr = [ result (at $gamemodes_list $gamemode) ] // setmr - Restart the current demo and fast forward to, a predefined minutes remaining. @@ -390,9 +351,7 @@ setmr = [ tmp_svol = $soundvol add2alias mapstartonce [ if (!= $soundvol $tmp_svol) [ soundvol $tmp_svol ] ] // Ensure that soundvol is reset to original setting sleep (- (* $minutesremaining 60000) $tmp_mrem) [ gamespeed 100; soundvol $tmp_svol; tmp_ff = 0 ] - soundvol 0 - gamespeed 1000 - tmp_ff = 1 + soundvol 0; gamespeed 1000; tmp_ff = 1 ] demo $_demofile ] [ echo (c 3)Error: (c 1)setmr (c 5)requires a positive, non-zero argument. ] @@ -407,12 +366,11 @@ omit_idents = "curname curteam idlebots name" storesets = [ if (> $numargs 1) [ if (listlen $arg1) [ - badargs = 0 - $arg2 = "" + badargs = 0; $arg2 = "" loop ssl (listlen $arg1) [ if (&& (isIdent (at $arg1 $ssl)) (! (strstr $omit_idents (at $arg1 $ssl)))) [ add2list $arg2 (getvar (at $arg1 $ssl)) - ] [ badargs = 1 ] + ] [ badargs = 1; break ] ] if $badargs [ delalias $arg2; echo (c 3)Error: (c 5)Bad "argument(s)" given! ] ] @@ -443,6 +401,7 @@ cleanshot = [ sleep 90 [ loop ros (listlen $cs_sets) [ (at $cs_sets $ros) (at $tmp_old_sets $ros) ] ] ] +// Slowtoggle - Meant to be keybound, quickly toggle from fast/slow fly speeds. slowtoggle = [ if (!= $arg1 0) [ slowmove 0; onrelease [ slowmove 1 ] ] [ slowmove 1; onrelease [ slowmove 0 ] ] ] // Simple claim-admin script for one single-server. @@ -453,11 +412,7 @@ _CAS_serverpass = "PASSWORD" _CAS_servername = "SERVER NAME" customclaimadminscript = [ if (strcmp (curserver 1) $_CAS_serverip) [ - if (! (currole)) [ - setadmin 1 $_CAS_serverpass - ] [ - setadmin 0; echo you relinquished admin status - ] + if (! (currole)) [ setadmin 1 $_CAS_serverpass ] [ setadmin 0; echo you relinquished admin status ] ] [ echo (c 3)Error: (c 5)you're not connected to $_CAS_servername servers ] diff --git a/config/survival.cfg b/config/survival.cfg index bef3ea40..aa8702b0 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -115,8 +115,8 @@ checkzone = [ startOBCount = [ startedOBCount = 1; startOBMillis = (millis); backInZone = 0; tmpSCtr = 5 - echo (c 3)Get back into the arena! (c 9)You only have (c 5)5 (c 9)seconds to return. - loop soc 5 [ sleep (* $soc 1000) [ if (&& (! (isInZone)) (! $backInZone)) [ echo (concatword (c 2) $tmpSCtr ...); -= tmpSCtr 1 ] [ backInZone = 1 ] ] ] + echo (c 3)Get back into the arena! (c 5)You only have (c 3)5 (c 5)seconds to return. + loop soc 5 [ sleep (* $soc 1000) [ if (&& (! (isInZone)) (! $backInZone)) [ echo (concatword (c 9) $tmpSCtr ...); -= tmpSCtr 1 ] [ backInZone = 1 ] ] ] sleep 5000 [ if (&& (! (isInZone)) (&& (! $backInZone) (>= (- (millis) $startOBMillis) 5000))) [ endSurvival (concatword (c 3) "You took too long to return to the arena!") ] [ startedOBCount = 0 ] ] ] @@ -132,13 +132,7 @@ endSurvival = [ tdm (at $defaultmaps (rnd (listlen $defaultmaps))) ] -// Use a single alias to store data rather than many -survSaveAliases = "survMaxBots survDifficulty timeBetChkPts survNumBots survBotsToAdd timeUntilTele survMap" -if (! (checkalias afterinit)) [ afterinit = "" ] -if (! (strstr $afterinit tmpSurvData)) [ add2alias afterinit [ if (checkalias tmpSurvData) [ if (= (listlen $tmpSurvData) (listlen $survSaveAliases)) [ loop oll (listlen $survSaveAliases) [ (at $survSaveAliases $oll) = (at $tmpSurvData $oll) ] ] ] ] ] -addOnQuit [ tmpSurvData = ""; loop oql (listlen $survSaveAliases) [ add2list tmpSurvData (getalias (at $survSaveAliases $oql)) ] ] - // List of aliases that need to be cleared from saved.cfg on quit: survAliases = "backInZone checkzone curSurvDifficulty endSurvival finalSurvMillis gotCheckPoint increaseDifficulty isInZone lastCheckPoint midZoneX midZoneY onKill resetSurvAliases setOfcZones setzone startedOBCount startedSurvival startOBCount startOBMillis startPreSurvMillis startSurvival startSurvMillis survIsFinished survival_test survKills survMapIndex survOfcZones survTeleported tmpSCtr tmpSurvCtr tmpSurvInt tmpSurvSets tmp_survstr tmpSurvZone tmpZoneCenter zone checkSurvAliases survResetAliases survAliases" -addListOnQuit $survAliases; addListOnQuit $survSaveAliases \ No newline at end of file +addListOnQuit $survAliases \ No newline at end of file diff --git a/docs/reference.xml b/docs/reference.xml index f3140e57..1b0a9751 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -1019,7 +1019,7 @@ - This command requires 6 arguments, no more no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing". + This command requires 6 arguments, no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing".