Author | Message | Time |
---|---|---|
dodge | I'm making a safelist, and everytime it's call the bot inputs from a text file and puts the names in a hidden listbox, if the last letter is "M" or "S" (flags Master or SafeList) but I'm stuck on finding out if the last letter is "M"... this is what I had [code] If Right((LCase(i)), 1) = ("M") Then lstSafeList.AddItem (i) End If [/code] i is what's being inputted. it I switch Right to Left and M to A it works, but not the other way around.. and I understand why, but why not if it's Right? The Users.txt contains: aW.ExaM aW.FluXeD | June 21, 2004, 2:51 AM |
shadypalm88 | [quote author=dodge link=board=17;threadid=7364;start=0#msg66441 date=1087786261] I'm making a safelist, and everytime it's call the bot inputs from a text file and puts the names in a hidden listbox, if the last letter is "M" or "S" (flags Master or SafeList) but I'm stuck on finding out if the last letter is "M"... this is what I had [code] If Right((LCase(i)), 1) = ("M") Then lstSafeList.AddItem (i) End If [/code] i is what's being inputted. it I switch Right to Left and M to A it works, but not the other way around.. and I understand why, but why not if it's Right? The Users.txt contains: aW.ExaM aW.FluXeD [/quote]First of all, using a ListBox like that is slow and bad practice... but that's another topic. You are converting i to lower case, but checking if the last letter is an upper-case M. Easy thing to overlook. | June 21, 2004, 4:31 AM |
dodge | what would you suggest? just inputting from the file everytime that command is executed? ie: /protect on )input safelist.txt? | June 21, 2004, 1:41 PM |
hismajesty | In your ban processor, or where the ban command is, check the safelist. | June 21, 2004, 2:02 PM |
shadypalm88 | [quote author=dodge link=board=17;threadid=7364;start=0#msg66491 date=1087825299] what would you suggest? just inputting from the file everytime that command is executed? ie: /protect on )input safelist.txt? [/quote]I would suggest adding the safelist to an array or collection, and then checking that on things like your ban and kick commands, when people are banned, etc. | June 21, 2004, 2:25 PM |
dodge | kk thanks:) | June 21, 2004, 3:19 PM |