Author Topic: Auto response like thing  (Read 683 times)

I was making a script to Auto Response like This
Player:What is BLID 12247?
Me:BLID 12247 is Me.
But it says Nested add-on Will not execute in console i will get script later
Ok heres the script
Code: [Select]
package Id {
function clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg)
{
parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);
if(getSubStr(%msg,0,strlen("What is BlId number ")) $= "What is Blid number ")
{
%Id = getWords(%msg,4);
%Id = getsubstr(%Id,0,strlen(%Id)-1);
if($Name[%Id] !$= "")
{
commandtoserver('messagesent',"The hex for" SPC %Id SPC "is [" SPC $Name[%Id] SPC "]");
}
}
}
};
Activatepackage(Id);

//Fill in hex codes here
$Name["12247"] = "ChocoboPah";
$Name["6168"] = "camera";
« Last Edit: July 26, 2009, 09:10:18 PM by Pah1023 »

Ok i tryed it and it didnt work
I got this from the Hex code
I sayed What is Blid number 12247? and it didnt respond D=
« Last Edit: July 25, 2009, 11:49:46 PM by Pah1023 »

When defining %id you'll want to use getWord instead of getWords.
Nested addon means you probably don't have it in the add-ons folder, or that it's in add-ons/script_whatever.zip/otherfolder or something. I forgot which.

or that it's in add-ons/script_whatever.zip/otherfolder

i dont have Nested add-on problem any more
and i will try the getWord instead of getWords that might been the problem cause it executes right
Edit:Still doesn't work
Edit agian:Am i packiging it right?
I did this
Ok got the script saved as
Client.cs
Have my description in it
And named the thing named
Client_BLID
« Last Edit: July 26, 2009, 02:13:25 AM by Pah1023 »

What is this hex nonsense?

Also scrap this line and tell us what happens.
%Id = getsubstr(%color,0,strlen(%Id)-1);

What is this hex nonsense?

Also scrap this line and tell us what happens.
%Id = getsubstr(%color,0,strlen(%Id)-1);
I got this from the hex script code the one you say something like this
What is hex for black?
And it responds like this
The hex for black is [000000]

Sorry for double post but i tryed to do it again will this work?
if not can you post what i did wrong?
Code: [Select]
-Snip-
This one works thank you for helping!
« Last Edit: July 26, 2009, 09:25:03 PM by Pah1023 »