Blockland Forums > Modification Help
Calling A Function In A Function
Mawpius:
--- Code: ---function One(%client)
{
schedule(1000,0,"Two",%client);
//Do stuff
}
function Two(%client)
{
//delayed 1000 milliseconds
One(%client);
}
--- End code ---
Kalphiter:
If you're only going to call the function you just came from then make it call itself:
--- Code: ---function One(%client)
{
schedule(1000, 0, One, %client);
}
--- End code ---
jes00:
--- Quote from: Kalphiter on October 10, 2011, 05:20:24 PM ---If you're only going to call the function you just came from then make it call itself:
--- Code: ---function One(%client)
{
schedule(1000, 0, One, %client);
}
--- End code ---
--- End quote ---
You can do that?
EDIT: Oh and is there a way to make the delay a variable for an RTB pref?
mp7964:
--- Quote from: jes00 on October 10, 2011, 05:31:52 PM ---You can do that?
EDIT: Oh and is there a way to make the delay a variable for an RTB pref?
--- End quote ---
--- Code: ---$Mod::Time = 5000
//RTBPref
RTB_registerPref("Pref Name","Category","$Mod::Time","int 10000 50000", "Name","5000",0,0,);
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
if(!$RTB::RTBR_ServerControl_Hook)
exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");
RTB_registerPref("Duplicator Timeout","Duplicator","Duplicator::Timeout","int 0 60","Tool_Duplicator",40,0,0);
}
else
{
$Mod::Time = 15000;
function One(%client)
}
schedule($Mod::Time, 0, One, %client);
}
--- End code ---
That should work for the RTB pref.
phflack:
--- Quote from: jes00 on October 10, 2011, 05:31:52 PM ---You can do that?
EDIT: Oh and is there a way to make the delay a variable for an RTB pref?
--- End quote ---
you can call the function itself, and make it recursive if you wanted