Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Renaming bots

  1. #21
    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
    Yup can confirm there is no default player.isBot function. I remember checking for this a while ago.
    I was planning on adding 'if(player isbot())' but i renamed the function to 'getAddressType'. Because you can use it for more than bots. So it is now 'if(player getAddressType() == 0)'.

    You can use 'if(isDefined(player.isbot))'. But you need to set it after creating the test client.

    PHP Code:
    ent[i] = addtestclient();
    ent[i].isbot true
    getAddressType types
    0 = NA_BOT
    1 = NA_BAD (an address lookup failed)
    2 = NA_LOOPBACK
    3 = NA_BROADCAST
    4 = NA_IP
    5 = NA_IPX (ipv6, possibly unsupported)
    6 = NA_BROADCAST_IPX
    Last edited by Mitch; 11th September 2014 at 09:54.

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

    kung foo man (11th September 2014)

  3. #22
    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 use 'if(isDefined(player.isbot))'. But you need to set it after creating the test client.
    Yes this is what I did many months ago. No problems. Was just confirming that kung is correct.

  4. #23
    Private First Class php's Avatar
    Join Date
    Nov 2012
    Posts
    142
    Thanks
    28
    Thanked 116 Times in 59 Posts
    Or how about just hook the player/class memberfields so you can make a default player.isbot attribute.

  5. #24
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Just found this in mbot.gsc from meatbot:

    Code:
    addlotdaxis() //<Master|dEvis>
    {
    bot = undefined;
    if(!isdefined(bot))
    	bot = addtestclient();
            
    
    		if(isdefined(bot))
    		{
    		pweapon = "";
    		bot.isbot = true;
    		bot thread botJoin("axis", pweapon); 
    		}
    		if(isdefined(level.botstart))
    		{
    			bot thread [[level.botstart]]();
    		}	
    }

  6. #25
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by guiismiti View Post
    Just found this in mbot.gsc from meatbot:
    What about it?

  7. #26
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I'm just showing where isbot is defined in meatbot

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
  •