BanList()
set category = "Admin"
if(Admin_Allow() == 0) alert(usr,"Your may not do that.") ; return
var/NBans
if(!Bans) usr<<"There are no Perm. Bans on this server."
else usr<<"There are some Perm. Bans on this server." ; NBans+=1
if(!Temp_Bans) usr<<"There are no Temp. Bans on this server."
else usr<<"There are some Temp. Bans on this server." ; NBans+=1
if(!(NBans)) return
var/List=input("Which list would you like to see?") in list("Key","IP","Computer","All")
usr<<"Retrieving Ban List."
if(List == "Key"||List == "All")
if(findtext("Key:",Bans)) usr<<"[copytext(Bans,1,50)]"
else usr<<"There are no Perm. Key Bans."
if(findtext("Key:",Bans)) usr<<"[copytext(Temp_Bans,1,50)]"
else usr<<"There are no Temp. Key Bans."
if(List == "IP"||List == "All")
if(findtext("Key:",Bans)) usr<<"[copytext(Bans,1,50)]"
else usr<<"There are no Perm. IP Bans."
if(findtext("Key:",Bans)) usr<<"[copytext(Temp_Bans,1,50)]"
else usr<<"There are no Temp. IP Bans."
if(List == "Computer"||List == "All")
if(findtext("CPU:",Bans)) usr<<"[copytext(Bans,Start=1,End=50)]"
else usr<<"There are no Perm. CPU Bans."
if(findtext("CPU:",Temp_Bans)) usr<<"[copytext(Temp_Bans,Start=1,End=50)]"
else usr<<"There are no Temp. CPU Bans."
Question: I know this code would never work because of the copytext, anyways, so is there a way to only use Temp_Bans and Bans to hold all three types of bans?(Key, IP, and CPU)
1: This code could work if you used a system more like this:
var/X=findtext("BLAH")
copytext(Text,X,X+length("BLAH"))
Because findtext doesn't return TRUE or FALSE, it returns the location it found the text in whatever you're searching.
And in response to your question: Yes, this is possible. I wouldn't advise using a text system like this.. But it would just require understanding parsing.