• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Quick C++ question (char)

EQManiac

Member
Stupid question I know, but I can't locate the answer in the F1 help in the IDE.

I am trying to find a boolean function that will show if a string exists within another string.

Other languages use functions like "instr" etc..

I need to check for the following

if ("THISTEXT" in (char MyString[2048]))

Simple, I know......

Thanks
 
strcmp or strcmpi or strstr etc...

Rich (BB code):
Routine Use 
_mbscoll, _mbsicoll, _mbsncoll, _mbsnicoll Compare two multibyte-character strings using multibyte code page information (_mbsicoll and _mbsnicoll are case-insensitive) 
_mbsdec, _strdec, _wcsdec Move string pointer back one character 
_mbsinc, _strinc, _wcsinc Advance string pointer by one character 
_mbslen Get number of multibyte characters in multibyte-character string; dependent upon OEM code page 
_mbsnbcat Append, at most, first n bytes of one multibyte-character string to another 
_mbsnbcmp Compare first n bytes of two multibyte-character strings 
_mbsnbcnt Return number of multibyte-character bytes within supplied character count 
_mbsnbcpy Copy n bytes of string 
_mbsnbicmp Compare n bytes of two multibyte-character strings, ignoring case 
_mbsnbset Set first n bytes of multibyte-character string to specified character 
_mbsnccnt Return number of multibyte characters within supplied byte count 
_mbsnextc, _strnextc, _wcsnextc Find next character in string 
_mbsninc. _strninc, _wcsninc Advance string pointer by n characters 
_mbsspnp, _strspnp, _wcsspnp Return pointer to first character in given string that is not in another given string 
_mbstrlen Get number of multibyte characters in multibyte-character string; locale-dependent 
_scprintf, _scwprintf Return the number of characters in a formatted string 
_snscanf, _snwscanf Read formatted data of a specified length from the standard input stream. 
sprintf, _stprintf Write formatted data to a string 
strcat, wcscat, _mbscat Append one string to another 
strchr, wcschr, _mbschr Find first occurrence of specified character in string 
strcmp, wcscmp, _mbscmp Compare two strings 
strcoll, wcscoll, _stricoll, _wcsicoll, _strncoll, _wcsncoll, _strnicoll, _wcsnicoll Compare two strings using current locale code page information (_stricoll, _wcsicoll, _strnicoll, and _wcsnicoll are case-insensitive) 
strcpy, wcscpy, _mbscpy Copy one string to another 
strcspn, wcscspn, _mbscspn,  Find first occurrence of character from specified character set in string 
_strdup, _wcsdup, _mbsdup Duplicate string 
strerror, _wcserror Map error number to message string 
_strerror, __wcserror Map user-defined error message to string 
strftime, wcsftime Format date-and-time string 
_stricmp, _wcsicmp, _mbsicmp Compare two strings without regard to case 
strlen, wcslen, _mbslen, _mbstrlen Find length of string 
_strlwr, _wcslwr, _mbslwr Convert string to lowercase 
strncat, wcsncat, _mbsncat Append characters of string 
strncmp, wcsncmp, _mbsncmp Compare characters of two strings 
strncpy, wcsncpy, _mbsncpy Copy characters of one string to another 
_strnicmp, _wcsnicmp, _mbsnicmp Compare characters of two strings without regard to case 
_strnset, _wcsnset, _mbsnset Set first n characters of string to specified character 
strpbrk, wcspbrk, _mbspbrk Find first occurrence of character from one string in another string 
strrchr, wcsrchr,_mbsrchr Find last occurrence of given character in string 
_strrev, _wcsrev,_mbsrev Reverse string 
_strset, _wcsset, _mbsset Set all characters of string to specified character 
strspn, wcsspn, _mbsspn Find first substring from one string in another string 
strstr, wcsstr, _mbsstr Find first occurrence of specified string in another string 
strtok, wcstok, _mbstok Find next token in string 
_strupr, _wcsupr, _mbsupr Convert string to uppercase 
strxfrm, wcsxfrm Transform string into collated form based on locale-specific information 
vsprintf, _vstprint Write formatted output using a pointer to a list of arguments
 
Funny Cobalt, but helpful :)

strstr, wcsstr, _mbsstr Find first occurrence of specified string in another string

Think my IDE is ganked, it keeps only showing me XML items even though the only languages selected is C++

Thanks
 
Grr, obviously I am not a C++ coder.

I ma trying to make MQ2Irc operate in such a way as to not echo any line to the chat window that contains "UPDATE:" in the text. I am trying to apply the filter after events have been checked.

The code sample below will show how I was hoping to apply this, but I am having no luck.

Rich (BB code):
void ircout(char *text) { 
   if(MyWnd && !strcmp(UseWnd,"Yes")) { 
      DebugTry(((CXWnd*)MyWnd)->Show(1,1)); 
      char processed[MAX_STRING]; 
      StripMQChat(text,processed); 
      CheckChatForEvent(processed); 
	  MQToSTML(text,processed,MAX_STRING);
	  char FilterStr[] = "UPDATE:";
	  char *pdest;
	  pdest = strstr(processed, FilterStr);
	  if( pdest == NULL ) {
		  strcat(processed,"<br>"); 
		  CXStr NewText(processed); 
		  CXSize Whatever;
		  (MyWnd->StmlOut)->AppendSTML(&Whatever,NewText); 
		  (MyWnd->OutWnd)->SetVScrollPos(MyWnd->OutStruct->VScrollMax);
	  }
   } else { 
      WriteChatColor(text,IRCChatColor); 
   } 
   return; 
}

From the way it looks to me "ircout" handles all the screen writes, so it seemed like the logical place to make the alteration. Not being familiar with the language I am most likely missing something.

Thanks for any help.
 
Quick C++ question (char)

Users who are viewing this thread

Back
Top
Cart