Auto Making coop team

Scripting particularly to improve NoX is discussed in here

Auto Making coop team

Postby panic » Tue Jan 14, 2020 1:06 am

Automate coop team

Native Script Code::

Code: Select all
int ImportPlayerAutoTeamSign()
{
    int arr[17], link;

    if (!link)
    {
        arr[0] = 0x4191D068; arr[1] = 0x50515600; arr[2] = 0x000020B9; arr[3] = 0xF9E0B800; arr[4] = 0xC9850062;
        arr[5] = 0x8B492774; arr[6] = 0x12DC0530; arr[7] = 0xF6850000; arr[8] = 0x5150F074; arr[9] = 0x8D24468B;
        arr[10] = 0x016A304E; arr[11] = 0x51016A50; arr[12] = 0x54FF016A; arr[13] = 0xC4832824; arr[14] = 0xEB585914;
        arr[15] = 0x5E5958D5; arr[16] = 0xC304C483;
        CancelTimer(FrameTimerWithArg(10, ImportPlayerAutoTeamSign, ImportPlayerAutoTeamSign));
        link = GetMemory(GetMemory(0x75ae28) + (0x30 * GetMemory(GetMemory(0x83395c) + 8) + 0x1c));
    }
    return link;
}

void PlayerAutoTeamSign()
{
    int temp = GetMemory(0x5c3178);

    SetMemory(0x5c3178, ImportPlayerAutoTeamSign());
    GetHost();
    SetMemory(0x5c3178, temp);
}

void MakeCoopTeam()
{
    int arr[3];
    int teamCount = GetMemory(0x654D5C), temp, link;

    if (!teamCount && !link)
    {
        arr[0] = 0x417E1068; arr[1] = 0x2414FF00; arr[2] = 0xC304C483;
        CancelTimer(FrameTimerWithArg(10, MakeCoopTeam, MakeCoopTeam));
        link = GetMemory(GetMemory(0x75ae28) + (0x30 * GetMemory(GetMemory(0x83395c) + 8) + 0x1c));
        temp = GetMemory(0x5c3178);
        SetMemory(0x5c3178, link);
        GetHost();
        SetMemory(0x5c3178, temp);
        SetMemory(0x5d53a4, 268640519);
    }
}

void RemoveCoopTeamMode()
{
    int arr[6], link, temp;

    if (!link && GetMemory(0x654d5c) == 1)
    {
        arr[0] = 0x4DB8BE56; arr[1] = 0x20680065; arr[2] = 0x6A00418F; arr[3] = 0x54FF5600; arr[4] = 0xC4830824; arr[5] = 0x90C35E0C;
        CancelTimer(FrameTimerWithArg(10, RemoveCoopTeamMode, RemoveCoopTeamMode));
        link = GetMemory(GetMemory(0x75ae28) + (0x30 * GetMemory(GetMemory(0x83395c) + 8) + 0x1c));
        temp = GetMemory(0x5c3178);
        SetMemory(0x5c3178, link);
        GetHost();
        SetMemory(0x5c3178, temp);
    }
}

void SetGameTypeCoopMode()
{
    MakeCoopTeam();
    PlayerAutoTeamSign();
}


At First call this code
will create coop team.

Code: Select all
FrameTimer(2, SetGameTypeCoopMode); --MapInitialize


Don't forget! Remove the coop team when changing other maps.
code here:

Code: Select all
void MapExit()
{
    RemoveCoopTeamMode();
}


Requirements::
- Nox Original (1.2b)
- script compiler with support memory read/write


Added Example Map
Attachments
xtest511.7z
Test map
(372.02 KiB) Downloaded 33 times
panic
Veteran
Posts: 323
Joined: Thu Nov 12, 2015 3:47 pm

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest