Topic: Adding Protection by Time on BOT EAs? HELP!
Since there's a lot of users wanting to benefit further from the EAs they generate I wonder if it'd be possible to add a feature to be included in the editor so the extracted version expires on the date set by the user prior extraction, or any other possible way?
In the mean time and since my coding skills aren't too great I'd appreciate some help with writing a piece of code in order to achieve the above. I have successfully completed some other changes as necessary (for personal preferences of course) and I kinda liked getting into it, but here I am stuck.
In the current scenario I have found an example code but I get errors when I try compiling it. I think the main reason is because the coding language in BOT is different to all the examples I've found (maybe c vs c++, not sure). For example, there's a int start function instead of int OnInit. If those suppose to be identical I am not sure..
I got multiple types of errors like unexpected token, name expected, array required etc but I couldn't figure out how to fix it. I placed the code below (without the int start function) in int OnInit like in the picture attached.
int start()
{
string char[256]; int i;
for (i = 0; i < 256; i++) char[i ] = CharToStr(i);
// Date, until which the expert is allowed to work
int LastAllowedDate = StrToTime(
/* 2009.09.11 23:59:00 */
char[50]+char[48]+char[48]+char[57]+char[46]+char[48]+char[57]+char[46]+char[49]+
char[49]+char[32]+char[50]+char[51]+char[58]+char[53]+char[57]+char[58]+char[48]+char[48]
);
if (TimeCurrent() >= LastAllowedDate)
{
Print("Demo period has expired " + TimeToStr(LastAllowedDate,TIME_DATE|TIME_SECONDS));
return(1);
}
Print("You can work until "+ TimeToStr(LastAllowedDate,TIME_DATE|TIME_SECONDS));
}
I have tried different things, all give different types of errors.
I would appreciate any advice / recommendation.
Thanks in advance.