Author Topic: getClassName does not show  (Read 1031 times)

When the player is damaged, I made it echo and it tells me their classes, but when the checks come in, it doesn't tell me anything.

Code: [Select]
if(!%obj.LUBot && (%src == 0 || %obj == %src) && isObject(%obj.client))
{
%obj.client.LUHealth = mFloor(%obj.client.LUHealth - %dmg);
%obj.LUFall = true;
%dmg = 0;
echo("Damage - Player is damaging himself");
}

if(%obj.getClassName $= "AIPlayer")
{
%obj.LUBot = true;
   %obj.DmgDEF = %obj.LUDefense;
   %obj.DmgDEFk = getRandom(mFloor(%obj.LUDefense/2),%obj.LUDefense);
   echo("Obj - AIPlayer detected");
}
else if(%obj.getClassName $= "Player")
{
%obj.LUBot = false;
   %obj.DmgDEF = %obj.client.LUDefense;
   %obj.DmgDEFk = getRandom(mFloor(%obj.client.LUDefense/2),%obj.client.LUDefense);
   echo("Obj - Player detected");
}

if(%src.getClassName $= "AIPlayer")
{
%src.LUBot = true;
     %src.DmgATK = %src.LUStrength;
     %src.DmgATKs = %src.LUStrength;
%src.DmgATKa = %src.LUArrowDamage;
echo("Src - AIPlayer detected");
}
else if(%src.getClassName $= "Player")
{
%src.LUBot = false;
     %src.DmgATK = %src.client.LUStrength;
     %src.DmgATKs = %src.client.LUStrength;
%src.DmgATKa = %src.client.LUArrowDamage;
echo("Src - Player detected");
}
   
« Last Edit: June 30, 2013, 07:12:42 PM by Advanced Bot »

Normally when I have a bug I just have something echo whatever isn't working. You could always try that and see what it comes out with.

In this case I would echo(%obj.getClassName);

Normally when I have a bug I just have something echo whatever isn't working. You could always try that and see what it comes out with.

In this case I would echo(%obj.getClassName);

Wait a second, I just found out I forgot to do the () at the end of getClassName, I will try that and see if it was my problem.

EDIT: That was my issue! I just forgot the (). Let's see if they damage correctly.
« Last Edit: June 30, 2013, 07:28:25 PM by Advanced Bot »


EDIT: That was my issue! I just forgot the (). Let's see if they damage correctly.
Oh god this happens so often to me


Semicolons though
Right!?!? I just decided to use TorqueDev IDE to correct my syntax errors :3

Right!?!? I just decided to use TorqueDev IDE to correct my syntax errors :3

I used to use TorqueDev till the company who made it shut down. I don't have a mirror for it :c

I used to use TorqueDev till the company who made it shut down. I don't have a mirror for it :c

Check the coding resource topic, I recall seeing a mirror in there.