Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Renaming bots

  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts

    Renaming bots

    Quick question, just need a confirmation - is it possible to rename bots?

    I created this code just now:

    PHP Code:
        if(isdefined(self.isbot))
        {
            
    botname getSubStr(self.name03);
            
            if(
    botname == "bot")
            {
                
    number getSubStr(self.name3self.name.size);
                
    self.name "new name #"+number;
                
    self setclientcvar("name""new name #"+number);
                
    iprintlnBold("a bot has been renamed");
            }
        } 
    I'm aware setclientcvar would never work since bots don't have their own configurations like players do. Still, as a noob, it's worth the try.
    Also, it's weird that I can get self.name from a bot but cannot change it.
    I'm reading the printed message in game every time the code is read, so, it is reaching the renaming commands.

    Hmm... I actually just tried to use 'self.name = ' to rename myself ingame, and it didn't work. Any clues?
    Last edited by guiismiti; 2nd September 2014 at 05:06. Reason: updating
    set logfile 2

  2. #2
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Possible but very hard.

    Click image for larger version. 

Name:	shot0067.jpg 
Views:	191 
Size:	349.3 KB 
ID:	741
    Click image for larger version. 

Name:	shot0068.jpg 
Views:	198 
Size:	327.1 KB 
ID:	742

    Basically you'd need to create a custom scoreboard, killfeed and kill messages, while figuring out how to hide the stock ones.

    There might be a way to do it using libcod (See http://killtube.org/showthread.php?1...ing-bots/page2 ) but examples on that thread have been done with cod1.
    Last edited by filthy_freak_; 2nd September 2014 at 05:03.

  3. The Following User Says Thank You to filthy_freak_ For This Useful Post:

    guiismiti (2nd September 2014)

  4. #3
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Yea, I can see the ping is also modified.
    set logfile 2

  5. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    You can try it with libcod like explained here:

    http://killtube.org/showthread.php?1...ull=1#post9963

  6. The Following User Says Thank You to Mitch For This Useful Post:

    guiismiti (2nd September 2014)

  7. #5
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by Mitch View Post
    You can try it with libcod like explained here:

    http://killtube.org/showthread.php?1...ull=1#post9963
    That is for CoDExtended.

    Could you convert it to libcod for those who are unfamiliar with C++? (Myself being one)

  8. #6
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by filthy_freak_ View Post
    That is for CoDExtended.

    Could you convert it to libcod for those who are unfamiliar with C++? (Myself being one)
    When i got time i will start with 'isbot' function for libcod. After that works i will start on 'renamebot'.

    1.3
    PHP Code:
    int __cdecl sub_808C316(int a1char *destint a3)
    {
      
    int v3// ST14_4@5
      
    int v5// [sp+10h] [bp-8h]@2

      
    if ( *(_DWORD *)(a1 452308) == )
      {
        
    sub_8094A10(00"%c \"EXE_CANNOTKICKHOSTPLAYER\""101);
        
    v5 0;
      }
      else
      {
        if ( 
    dest )
        {
          
    sub_80B7AB6(dest, (const char *)(a1 134216), a3);
          
    sub_80B7E54(dest);
        }
        
    v3 = *(_DWORD *)(a1 714500);
        
    sub_808F02E(a1"EXE_PLAYERKICKED");
        *(
    _DWORD *)(a1 134688) = dword_8423084;
        
    v5 v3;
      }
      return 
    v5;

    PHP Code:
    if ( *(_DWORD *)(a1 452308) == 
    PHP Code:
    if( cl->netchan.remoteAddress.type == NA_LOOPBACK 
    NA_BOT = 0

    PHP Code:
    void gsc_player_addresstype(int id) {
        
    #if COD2_VERSION == COD2_VERSION_1_3
            
    int info_start = *(int *)0x08423084;
            
    int info_base = *(int *)0x0842308C;
            
    int info_size 0xB1064;
            
    int info_addresstype_offset 0x6E6D4// same as 1.2
        #else
            #warning gsc_player_addresstype() got no working addresses
            
    int info_start = *(int *)0x0;
            
    int info_base = *(int *)0x0;
            
    int info_size 0x0;
            
    int info_addresstype_offset 0x0;
        
    #endif

        
    int info_player info_base id info_size;
        
    int addrtype info_start - *(unsigned int *)(info_player info_addresstype_offset);
        
    stackPushInt(addrtype);

    1.0 offset is 0x6E5C4.
    Last edited by Mitch; 3rd September 2014 at 09:28.

  9. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    filthy_freak_ (3rd September 2014),kung foo man (3rd September 2014)

  10. #7
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Quote Originally Posted by filthy_freak_ View Post
    I'm only guessing here but I think he's manipulating the default bot name (Which can be done without libcod by editing cod2_mp with a hex editor, but the bot name is limited to 3 chars without libcod) which affects all bots globally.

    If its possible to individually change their name (Without making your own scoreboard/obituary) then by all means prove me wrong =D
    62 6F 74 25 64 found it

    Also, Game Tracker does not count bots as players, but what if they are renamed? Can't test it, haven't got a server.
    Last edited by guiismiti; 3rd September 2014 at 16:07.
    set logfile 2

  11. #8
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    I made some progress to rename them. (1.3)

    PHP Code:
    sub_80B85CE(&dest, (unsigned int)"challenge"v6);
    if ( (
    unsigned __int8)sub_80B2FAA("fs_restrict") )
    {
      
    v7 = (unsigned int)sub_80B8108(&dest, (int)"sv_keywords");
      
    sub_80B7F0A(&s0x400u"demo %s"v7);
      
    sub_80B85CE(&dest, (unsigned int)"sv_keywords", (int)&s);

    Info_SetValueForKey = 0x080B85CE

    PHP Code:
    result sub_808BAF8();
    v3 result;
    if ( 
    result )
    {
      
    sub_8060DEA("userinfo\n");
      
    sub_8060DEA("--------\n");
      
    result sub_80614EA(v3 12); 
    =
    PHP Code:
    cl SV_GetPlayerByName();
    if ( !
    cl ) {
        return;
    }

    Com_Printf"userinfo\n" );
    Com_Printf"--------\n" );
    Info_Printcl->userinfo ); 
    Now i only need to set the name to the client struct.

    In SV_GetPlayerByName function:
    PHP Code:
    sub_80B7AB6(&dest, (const char *)13421664); 
    =
    PHP Code:
    Q_strncpyzcleanNamecl->namesizeof(cleanName) ); 
    Last edited by Mitch; 4th September 2014 at 12:58.

  12. The Following User Says Thank You to Mitch For This Useful Post:

    filthy_freak_ (4th September 2014)

  13. #9
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    I got currently this. I haven't tested or compiled it yet.
    PHP Code:
    void gsc_player_renamebot(int id) {
        
    char key;

        if ( ! 
    stackGetParams("s", &key)) {
            
    printf("scriptengine> ERROR: gsc_player_renamebot(): param \"key\"[1] has to be an string!\n");
            
    stackPushUndefined();
            return;
        }
        
        
    #if COD2_VERSION == COD2_VERSION_1_0
            
    int info_base = *(int *)0x0841FB0C;
            
    int info_size 0x78F14;
        
    #elif COD2_VERSION == COD2_VERSION_1_2
            
    int info_base = *(int *)0x0842200C;
            
    int info_size 0x79064;
        
    #elif COD2_VERSION == COD2_VERSION_1_3
            
    int info_base = *(int *)0x0842308C;
            
    int info_size 0xB1064;
        
    #else
            #warning gsc_player_renamebot() got no working addresses
            
    int info_base = *(int *)0x0;
            
    int info_size 0x0;
        
    #endif

        
    int info_player info_base id info_size;
        
        
    #if COD2_VERSION == COD2_VERSION_1_3
        
    typedef int (*Info_SetValueForKey_t)(char *s, const char *key, const char *value);
        
    Info_SetValueForKey_t Info_SetValueForKey = (Info_SetValueForKey_t)0x080B85CE;
        
        
    Info_SetValueForKey((unsigned int *)(info_player 12), "name"key);
        
    char name = (const char *)(unsigned int *)(info_player 134216);
        
    memcpy(&name[0], key32);
        
    name[31] = '\0';
        
    printf("name = %s\n"name);
        
    #endif

        
    stackPushInt(1);

    https://github.com/M-itch/libcod/com...82494c140901de
    Last edited by Mitch; 5th September 2014 at 08:59.

  14. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    filthy_freak_ (5th September 2014),kung foo man (5th September 2014)

  15. #10
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    You can now download the working version: http://znation.nl/libcod/libcod2_1_3.so (only tested with rcon status)

    PHP Code:
    bot renamebot("NEW NAME"); 
    https://github.com/M-itch/libcod/com...e757e2758eca9a

  16. The Following User Says Thank You to Mitch For This Useful Post:

    filthy_freak_ (5th September 2014)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •