27.07.2009, 18:17
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:
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
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]
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