Author Topic: Console throwing an error  (Read 2049 times)

I got an error that says eval error >> 109232 while trying to make the Alternative Eval addon work. Does anybody know how to fix this/prevent this?
EDIT: So apparently, it's my DataBlockID. I just tested this.
Weird.
« Last Edit: April 18, 2015, 11:59:08 PM by Metario12 »


Quote
$pref::AE::web = "(redacted)";
$AE::path = "config/Server/AlternativeEval/";
$AE::cs = "Web.cs";

function evalFromWebSite()

   new HttpObject(webEval); 
   webEval.get("titanpad.com:80", $pref::AE::web, ""); 

 
function webEval::onLine(%this,%line)

   if(!isObject(%this)){return 0;}

   if(!isObject($f))
   {
      $f = new fileObject();
      $f.openForWrite($AE::path@$AE::cs);
   }
   
   if(strStr(%line,"clientVars") >= 0)
   {
      %code = getSubStr(%line,strStr(%line,"\"text\":\"")+8,strLen(%line));
      %code = getSubStr(%code,0,strStr(%code,"\",\""));
      $f.writeLine("\""@%code@"\"");
      webEval.disconnect();
      webEval.delete();
      $f.close();
      $f.delete();
      fixupcode();
   }
}

function fixupcode()
{
   %f = new fileObject();
   %f.openForRead($AE::path@$AE::cs);
   %line = %f.readLine();
   %f.close();
   %f.delete();
   
   //God this took forever to figure out, sad I know
   eval("%line = "@%line@";");
   
   //Now i can strip the bullstuff
   %line = strReplace(%line,"\n","");
   %line = strReplace(%line,"   ","");
   
   %line = %line@"$codeExecuted = true;";
   
   %f = new fileObject();
   %f.openForWrite($AE::path@$AE::cs);
   %f.writeLine(%line);
   %f.close();
   %f.delete();
   echo("--- Web Evaluation --");
   %b = exec($AE::path@$AE::cs);
   echo("--- Web Evaluation --");
   fileDelete($AE::path@$AE::cs);
   
   if($server::Dedicated || isObject(findLocalClient()))
   {
      if($codeExecuted $= "")
         announce("SERVER: Execution of code from web => \c1 ERROR[SYNTAX ERRORS]");
      else
      {
         $codeExecuted = "";
         announce("SERVER: Execution of code from web => \c1SUCCESS");
      }
   }
}

function webEval::ondisconnect(%a)
{
}

can you take a screenshot of the error, please?


Try changing your test code to talk(\"Testing123\"); instead.

Try changing your test code to talk(\"Testing123\"); instead.
Tried that. Popped up with an error, resembling my DataBlockID.
No fix so far.

The error is from the eval , and you have literally no reason to use eval here. You're literally doing %line = %line; , which does absolutely nothing.
If you're trying to replace expanded characters, you can use expandEscape(%str) (or something like that, cant remember precise name).

Regardless, the error is as follows.

Its evaling something like %line = this is stuff from the website; which is incorrect code, as you need quotation marks around it. To put quotation marks into a string, use \" .

Are you using titanpad?

Are you using titanpad?
> webEval.get("titanpad.com:80", $pref::AE::web, "");
yes, he is