ID:157820
 
I'm not sure exaclty how to do this, but I want to be able to use a link to run a text file and a link to download a text file. This is the code I have so far. But, only one works at a time, and the other one the link just hangs.

mob
Login()
loc=locate(1,1,1)
usr.icon = 'guy.dmi'
usr.icon_state = "guy"
usr << "Download the <A HREF=#Help1> help1 file </A> if new here"
usr << "<font color=green>Run the <A HREF=#Help> help file </A>if new"


//sends help file to players when they click

client/Topic(D)
if(D == "Help1")
usr << ftp("help1.txt")



//run file output displays specified file

client/Topic(T)
if(T == "Help")
usr << run("help.txt")


Im thinking maybe I would need a verb to switch between them, but there must be a better way, right? I coudln't even create a verb to switch between two client topics !_!....
If you override a proc, ..() will call the overridden version of a proc.
Garthor is right, but since he didnt fix the code, keep what he said in mind and check here for better understandning


//Way one (also best way to fix the problem IMO)

client/Topic(D)
switch(D)
if("Help1")usr << ftp("help1.txt")
if("Help")usr << run("help.txt")
else ..()

//Second way (for when you have to split the topic, which is definitly not the case)

client/Topic(D)
if(D == "Help1")
usr << ftp("help1.txt")
..() //Calls what the proc was originally intended to do



client/Topic(T)
if(T == "Help")
usr << run("help.txt")
..()
In response to Garthor
Garthor wrote:
If you override a proc, ..() will call the overridden version of a proc.

So, for a better understanding, what in my code was overridden?
In response to Darkjohn66
you made topic twice withtout the ..(), therefore only one of them was being called

Did you check my example?