File - string search help
#1

Hey,

Since I'm not very good with files, coulnd't find anything on the wiki and didn't find anything on the forums either, I thought I'd just post here.
Anyways, I got this file called 'BanLog.txt' and 'KickLog.txt'. I want to make an IRC command like !whyban [playername] that shows all the times the player has been banned and/or kicked and what the reason was.

Stuff I can't figure out how to do:
  • Searching for the param used in the command in all of the lines of that file.
  • If the param was found in a line, take out all of the information I need and put it in a string.
Код:
[2009/7/23]-[8:30:12]: Matthias has been kicked by Matthias. [Reason: hai]
That is what a line in KickLog.txt looks like. I would like to check for the first 'Matthias' then show the admin who kicked him (second Matthias) and the reason.
I'm not asking for any code here, but I'd appreciate if you guys could give me an example of string-searching like that.

Thanks,
Matthias
Reply


Messages In This Thread
File - string search help - by GTA_Rules - 27.07.2009, 18:17
Re: File - string search help - by MadeMan - 27.07.2009, 18:40
Re: File - string search help - by GTA_Rules - 27.07.2009, 19:11
Re: File - string search help - by MadeMan - 27.07.2009, 19:22
Re: File - string search help - by GTA_Rules - 27.07.2009, 19:31
Re: File - string search help - by MadeMan - 27.07.2009, 19:54
Re: File - string search help - by GTA_Rules - 27.07.2009, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)