Poll

Do you think this can get better in the future?

Yes, I can see that this will be successful with the right coding.
1 (100%)
Yes
0 (0%)
Maybe
0 (0%)
No
0 (0%)
No, this might as well be tossed into the failed addons folder left to die
0 (0%)
I can't confirm or deny about this.
0 (0%)

Total Members Voted: 1

Author Topic: Coding issue  (Read 4902 times)

Here is a significantly better version. The only problem with this is that people will be allowed to use any TML control chars they want (change font, size, etc) Thanks Trinick

Code: [Select]
package tmlChat
{
function serverCmdMessageSent(%client,%message)
{
%message = stripMLControlChars(%message);
%message = strReplace(%message,":)","<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");

$DoNotStripMLControlChars = 1;
parent::serverCmdMessageSent(%client,%message);
$DoNotStripMLControlChars = "";
}

function stripMLControlChars(%flag)
{
if($DoNotStripMLControlChars)
return %flag;
return parent::stripMLControlChars(%flag);
}
};
activatePackage(tmlChat);

Also, this would make a lot more sense as a client add-on.
« Last Edit: December 04, 2012, 10:55:22 PM by Greek2me »

Here is a significantly better version. The only problem with this is that people will be allowed to use any TML control chars they want (change font, size, etc)

Code: [Select]
package tmlChat
{
function serverCmdMessageSent(%client,%message)
{
%message = strReplace(%message,":)","<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");

$DoNotStripMLControlChars = 1;
parent::serverCmdMessageSent(%client,%message);
$DoNotStripMLControlChars = "";
}

function stripMLControlChars(%flag)
{
if($DoNotStripMLControlChars)
return %flag;
return parent::stripMLControlChars(%flag);
}
};
activatePackage(tmlChat);

Also, this would make a lot more sense as a client add-on.
I changed it back to a client side. Thanks for the help! :D

Here is a significantly better version. The only problem with this is that people will be allowed to use any TML control chars they want (change font, size, etc)

Code: [Select]
package tmlChat
{
function serverCmdMessageSent(%client,%message)
{
%message = strReplace(%message,":)","<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");

$DoNotStripMLControlChars = 1;
parent::serverCmdMessageSent(%client,%message);
$DoNotStripMLControlChars = "";
}

function stripMLControlChars(%flag)
{
if($DoNotStripMLControlChars)
return %flag;
return parent::stripMLControlChars(%flag);
}
};
activatePackage(tmlChat);

Also, this would make a lot more sense as a client add-on.
this will work, just ban the people that abuse it

The image doesn't show up :/

Code: [Select]
package tmlChat
{
function serverCmdMessageSent(%client,%message)
{
%message = stripMLControlChars(%message);
%message = strReplace(%message,":)","<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");

$DoNotStripMLControlChars = 1;
parent::serverCmdMessageSent(%client,%message);
$DoNotStripMLControlChars = "";
}

function stripMLControlChars(%flag)
{
if($DoNotStripMLControlChars)
return %flag;
return parent::stripMLControlChars(%flag);
}
};
activatePackage(tmlChat);
Added a line, will prevent abuse.

Still doesn't show up, does demintions matter? It's a 15x15.

Do you have the file in the proper place?


Do you have the file in the proper place?
I'll need to check...

EDIT: The path is right. I used GIMP 2, and layer mask. Does it matter on that end?
« Last Edit: December 05, 2012, 12:05:42 AM by Quinn Mallory »

Post your entire code and the name of the file it is in.

Code: [Select]
package Smiley_System_confused
{
     function ServerCmdMessageSent(%client, %message)
     {
           %message = stripMLControlChars(%message);
           %message = strReplace(%message, ":?", "<bitmap:Add-Ons/Client_Smiley_System/Smileys/confused.png>");
           $DoNotStripMLControlChars = "1";
           parent::ServerCmdMessageSent(%client, %message);
           $DoNotStripMLControlchars = "";
     }
     function stripMLControlchars
     {
           if($DoNotStripMLControlChars)
                return %flag;
           return parent::stripMLControlChars(%flag);
     }
};
activatePackage (Smiley_System_confused);
confused.cs
« Last Edit: December 05, 2012, 01:34:29 AM by Quinn Mallory »

Rename confused.cs "server.cs" and put it in Add-Ons/Script_Confused/server.cs

Then, name a file called "description.txt" and put something in it like your name, and put it in Add-Ons/Script_Confused/description.txt

It should work now.

Confused.cs is part of the smiley system. It's sending the message. I got a idea. When I'm on vacation, I'll upload the .ZIP to mediafire for alpha testing, that's the best I can do.

Confused.cs is part of the smiley system. It's sending the message. I got a idea. When I'm on vacation, I'll upload the .ZIP to mediafire for alpha testing, that's the best I can do.
My bad, I forgot you already had a folder in add-ons. Rename "Confused.cs" to "server.cs" and create a "description.txt"

When you start a server, Blockland scans for folders with "server.cs" in them, and if there is also a "description.txt" it automatically loads them. If they are under any other name (i.e. "Confused.cs") it will not load them.

Won't it be easier to create a server.cs and put all the .cs files regarding the smiley system?
EDIT: I added more to the code, but its deactivating the packages and this in my opinion should be used by people who have the full version in the alpha stages. When its ready, it will be removed. So I got:
Code: [Select]
if (!isUnlocked)
{
 The packages here deactivating
 canvas.pushDialog(SS_Error_Demo);
}

Is this right?

My bad, I forgot you already had a folder in add-ons. Rename "Confused.cs" to "server.cs" and create a "description.txt"

When you start a server, Blockland scans for folders with "server.cs" in them, and if there is also a "description.txt" it automatically loads them. If they are under any other name (i.e. "Confused.cs") it will not load them.
Still no show.
« Last Edit: December 05, 2012, 04:56:51 PM by Quinn Mallory »