Jump to content
SubSpace Forum Network

Recommended Posts

Posted

Well im making a football bot, needing to know how i can make it so i can set the ball position.. Heres my idea with it..

 

1. Well, for example, the Mod/Ref types !ball 44, it *setships the Mod/Ref to ship 8, warps the player to the ball coords, and then the 44 yard line. The problem is, i dunno how to get the coords of the ball.. Any help??

 

2. I would like to use a !spec command to spec players. Yes i know !spec is a bot command to spec/unspec the bot, i will use !s or something. So i want it to do !s Deadly, and specs DeadlySoldier!! into spec (*spec). I know you have to make it look through the playerlist to find Deadly, but im not sure how. Also how can you make it so u do !s Dead and it looks for the closest person to what you typed?

 

Thanks,

 

-DeadlySoldier!!

Posted

No no, it all compiles i do !aa DeadlySoldier!! and it doesnt do anything

 

     if(c->check("aa")) 

	 { 

   _listnode <Player> * parse = playerlist->head; 

	 while(parse) 

   { 

	 if(parse->item->name == c->final) 

   { 

	 sendPrivate(parse->item,"*spec"); 

	 sendPrivate(p, "Player Specced");

	 } 

	 parse = parse->next; 

   } 

	 }

Posted

if(c->check("s")) {

 _listnode <Player> * parse = PlayerList.head;

 while(parse) {

   if(0 == stricmp(parse->item->name, c->final)) {

     sendPrivate(parse>item,"*spec");

     sendPrivate(parse>item,"*spec");

   }

   parse = parse->next;

 }

}

 

parse->item->name and c->final are both char pointers, so you can't use an ==. If one was a string you could, or you could cast one to a string.

 

If you change

if (0 == stricmp(parse->item->name, c->final))

to

if (cmpstart(parse->item->name, c->final))

it should just check the start of the name, so you can use !aa Deadly and it will match DeadlySoldier.

Posted
If you change

if (0 == stricmp(parse->item->name, c->final))

to

if (cmpstart(parse->item->name, c->final))

it should just check the start of the name, so you can use !aa Deadly and it will match DeadlySoldier.

 

Well the bot specs them now, but

 

if (cmpstart(parse->item->name, c->final))

 

and

 

if (0 == stricmp(parse->item->name, c->final))

 

both do the same thing, you have to type the full name.

Posted

Perhaps I got the paramaters to CMPSTART the wrong way round, but I'm pretty sure I remembered correctly...

Try swapping the two.

 

The "ball thing" isn't possible (unless perhaps the ball's momentum is disabled) as merv cannot determine the position of a ball. If it is being held by a player it knows where the ball is, so if it had no momentum after being dropped you would always know where it is. It would make for a crappy football game though.

Posted

Ok so i had some problems it wasnt doing everything, i relised it was, it was just doing *warpto then *spec right away REALLY fast so it didnt even get to the ball to move it..

 

Now i have it all working how i wanted it to.. just after like 4 times doing this you get dc'd for too many ship changes

 

that just sucks man how can i fix that

Guest
This topic is now closed to further replies.
×
×
  • Create New...