Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
TkBot v2 Help (Merv)

 
Post new topic   Reply to topic Printable version
 View previous topic  Bot to log hosts Post :: Post MEVRbot soccer plugin  View next topic  
Author Message
TheOne
Newbie


Age:41
Gender:Gender:Male
Joined: Sep 04 2005
Posts: 17
Offline

PostPosted: Thu Apr 13, 2006 8:11 pm    Post subject: TkBot v2 Help (Merv) Reply to topic Reply with quote

I'm trying to change a couple of things in the Tk Bot v2 bot by 50% Packetloss.

Now before I changed anything I wanted to see if everything was working, so I compiled. I got these errors:

\command.cpp(493): error C2666: 'String::operator`!='' : 3 overloads have similar conversions

\datatypes.h(198): could be 'bool String::operator !=(const String &)'

\spawn.cpp(57): error C2666: 'String::operator`=='' : 3 overloads have similar conversions




Quote:
spawn.cpp
\TkBot2\spawn.cpp(57) : error C2666: 'String::operator`=='' : 3 overloads have similar conversions
\datatypes.h(194): could be 'bool String::operator ==(const String &)'
\datatypes.h(192): or 'bool String::operator ==(const char *)'
or 'built-in C++ operator==(char *, char *)'
while trying to match the argument list '(String, char [20])'
note: qualification adjustment (const/volatile) may be causing the ambiguity
command.cpp
\TkBot2\command.cpp(493) : error C2666: 'String::operator`!='' : 3 overloads have similar conversions
\datatypes.h(198): could be 'bool String::operator !=(const String &)'
\datatypes.h(196): or 'bool String::operator !=(const char *)'
or 'built-in C++ operator!=(char *, char *)'
while trying to match the argument list '(String, char [20])'
note: qualification adjustment (const/volatile) may be causing the ambiguity
\TkBot2\command.cpp(493) : error C2666: 'String::operator`!='' : 3 overloads have similar conversions
\datatypes.h(198): could be 'bool String::operator !=(const String &)'
\datatypes.h(196): or 'bool String::operator !=(const char *)'
or 'built-in C++ operator!=(char *, char *)'
while trying to match the argument list '(String, char [20])'
note: qualification adjustment (const/volatile) may be causing the ambiguity


The code is:


Code: Show/Hide

                  if(!PlayerName.IsEmpty())
                  {
                     if((PlayerName != p->name) && (PlayerName != me->name))
                     {
                        TkStats* Tker= FindTker(PlayerName);
                        if(Tker == NULL)

and
Code: Show/Hide

{
   _listnode <Player> *pl= playerlist->head;
   bool Found=false;
   while(pl)
   {
      if(Name == pl->item->name)
      {
         Found=true;
         break;
      }
      pl=pl->next;
   }
   return Found;
}


I'd appreciate any help I could get, thanks. icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Apr 14, 2006 2:33 am    Post subject: Reply to topic Reply with quote

Compiles fine here, but you seem to be having problems comparing a char[] to a String with the String overloads.

A way to solve these problems is by using the following.
Note: I commented the original code.
Code: Show/Hide
                  if(!PlayerName.IsEmpty())
                  {
                     if (!CMPSTR(PlayerName, p->name) && !CMPSTR(PlayerName, me->name))
                     //if((PlayerName != p->name) && (PlayerName != me->name))
                     {


Code: Show/Hide
   while(pl)
   {
      if (CMPSTR(Name.msg, pl->item->name))
   //   if(Name == pl->item->name)
      {
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Fri Apr 14, 2006 12:21 pm    Post subject: Reply to topic Reply with quote

Why not just use stricmp()?
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 118 page(s) served in previous 5 minutes.

phpBB Created this page in 0.512230 seconds : 28 queries executed (94.8%): GZIP compression disabled