Description | humanbot (and probably other bots too) call it with `memset(1, 1, 32768)` (I call it memset in my decompiler, because memset is used under the hood in the implementation) meaning "set every item of the global array 1 to 1". And that globalArray1 is used as an array of booleans in the bot code, so probably the original code was `memset(1, true, 32768)`.
You can check full decompiled code of humanbot in the attached file.
But currently Zandronum implements DH_ARRAYSET using memset:
```
memset( m_ScriptData.alScriptArrays[lArray], lVal, lHighestVal * sizeof( LONG ));
```
As I understand it, it means set every byte of global array lArray to lVal up to byte lHighestVal*sizeof(long). Thus in the code above each item of globalArray1 would be set to 0x01010101.
Although this issue should not affect current bots I think bots VM still be fixed as we have (somewhat broken) Dusk's compiler and I will finish my decompiler soon. |
Attached Files | humanbot.txt [^] (22,756 bytes) 2018-12-29 08:04 [Show Content] [Hide Content]#!botc 1.0.0
#include "botc_defs.bts"
var int $global0;
var int $global1;
var int $global2;
var int $global3;
var int $global4;
var int $global5;
var int $globalArray1[];
event "Intermission" {
if ((IsSpectating() == 0)) {
changestate(14);
}
}
event "Spectating" {
changestate(15);
}
event "DuelStartingCountdown" {
if ((IsSpectating() == 0)) {
changestate(0);
}
}
event "DuelFight" {
if ((IsSpectating() == 0)) {
if ((LookForWeapons(0, 1) != (-1))) {
changestate(2);
} else {
changestate(1);
}
}
}
event "DuelWinSequence" {
if ((IsSpectating() == 0)) {
changestate(16);
}
}
event "LMSStartingCountdown" {
if ((IsSpectating() == 0)) {
changestate(0);
}
}
event "LMSFight" {
if ((IsSpectating() == 0)) {
if ((LookForWeapons(0, 1) != (-1))) {
changestate(2);
} else {
changestate(1);
}
}
}
event "LMSWinSequence" {
if ((IsSpectating() == 0)) {
if ((IsDead() == 0)) {
if (ChatSectionExistsInChatLump("WinStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("WinStrings");
}
} else {
if (ChatSectionExistsInChatLump("LoseStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("LoseStrings");
}
}
}
}
state "stateSpawn" : // 0
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$global2 = 100;
$global3 = (35 * 3);
$global4 = 0;
$global5 = 0;
delay(Random(0, 17));
if (ChatSectionExistsInChatLump("IntroStrings")) {
BeginChatting();
delay(Random(15, 35));
SayFromChatLump("IntroStrings");
}
$global0 = (35 * 5);
if ((LookForWeapons(0, 1) != (-1))) {
changestate(2);
} else {
changestate(1);
}
}
mainloop {
}
onexit {
StopChatting();
}
state "stateStandardRoam" : // 1
var int $local0;
var int $local1;
var int $local2;
var int $local3;
var int $local4;
var int $local5;
var int $local6;
var int $local7;
var int $local8;
var int $local9;
var int $local10;
var int $local11;
var int $local12;
var int $local13;
var int $local14;
var int $local15;
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
event "DamagedByPlayer" {
if ((StringsAreEqual(GetCurrentWeapon(), "Pistol") == 0)) {
SetEnemy(GetPlayerDamagedBy());
changestate(9);
}
}
onenter {
$local1 = 0;
$local2 = 0;
$local3 = 0;
$local4 = 0;
$local5 = 0;
$local6 = 0;
$local8 = 0;
memset(1, 1, 32768);
$local7 = (2 * 35);
}
mainloop {
switch ($local8) {
case 6:
$local8 = 0;
break;
case 5:
if ((LookForSuperArmor($local6, 1) != (-1))) {
if ($globalArray1[$local6]) {
$local6 = LookForSuperArmor($local6, 1);
if ((GetPathingCostToItem($local6) >= 0)) {
changestate(7);
} else {
$globalArray1[$local6] = 0;
}
}
$local6++;
} else {
$local6 = 0;
$local8++;
}
break;
case 4:
if ((LookForSuperHealth($local5, 1) != (-1))) {
if ($globalArray1[$local5]) {
$local5 = LookForSuperHealth($local5, 1);
if ((GetPathingCostToItem($local5) >= 0)) {
changestate(6);
} else {
$globalArray1[$local5] = 0;
}
}
$local5++;
} else {
$local5 = 0;
$local8++;
}
break;
case 3:
if ((GetArmor() < GetBaseArmor())) {
if ((LookForBaseArmor($local4, 1) != (-1))) {
if ($globalArray1[$local4]) {
$local4 = LookForBaseArmor($local4, 1);
if ((GetPathingCostToItem($local4) >= 0)) {
changestate(5);
} else {
$globalArray1[$local4] = 0;
}
}
$local4++;
} else {
$local4 = 0;
$local8++;
}
} else {
$local8++;
}
break;
case 2:
if ((GetHealth() < GetBaseHealth())) {
if ((LookForBaseHealth($local3, 1) != (-1))) {
if ($globalArray1[$local3]) {
$local3 = LookForBaseHealth($local3, 1);
if ((GetPathingCostToItem($local3) >= 0)) {
changestate(4);
} else {
$globalArray1[$local3] = 0;
}
}
$local3++;
} else {
$local3 = 0;
$local8++;
}
} else {
$local8++;
}
break;
case 1:
if ((LookForPowerups($local2, 1) != (-1))) {
if ($globalArray1[$local2]) {
$local2 = LookForPowerups($local2, 1);
if ((GetPathingCostToItem($local2) >= 0)) {
changestate(3);
} else {
$globalArray1[$local2] = 0;
}
}
$local2++;
} else {
$local2 = 0;
$local8++;
}
break;
case 0:
if ((LookForWeapons($local1, 1) != (-1))) {
if ($globalArray1[$local1]) {
$local1 = LookForWeapons($local1, 1);
if (((IsWeaponOwned($local1) == 0) && (GetPathingCostToItem($local1) >= 0))) {
changestate(2);
} else {
$globalArray1[$local1] = 0;
}
}
$local1++;
} else {
$local1 = 0;
$local8++;
}
break;
}
if ((StringsAreEqual(GetCurrentWeapon(), "Pistol") == 0)) {
$local9 = GetClosestPlayerEnemy();
if (($local9 != (-1))) {
SetEnemy($local9);
changestate(9);
}
}
// dropped 'Roam(100)';
if (($local7 > 0)) {
$local7--;
} else {
memset(1, 1, 32768);
$local7 = (2 * 35);
}
if (($global0 > 0)) {
$global0--;
} else {
$local10 = GetChatFrequency();
if (($local10 > 0)) {
$local10 = ((100 - $local10) * 7);
if (($local10 < 35)) {
$local10 = 35;
}
if ((Random(0, $local10) == 0)) {
if (ChatSectionExistsInChatLump("RoamingStrings")) {
BeginChatting();
delay(Random(15, 45));
if ((Random(0, 100) == 0)) {
if (ChatSectionExistsInChatLump("RareRoamingStrings")) {
SayFromChatLump("RareRoamingStrings");
} else {
SayFromChatLump("RoamingStrings");
}
} else {
if ((GetSpread() < 0)) {
if ((Random(0, 3) == 0)) {
if (ChatSectionExistsInChatLump("LosingRoamingStrings")) {
SayFromChatLump("LosingRoamingStrings");
} else {
SayFromChatLump("RoamingStrings");
}
} else {
SayFromChatLump("RoamingStrings");
}
} else {
SayFromChatLump("RoamingStrings");
}
}
}
$global0 = (35 * 5);
}
}
}
if (($global5 > 0)) {
$global5--;
if (($global5 == 0)) {
SetSkillDecrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global4 > 0)) {
$global4--;
if (($global4 == 0)) {
SetSkillIncrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global3 > 0)) {
$global3--;
} else {
$global2++;
if (($global2 > 100)) {
$global2 = 100;
}
$global3 = (35 * 3);
}
}
}
}
onexit {
StopChatting();
}
state "stateSortThroughWeapons" : // 2
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$local0 = 0;
$local1 = (-1);
if ((StringsAreEqual(GetCurrentWeapon(), "Pistol") == 0)) {
$local4 = 1;
} else {
$local4 = 1;
}
}
mainloop {
$local0 = LookForWeapons($local0, $local4);
if (($local0 == (-1))) {
if (($local1 != (-1))) {
SetGoal($local1);
changestate(8);
} else {
changestate(1);
}
}
if (IsWeaponOwned($local0)) {
$local0++;
} else {
$local2 = GetPathingCostToItem($local0);
if (($local2 < 0)) {
$local0++;
} else {
if (($local1 == (-1))) {
$local1 = $local0;
$local3 = $local2;
$local0++;
} else {
$local5 = 0;
if (($local2 < $local3)) {
$local5++;
} else {
$local5--;
}
if (($local5 > 0)) {
$local1 = $local0;
$local3 = $local2;
}
$local0++;
}
}
}
}
state "stateSortThroughPowerups" : // 3
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$local0 = 0;
$local1 = (-1);
}
mainloop {
$local0 = LookForPowerups($local0, 1);
if (($local0 == (-1))) {
if (($local1 != (-1))) {
SetGoal($local1);
changestate(8);
} else {
changestate(1);
}
}
$local2 = GetPathingCostToItem($local0);
if (($local2 < 0)) {
$local0++;
} else {
if (($local1 == (-1))) {
$local1 = $local0;
$local3 = $local2;
$local0++;
} else {
$local4 = 0;
if (($local2 < $local3)) {
$local4++;
} else {
$local4--;
}
if (($local4 > 0)) {
$local1 = $local0;
$local3 = $local2;
}
$local0++;
}
}
}
state "stateSortThroughBaseHealth" : // 4
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$local0 = 0;
$local1 = (-1);
}
mainloop {
$local0 = LookForBaseHealth($local0, 1);
if (($local0 == (-1))) {
if (($local1 != (-1))) {
SetGoal($local1);
changestate(8);
} else {
changestate(1);
}
}
$local2 = GetPathingCostToItem($local0);
if (($local2 < 0)) {
$local0++;
} else {
if (($local1 == (-1))) {
$local1 = $local0;
$local3 = $local2;
$local0++;
} else {
$local4 = 0;
if (($local2 < $local3)) {
$local4++;
} else {
$local4--;
}
if (($local4 > 0)) {
$local1 = $local0;
$local3 = $local2;
}
$local0++;
}
}
}
state "stateSortThroughBaseArmor" : // 5
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$local0 = 0;
$local1 = (-1);
}
mainloop {
$local0 = LookForBaseArmor($local0, 1);
if (($local0 == (-1))) {
if (($local1 != (-1))) {
SetGoal($local1);
changestate(8);
} else {
changestate(1);
}
}
$local2 = GetPathingCostToItem($local0);
if (($local2 < 0)) {
$local0++;
} else {
if (($local1 == (-1))) {
$local1 = $local0;
$local3 = $local2;
$local0++;
} else {
$local4 = 0;
if (($local2 < $local3)) {
$local4++;
} else {
$local4--;
}
if (($local4 > 0)) {
$local1 = $local0;
$local3 = $local2;
}
$local0++;
}
}
}
state "stateSortThroughSuperHealth" : // 6
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$local0 = 0;
$local1 = (-1);
}
mainloop {
$local0 = LookForSuperHealth($local0, 1);
if (($local0 == (-1))) {
if (($local1 != (-1))) {
SetGoal($local1);
changestate(8);
} else {
changestate(1);
}
}
$local2 = GetPathingCostToItem($local0);
if (($local2 < 0)) {
$local0++;
} else {
if (($local1 == (-1))) {
$local1 = $local0;
$local3 = $local2;
$local0++;
} else {
$local4 = 0;
if (($local2 < $local3)) {
$local4++;
} else {
$local4--;
}
if (($local4 > 0)) {
$local1 = $local0;
$local3 = $local2;
}
$local0++;
}
}
}
state "stateSortThroughSuperArmor" : // 7
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
$local0 = 0;
$local1 = (-1);
}
mainloop {
$local0 = LookForSuperArmor($local0, 1);
if (($local0 == (-1))) {
if (($local1 != (-1))) {
SetGoal($local1);
changestate(8);
} else {
changestate(1);
}
}
$local2 = GetPathingCostToItem($local0);
if (($local2 < 0)) {
$local0++;
} else {
if (($local1 == (-1))) {
$local1 = $local0;
$local3 = $local2;
$local0++;
} else {
$local4 = 0;
if (($local2 < $local3)) {
$local4++;
} else {
$local4--;
}
if (($local4 > 0)) {
$local1 = $local0;
$local3 = $local2;
}
$local0++;
}
}
}
state "statePathToGoal" : // 8
event "ReachedGoal" {
changestate(1);
}
event "GoalRemoved" {
changestate(1);
}
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
event "DamagedByPlayer" {
if ((StringsAreEqual(GetCurrentWeapon(), "Pistol") == 0)) {
SetEnemy(GetPlayerDamagedBy());
changestate(9);
}
}
mainloop {
$local2 = PathToGoal(100);
switch ($local2) {
case 1:
changestate(1);
break;
}
if ((StringsAreEqual(GetCurrentWeapon(), "Pistol") == 0)) {
$local0 = LookForPlayerEnemies(0);
if (($local0 != (-1))) {
SetEnemy($local0);
changestate(9);
}
}
if (($global0 > 0)) {
$global0--;
} else {
$local1 = GetChatFrequency();
if (($local1 > 0)) {
$local1 = ((100 - $local1) * 7);
if (($local1 < 35)) {
$local1 = 35;
}
if ((Random(0, $local1) == 0)) {
if (ChatSectionExistsInChatLump("RoamingStrings")) {
BeginChatting();
delay(Random(15, 45));
if ((Random(0, 100) == 0)) {
if (ChatSectionExistsInChatLump("RareRoamingStrings")) {
SayFromChatLump("RareRoamingStrings");
} else {
SayFromChatLump("RoamingStrings");
}
} else {
if ((GetSpread() < 0)) {
if ((Random(0, 3) == 0)) {
if (ChatSectionExistsInChatLump("LosingRoamingStrings")) {
SayFromChatLump("LosingRoamingStrings");
} else {
SayFromChatLump("RoamingStrings");
}
} else {
SayFromChatLump("RoamingStrings");
}
} else {
SayFromChatLump("RoamingStrings");
}
}
}
$global0 = (35 * 5);
}
}
}
if (($global5 > 0)) {
$global5--;
if (($global5 == 0)) {
SetSkillDecrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global4 > 0)) {
$global4--;
if (($global4 == 0)) {
SetSkillIncrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global3 > 0)) {
$global3--;
} else {
$global2++;
if (($global2 > 100)) {
$global2 = 100;
}
$global3 = (35 * 3);
}
}
}
}
onexit {
StopChatting();
}
state "stateEngageEnemy" : // 9
event "EnemyKilled" {
changestate(13);
}
event "EnemyFiredShotgun" {
$local4 = (37 - 17);
}
event "EnemyFiredSSG" {
$local4 = (57 - 17);
}
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
BeginFiringWeapon();
BeginAimingAtEnemy();
$local3 = 0;
$local1 = Random(0, 1);
$local2 = Random(1, 62);
if (($local1 == 1)) {
MoveLeft(100);
} else {
MoveRight(100);
}
$local4 = 0;
$local5 = 0;
}
mainloop {
if ((IsEnemyVisible() == 0)) {
$local8 = GetClosestPlayerEnemy();
if (($local8 == (-1))) {
changestate(10);
} else {
SetEnemy($local8);
changestate(9);
}
}
if ((IsEnemyAlive() == 0)) {
ClearEnemy();
changestate(1);
}
if ($local4) {
$local4--;
if (($local4 == 0)) {
$local5 = Random(12, 35);
$local6 = Random(0, 8);
StopMovement();
switch ($local6) {
case 7:
MoveForward(100);
MoveLeft(100);
break;
case 6:
MoveLeft(100);
break;
case 5:
MoveBackwards(100);
MoveLeft(100);
break;
case 4:
MoveBackwards(100);
break;
case 3:
MoveBackwards(100);
MoveRight(100);
break;
case 2:
MoveRight(100);
break;
case 1:
MoveForward(100);
MoveRight(100);
break;
case 0:
MoveForward(100);
break;
}
}
}
if (($local5 == 0)) {
$local0 = GetDistanceToEnemy();
if (StringsAreEqual(GetCurrentWeapon(), "Chaingun")) {
if (($local0 < 256)) {
MoveBackwards(100);
} else {
StopForwardMovement();
}
} else {
if (($local0 > 384)) {
MoveForward(100);
} else {
if (($local0 < 128)) {
MoveBackwards(100);
} else {
$local7 = Random(0, 1);
if (($local7 == 0)) {
MoveForward(100);
} else {
MoveBackwards(100);
}
}
}
}
$local2--;
if (($local2 == 0)) {
$local1 = (!$local1);
if (($local1 == 1)) {
MoveLeft(100);
} else {
MoveRight(100);
}
$local2 = Random(1, 62);
}
} else {
$local5--;
}
if (StringsAreEqual(GetCurrentWeapon(), "Chaingun")) {
StopFiringWeapon();
if ($local3) {
$local3--;
}
if (($local3 == 0)) {
FireWeapon();
$local3 = 9;
}
} else {
BeginFiringWeapon();
}
if (($global5 > 0)) {
$global5--;
if (($global5 == 0)) {
SetSkillDecrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global4 > 0)) {
$global4--;
if (($global4 == 0)) {
SetSkillIncrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global3 > 0)) {
$global3--;
} else {
$global2++;
if (($global2 > 100)) {
$global2 = 100;
}
$global3 = (35 * 3);
}
}
}
}
onexit {
StopMovement();
StopFiringWeapon();
StopAimingAtEnemy();
}
state "stateChaseEnemy" : // 10
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
event "DamagedByPlayer" {
if ((StringsAreEqual(GetCurrentWeapon(), "Pistol") == 0)) {
SetEnemy(GetPlayerDamagedBy());
changestate(9);
}
}
mainloop {
$local0 = GetClosestPlayerEnemy();
if (($local0 != (-1))) {
SetEnemy($local0);
changestate(9);
}
$local1 = PathToLastKnownEnemyPosition(100);
switch ($local1) {
case 2:
ClearEnemy();
changestate(1);
break;
case 1:
ClearEnemy();
changestate(1);
break;
}
if (($global5 > 0)) {
$global5--;
if (($global5 == 0)) {
SetSkillDecrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global4 > 0)) {
$global4--;
if (($global4 == 0)) {
SetSkillIncrease(0);
$global2 = 100;
$global3 = (35 * 3);
}
} else {
if (($global3 > 0)) {
$global3--;
} else {
$global2++;
if (($global2 > 100)) {
$global2 = 100;
}
$global3 = (35 * 3);
}
}
}
}
state "stateKilled" : // 11
event "Respawned" {
changestate(12);
}
event "ReceivedMedal" {
$local1 = GetReceivedMedal();
switch ($local1) {
case 12:
case 11:
$global2 -= 25;
break;
}
}
onenter {
delay(Random(5, 15));
$global2 -= 15;
if (((IsSkillDecreased() == 0) && ($global2 < 0))) {
if (IsSkillIncreased()) {
SetSkillDecrease(1);
SetSkillIncrease(0);
if (ChatSectionExistsInChatLump("DemoralizedStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("DemoralizedStrings");
}
$global0 = (35 * 5);
$global5 = (35 * 60);
$global4 = 0;
} else {
SetSkillIncrease(1);
SetSkillDecrease(0);
if (ChatSectionExistsInChatLump("EnragedStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("EnragedStrings");
}
$global0 = (35 * 5);
$global4 = (35 * 60);
$global5 = 0;
$global2 = 75;
}
} else {
$local0 = GetChatFrequency();
if ((($local0 > 0) && ($global0 == 0))) {
$local0 = ((100 - $local0) / 5);
if (($local0 < 2)) {
$local0 = 2;
}
if ((Random(0, $local0) == 0)) {
if (ChatSectionExistsInChatLump("KilledStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("KilledStrings");
}
$global0 = (35 * 5);
}
}
}
}
mainloop {
Respawn();
}
onexit {
StopChatting();
}
state "stateRespawn" : // 12
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
if ((LookForWeapons(0, 0) != (-1))) {
changestate(2);
} else {
changestate(1);
}
}
mainloop {
}
state "stateKilledEnemy" : // 13
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
event "ReceivedMedal" {
$local2 = GetReceivedMedal();
switch ($local2) {
case 7:
case 6:
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:
$global2 += 15;
break;
}
}
onenter {
$global2 += 10;
if (($global2 > 100)) {
$global2 = 100;
}
$local0 = GetClosestPlayerEnemy();
if (($local0 != (-1))) {
SetEnemy($local0);
changestate(9);
}
$local1 = GetChatFrequency();
if ((($local1 > 0) && ($global0 == 0))) {
$local1 = ((100 - $local1) / 6);
if (($local1 < 2)) {
$local1 = 2;
}
if ((Random(0, $local1) == 0)) {
if (ChatSectionExistsInChatLump("FragStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("FragStrings");
}
$global0 = (35 * 5);
}
}
ClearEnemy();
changestate(1);
}
mainloop {
}
onexit {
StopChatting();
}
state "stateIntermission" : // 14
event "NewMap" {
changestate(1);
}
event "KilledByEnemy" {
changestate(11);
}
event "KilledByPlayer" {
changestate(11);
}
event "KilledBySelf" {
changestate(11);
}
event "KilledByEnvironment" {
changestate(11);
}
onenter {
delay(Random(35, 70));
if ((GetSpread() >= 0)) {
if (ChatSectionExistsInChatLump("WinStrings")) {
SayFromChatLump("WinStrings");
}
} else {
if (ChatSectionExistsInChatLump("LoseStrings")) {
SayFromChatLump("LoseStrings");
}
}
}
mainloop {
}
state "stateSpectating" : // 15
event "JoinedGame" {
changestate(0);
}
onenter {
TryToJoinGame();
}
mainloop {
}
state "stateDuelWinSequence" : // 16
onenter {
if ((GetSpread() > 0)) {
if (ChatSectionExistsInChatLump("WinStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("WinStrings");
}
} else {
if (ChatSectionExistsInChatLump("LoseStrings")) {
BeginChatting();
delay(Random(15, 45));
SayFromChatLump("LoseStrings");
}
}
}
mainloop {
}
|